diff --git a/lib/services/computeManagement2/lib/computeManagementClient.d.ts b/lib/services/computeManagement2/lib/computeManagementClient.d.ts index 09597cb162..5d2b77002c 100644 --- a/lib/services/computeManagement2/lib/computeManagementClient.d.ts +++ b/lib/services/computeManagement2/lib/computeManagementClient.d.ts @@ -17,9 +17,9 @@ declare class ComputeManagementClient { * Initializes a new instance of the ComputeManagementClient class. * @constructor * - * @param {credentials} credentials - Gets Azure subscription credentials. + * @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} subscriptionId - Subscription credentials that uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. * * @param {string} [baseUri] - The base URI of the service. * @@ -61,7 +61,7 @@ declare class ComputeManagementClient { virtualMachines: operations.VirtualMachines; virtualMachineScaleSets: operations.VirtualMachineScaleSets; virtualMachineScaleSetVMs: operations.VirtualMachineScaleSetVMs; - containerServiceOperations: operations.ContainerServiceOperations; + containerServices: operations.ContainerServices; } export = ComputeManagementClient; diff --git a/lib/services/computeManagement2/lib/computeManagementClient.js b/lib/services/computeManagement2/lib/computeManagementClient.js index ea41674e79..b860f94958 100644 --- a/lib/services/computeManagement2/lib/computeManagementClient.js +++ b/lib/services/computeManagement2/lib/computeManagementClient.js @@ -27,9 +27,9 @@ var operations = require('./operations'); * Initializes a new instance of the ComputeManagementClient class. * @constructor * - * @param {credentials} credentials - Gets Azure subscription credentials. + * @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} subscriptionId - Subscription credentials that uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. * * @param {string} [baseUri] - The base URI of the service. * @@ -88,7 +88,7 @@ function ComputeManagementClient(credentials, subscriptionId, baseUri, options) this.virtualMachines = new operations.VirtualMachines(this); this.virtualMachineScaleSets = new operations.VirtualMachineScaleSets(this); this.virtualMachineScaleSetVMs = new operations.VirtualMachineScaleSetVMs(this); - this.containerServiceOperations = new operations.ContainerServiceOperations(this); + this.containerServices = new operations.ContainerServices(this); this.models = models; msRest.addSerializationMixin(this); } diff --git a/lib/services/computeManagement2/lib/models/additionalUnattendContent.js b/lib/services/computeManagement2/lib/models/additionalUnattendContent.js index 44f68b795c..4119143a80 100644 --- a/lib/services/computeManagement2/lib/models/additionalUnattendContent.js +++ b/lib/services/computeManagement2/lib/models/additionalUnattendContent.js @@ -14,14 +14,15 @@ * @class * Initializes a new instance of the AdditionalUnattendContent class. * @constructor - * additional XML formatted information that can be included in the + * 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 a * applied. - * @member {string} [passName] the pass name. Currently, the only allowable + * + * @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 + * @member {string} [componentName] The component name. Currently, the only * allowable value is Microsoft-Windows-Shell-Setup. Possible values include: * 'Microsoft-Windows-Shell-Setup' * @@ -29,9 +30,9 @@ * AutoLogon ). Possible values include: 'AutoLogon', 'FirstLogonCommands' * * @member {string} [content] XML formatted content that is added to the - * unattend.xml file in the specified pass and component.The XML must be less - * than 4 KB and must include the root element for the setting or feature - * that is being inserted. + * unattend.xml file in the specified pass and component. The XML must be + * less than 4 KB and must include the root element for the setting or + * feature that is being inserted. * */ function AdditionalUnattendContent() { diff --git a/lib/services/computeManagement2/lib/models/apiEntityReference.js b/lib/services/computeManagement2/lib/models/apiEntityReference.js index 74d342f670..7e500017c4 100644 --- a/lib/services/computeManagement2/lib/models/apiEntityReference.js +++ b/lib/services/computeManagement2/lib/models/apiEntityReference.js @@ -15,6 +15,7 @@ * 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}/... * diff --git a/lib/services/computeManagement2/lib/models/apiError.js b/lib/services/computeManagement2/lib/models/apiError.js index e7cf19b8e8..694cdfd537 100644 --- a/lib/services/computeManagement2/lib/models/apiError.js +++ b/lib/services/computeManagement2/lib/models/apiError.js @@ -19,6 +19,7 @@ var util = require('util'); * 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 diff --git a/lib/services/computeManagement2/lib/models/apiErrorBase.js b/lib/services/computeManagement2/lib/models/apiErrorBase.js index b89a687164..15568a4f79 100644 --- a/lib/services/computeManagement2/lib/models/apiErrorBase.js +++ b/lib/services/computeManagement2/lib/models/apiErrorBase.js @@ -15,6 +15,7 @@ * 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. diff --git a/lib/services/computeManagement2/lib/models/availabilitySet.js b/lib/services/computeManagement2/lib/models/availabilitySet.js index addaf7edeb..3d9e854ea9 100644 --- a/lib/services/computeManagement2/lib/models/availabilitySet.js +++ b/lib/services/computeManagement2/lib/models/availabilitySet.js @@ -19,12 +19,13 @@ var util = require('util'); * Initializes a new instance of the AvailabilitySet class. * @constructor * Create or update Availability Set parameters. + * * @member {number} [platformUpdateDomainCount] Update Domain count. * * @member {number} [platformFaultDomainCount] Fault Domain count. * - * @member {array} [virtualMachines] a list containing reference to all - * Virtual Machines created under this Availability Set. + * @member {array} [virtualMachines] A list of references to all virtual + * machines in the availability set. * * @member {array} [statuses] the resource status information. * @@ -125,6 +126,7 @@ AvailabilitySet.prototype.mapper = function () { }, statuses: { required: false, + readOnly: true, serializedName: 'properties.statuses', type: { name: 'Sequence', diff --git a/lib/services/computeManagement2/lib/models/availabilitySetListResult.js b/lib/services/computeManagement2/lib/models/availabilitySetListResult.js index 17acdcdd1b..6f091f3a23 100644 --- a/lib/services/computeManagement2/lib/models/availabilitySetListResult.js +++ b/lib/services/computeManagement2/lib/models/availabilitySetListResult.js @@ -17,8 +17,7 @@ var util = require('util'); * Initializes a new instance of the AvailabilitySetListResult class. * @constructor * The List Availability Set operation response. - * @member {array} [value] the list of availability sets - * + * */ function AvailabilitySetListResult() { } diff --git a/lib/services/computeManagement2/lib/models/bootDiagnostics.js b/lib/services/computeManagement2/lib/models/bootDiagnostics.js index 4b62daa68a..4d740d3a2d 100644 --- a/lib/services/computeManagement2/lib/models/bootDiagnostics.js +++ b/lib/services/computeManagement2/lib/models/bootDiagnostics.js @@ -15,11 +15,12 @@ * Initializes a new instance of the BootDiagnostics class. * @constructor * Describes Boot Diagnostics. - * @member {boolean} [enabled] whether boot diagnostics should be enabled on + * + * @member {boolean} [enabled] Whether boot diagnostics should be enabled on * the Virtual Machine. * - * @member {string} [storageUri] the boot diagnostics storage Uri. It should - * be a valid Uri + * @member {string} [storageUri] URI of the storage account to use for placing + * the console output and screenshot. * */ function BootDiagnostics() { diff --git a/lib/services/computeManagement2/lib/models/bootDiagnosticsInstanceView.js b/lib/services/computeManagement2/lib/models/bootDiagnosticsInstanceView.js index 92d1d68e09..dea6ee9ef8 100644 --- a/lib/services/computeManagement2/lib/models/bootDiagnosticsInstanceView.js +++ b/lib/services/computeManagement2/lib/models/bootDiagnosticsInstanceView.js @@ -15,9 +15,10 @@ * 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} [consoleScreenshotBlobUri] The console screenshot blob URI. * - * @member {string} [serialConsoleLogBlobUri] the Linux serial console log + * @member {string} [serialConsoleLogBlobUri] The Linux serial console log * blob Uri. * */ diff --git a/lib/services/computeManagement2/lib/models/computeLongRunningOperationProperties.js b/lib/services/computeManagement2/lib/models/computeLongRunningOperationProperties.js index cc0a454264..44f7f42ec9 100644 --- a/lib/services/computeManagement2/lib/models/computeLongRunningOperationProperties.js +++ b/lib/services/computeManagement2/lib/models/computeLongRunningOperationProperties.js @@ -15,6 +15,7 @@ * Initializes a new instance of the ComputeLongRunningOperationProperties class. * @constructor * Compute-specific operation properties, including output + * * @member {object} [output] Operation output data (raw JSON) * */ diff --git a/lib/services/computeManagement2/lib/models/computeLongRunningOperationResult.js b/lib/services/computeManagement2/lib/models/computeLongRunningOperationResult.js deleted file mode 100644 index 89ebc47f08..0000000000 --- a/lib/services/computeManagement2/lib/models/computeLongRunningOperationResult.js +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -var models = require('./index'); - -/** - * @class - * Initializes a new instance of the ComputeLongRunningOperationResult class. - * @constructor - * The Compute service response for long-running operations. - * @member {string} [operationId] Gets the operation identifier. - * - * @member {string} [status] Gets the operation status. Possible values - * include: 'InProgress', 'Failed', 'Succeeded', 'Preempted' - * - * @member {date} [startTime] Gets the operation start time - * - * @member {date} [endTime] Gets the operation end time - * - * @member {object} [properties] - * - * @member {object} [properties.output] Operation output data (raw JSON) - * - * @member {object} [error] Gets the operation error, if any occurred. - * - * @member {array} [error.details] Gets or sets the Api error details - * - * @member {object} [error.innererror] Gets or sets the Api inner error - * - * @member {string} [error.innererror.exceptiontype] Gets or sets the - * exception type. - * - * @member {string} [error.innererror.errordetail] Gets or sets the internal - * error message or exception dump. - * - * @member {string} [error.code] Gets or sets the error code. - * - * @member {string} [error.target] Gets or sets the target of the particular - * error. - * - * @member {string} [error.message] Gets or sets the error message. - * - */ -function ComputeLongRunningOperationResult() { -} - -/** - * Defines the metadata of ComputeLongRunningOperationResult - * - * @returns {object} metadata of ComputeLongRunningOperationResult - * - */ -ComputeLongRunningOperationResult.prototype.mapper = function () { - return { - required: false, - serializedName: 'ComputeLongRunningOperationResult', - type: { - name: 'Composite', - className: 'ComputeLongRunningOperationResult', - modelProperties: { - operationId: { - required: false, - serializedName: 'operationId', - type: { - name: 'String' - } - }, - status: { - required: false, - serializedName: 'status', - type: { - name: 'Enum', - allowedValues: [ 'InProgress', 'Failed', 'Succeeded', 'Preempted' ] - } - }, - startTime: { - required: false, - serializedName: 'startTime', - type: { - name: 'DateTime' - } - }, - endTime: { - required: false, - serializedName: 'endTime', - type: { - name: 'DateTime' - } - }, - properties: { - required: false, - serializedName: 'properties', - type: { - name: 'Composite', - className: 'ComputeLongRunningOperationProperties' - } - }, - error: { - required: false, - serializedName: 'error', - type: { - name: 'Composite', - className: 'ApiError' - } - } - } - } - }; -}; - -module.exports = ComputeLongRunningOperationResult; diff --git a/lib/services/computeManagement2/lib/models/containerService.js b/lib/services/computeManagement2/lib/models/containerService.js index f1257740a7..617597b204 100644 --- a/lib/services/computeManagement2/lib/models/containerService.js +++ b/lib/services/computeManagement2/lib/models/containerService.js @@ -18,57 +18,72 @@ var util = require('util'); * @class * Initializes a new instance of the ContainerService class. * @constructor - * Container service - * @member {string} [provisioningState] the provisioning state, which only - * appears in the response. + * 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' + * + * @member {object} [customProfile] Properties for custom clusters. * - * @member {object} [orchestratorProfile] Properties of orchestrator + * @member {string} [customProfile.orchestrator] The name of the custom + * orchestrator to use. * - * @member {string} [orchestratorProfile.orchestratorType] Specifies what - * orchestrator will be used to manage container cluster resources. Possible - * values include: 'Swarm', 'DCOS' + * @member {object} [servicePrincipalProfile] Properties for cluster service + * principals. * - * @member {object} masterProfile Properties of master agents + * @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 cluster + * 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 - * FQDN for master + * the FQDN for master. * - * @member {string} [masterProfile.fqdn] FDQN for the master + * @member {string} [masterProfile.fqdn] FDQN for the master. * - * @member {array} agentPoolProfiles Properties of agent pools + * @member {array} agentPoolProfiles Properties of the agent pool. * - * @member {object} [windowsProfile] Properties of Windows VMs + * @member {object} [windowsProfile] Properties of Windows VMs. * - * @member {string} [windowsProfile.adminUsername] The administrator username - * to use for Windows VMs + * @member {string} [windowsProfile.adminUsername] The administrator user name + * to use for Windows VMs. * * @member {string} [windowsProfile.adminPassword] The administrator password - * to use for Windows VMs + * to use for Windows VMs. * - * @member {object} linuxProfile Properties for Linux VMs + * @member {object} linuxProfile Properties of Linux VMs. * - * @member {string} [linuxProfile.adminUsername] The administrator username to - * use for all Linux VMs + * @member {string} [linuxProfile.adminUsername] The administrator user name + * to use for Linux VMs. * - * @member {object} [linuxProfile.ssh] Specifies the ssh key configuration 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 {array} [linuxProfile.ssh.publicKeys] The list of SSH public keys + * used to authenticate with Linux-based VMs. * - * @member {object} [diagnosticsProfile] Properties for Diagnostic Agent + * @member {object} [diagnosticsProfile] Properties of the diagnostic agent. * - * @member {object} [diagnosticsProfile.vmDiagnostics] Profile for container - * service VM diagnostic agent + * @member {object} [diagnosticsProfile.vmDiagnostics] Profile for the + * container service VM diagnostic agent. * - * @member {boolean} [diagnosticsProfile.vmDiagnostics.enabled] whether VM - * Diagnostic Agent should be provisioned on the Virtual Machine. + * @member {boolean} [diagnosticsProfile.vmDiagnostics.enabled] Whether the VM + * diagnostic agent is provisioned on the VM. * - * @member {string} [diagnosticsProfile.vmDiagnostics.storageUri] whether VM - * Diagnostic Agent should be provisioned on the Virtual Machine. + * @member {string} [diagnosticsProfile.vmDiagnostics.storageUri] The URI of + * the storage account where diagnostics are stored. * */ function ContainerService() { @@ -152,6 +167,22 @@ ContainerService.prototype.mapper = function () { 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', diff --git a/lib/services/computeManagement2/lib/models/containerServiceAgentPoolProfile.js b/lib/services/computeManagement2/lib/models/containerServiceAgentPoolProfile.js index d621b866d8..d327201ce2 100644 --- a/lib/services/computeManagement2/lib/models/containerServiceAgentPoolProfile.js +++ b/lib/services/computeManagement2/lib/models/containerServiceAgentPoolProfile.js @@ -14,14 +14,16 @@ * @class * Initializes a new instance of the ContainerServiceAgentPoolProfile class. * @constructor - * Profile for container service agent pool - * @member {string} name Unique name of the agent pool profile within the - * context of the subscription and resource group + * 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] No. of agents (VMs) that will host docker - * containers + * @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. * - * @member {string} [vmSize] Size of agent VMs. Possible values include: + * @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', @@ -35,10 +37,10 @@ * 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', * 'Standard_GS5' * - * @member {string} dnsPrefix DNS prefix to be used to create FQDN for this - * agent pool + * @member {string} dnsPrefix DNS prefix to be used to create the FQDN for the + * agent pool. * - * @member {string} [fqdn] FDQN for the agent pool + * @member {string} [fqdn] FDQN for the agent pool. * */ function ContainerServiceAgentPoolProfile() { @@ -66,7 +68,7 @@ ContainerServiceAgentPoolProfile.prototype.mapper = function () { } }, count: { - required: false, + required: true, serializedName: 'count', constraints: { InclusiveMaximum: 100, @@ -77,7 +79,7 @@ ContainerServiceAgentPoolProfile.prototype.mapper = function () { } }, vmSize: { - required: false, + required: true, serializedName: 'vmSize', type: { name: 'String' diff --git a/lib/services/computeManagement2/lib/models/containerServiceCustomProfile.js b/lib/services/computeManagement2/lib/models/containerServiceCustomProfile.js new file mode 100644 index 0000000000..e930d27d25 --- /dev/null +++ b/lib/services/computeManagement2/lib/models/containerServiceCustomProfile.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the ContainerServiceCustomProfile class. + * @constructor + * Properties to configure a custom container service cluster. + * + * @member {string} orchestrator The name of the custom orchestrator to use. + * + */ +function ContainerServiceCustomProfile() { +} + +/** + * Defines the metadata of ContainerServiceCustomProfile + * + * @returns {object} metadata of ContainerServiceCustomProfile + * + */ +ContainerServiceCustomProfile.prototype.mapper = function () { + 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/models/containerServiceDiagnosticsProfile.js b/lib/services/computeManagement2/lib/models/containerServiceDiagnosticsProfile.js index 7734df62be..080c69ff72 100644 --- a/lib/services/computeManagement2/lib/models/containerServiceDiagnosticsProfile.js +++ b/lib/services/computeManagement2/lib/models/containerServiceDiagnosticsProfile.js @@ -16,14 +16,14 @@ var models = require('./index'); * @class * Initializes a new instance of the ContainerServiceDiagnosticsProfile class. * @constructor - * @member {object} [vmDiagnostics] Profile for container service VM - * diagnostic agent + * @member {object} vmDiagnostics Profile for the container service VM + * diagnostic agent. * - * @member {boolean} [vmDiagnostics.enabled] whether VM Diagnostic Agent - * should be provisioned on the Virtual Machine. + * @member {boolean} [vmDiagnostics.enabled] Whether the VM diagnostic agent + * is provisioned on the VM. * - * @member {string} [vmDiagnostics.storageUri] whether VM Diagnostic Agent - * should be provisioned on the Virtual Machine. + * @member {string} [vmDiagnostics.storageUri] The URI of the storage account + * where diagnostics are stored. * */ function ContainerServiceDiagnosticsProfile() { @@ -44,7 +44,7 @@ ContainerServiceDiagnosticsProfile.prototype.mapper = function () { className: 'ContainerServiceDiagnosticsProfile', modelProperties: { vmDiagnostics: { - required: false, + required: true, serializedName: 'vmDiagnostics', type: { name: 'Composite', diff --git a/lib/services/computeManagement2/lib/models/containerServiceLinuxProfile.js b/lib/services/computeManagement2/lib/models/containerServiceLinuxProfile.js index 7afa93874c..9fcb658a49 100644 --- a/lib/services/computeManagement2/lib/models/containerServiceLinuxProfile.js +++ b/lib/services/computeManagement2/lib/models/containerServiceLinuxProfile.js @@ -16,14 +16,15 @@ var models = require('./index'); * @class * Initializes a new instance of the ContainerServiceLinuxProfile class. * @constructor - * Profile for Linux VMs - * @member {string} adminUsername The administrator username to use for all - * Linux VMs + * Profile for Linux VMs in the container service cluster. + * + * @member {string} adminUsername The administrator user name to use for Linux + * VMs. * - * @member {object} ssh Specifies the ssh key configuration 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 + * @member {array} [ssh.publicKeys] The list of SSH public keys used to + * authenticate with Linux-based VMs. * */ function ContainerServiceLinuxProfile() { @@ -46,6 +47,9 @@ ContainerServiceLinuxProfile.prototype.mapper = function () { adminUsername: { required: true, serializedName: 'adminUsername', + constraints: { + Pattern: '^[a-z][a-z0-9_-]*$' + }, type: { name: 'String' } diff --git a/lib/services/computeManagement2/lib/models/containerServiceListResult.js b/lib/services/computeManagement2/lib/models/containerServiceListResult.js index 22a9dba188..ff188b76ed 100644 --- a/lib/services/computeManagement2/lib/models/containerServiceListResult.js +++ b/lib/services/computeManagement2/lib/models/containerServiceListResult.js @@ -16,8 +16,10 @@ var util = require('util'); * @class * Initializes a new instance of the ContainerServiceListResult class. * @constructor - * The List Container Service operation response - * @member {array} [value] the list of container services. + * The response from the List Container Services operation. + * + * @member {string} [nextLink] The URL to get the next set of container + * service results. * */ function ContainerServiceListResult() { @@ -53,6 +55,13 @@ ContainerServiceListResult.prototype.mapper = function () { } } } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } } } } diff --git a/lib/services/computeManagement2/lib/models/containerServiceMasterProfile.js b/lib/services/computeManagement2/lib/models/containerServiceMasterProfile.js index 11cd6718f5..1b9c035f98 100644 --- a/lib/services/computeManagement2/lib/models/containerServiceMasterProfile.js +++ b/lib/services/computeManagement2/lib/models/containerServiceMasterProfile.js @@ -14,12 +14,16 @@ * @class * Initializes a new instance of the ContainerServiceMasterProfile class. * @constructor - * Profile for container service master - * @member {number} [count] Number of masters (VMs) in the container cluster + * 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 FQDN for master + * @member {string} dnsPrefix DNS prefix to be used to create the FQDN for + * master. * - * @member {string} [fqdn] FDQN for the master + * @member {string} [fqdn] FDQN for the master. * */ function ContainerServiceMasterProfile() { @@ -42,6 +46,7 @@ ContainerServiceMasterProfile.prototype.mapper = function () { count: { required: false, serializedName: 'count', + defaultValue: 1, type: { name: 'Number' } diff --git a/lib/services/computeManagement2/lib/models/containerServiceOrchestratorProfile.js b/lib/services/computeManagement2/lib/models/containerServiceOrchestratorProfile.js index c4e46789df..1d36589b84 100644 --- a/lib/services/computeManagement2/lib/models/containerServiceOrchestratorProfile.js +++ b/lib/services/computeManagement2/lib/models/containerServiceOrchestratorProfile.js @@ -14,10 +14,11 @@ * @class * Initializes a new instance of the ContainerServiceOrchestratorProfile class. * @constructor - * Profile for Orchestrator - * @member {string} [orchestratorType] Specifies what orchestrator will be - * used to manage container cluster resources. Possible values include: - * 'Swarm', 'DCOS' + * 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' * */ function ContainerServiceOrchestratorProfile() { @@ -38,11 +39,11 @@ ContainerServiceOrchestratorProfile.prototype.mapper = function () { className: 'ContainerServiceOrchestratorProfile', modelProperties: { orchestratorType: { - required: false, + required: true, serializedName: 'orchestratorType', type: { name: 'Enum', - allowedValues: [ 'Swarm', 'DCOS' ] + allowedValues: [ 'Swarm', 'DCOS', 'Custom' ] } } } diff --git a/lib/services/computeManagement2/lib/models/containerServiceServicePrincipalProfile.js b/lib/services/computeManagement2/lib/models/containerServiceServicePrincipalProfile.js new file mode 100644 index 0000000000..331101d496 --- /dev/null +++ b/lib/services/computeManagement2/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'; + +/** + * @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. + * + */ +function ContainerServiceServicePrincipalProfile() { +} + +/** + * Defines the metadata of ContainerServiceServicePrincipalProfile + * + * @returns {object} metadata of ContainerServiceServicePrincipalProfile + * + */ +ContainerServiceServicePrincipalProfile.prototype.mapper = function () { + 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/models/containerServiceSshConfiguration.js b/lib/services/computeManagement2/lib/models/containerServiceSshConfiguration.js index 3f17be84b3..64b7d0992f 100644 --- a/lib/services/computeManagement2/lib/models/containerServiceSshConfiguration.js +++ b/lib/services/computeManagement2/lib/models/containerServiceSshConfiguration.js @@ -18,9 +18,10 @@ var util = require('util'); * @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 + * 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. * */ function ContainerServiceSshConfiguration() { @@ -41,7 +42,7 @@ ContainerServiceSshConfiguration.prototype.mapper = function () { className: 'ContainerServiceSshConfiguration', modelProperties: { publicKeys: { - required: false, + required: true, serializedName: 'publicKeys', type: { name: 'Sequence', diff --git a/lib/services/computeManagement2/lib/models/containerServiceSshPublicKey.js b/lib/services/computeManagement2/lib/models/containerServiceSshPublicKey.js index e627207a86..7d6bf2c8be 100644 --- a/lib/services/computeManagement2/lib/models/containerServiceSshPublicKey.js +++ b/lib/services/computeManagement2/lib/models/containerServiceSshPublicKey.js @@ -15,8 +15,9 @@ * 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 - * VM through SSH. The certificate must be in Pem format with or without + * VMs through SSH. The certificate must be in PEM format with or without * headers. * */ diff --git a/lib/services/computeManagement2/lib/models/containerServiceVMDiagnostics.js b/lib/services/computeManagement2/lib/models/containerServiceVMDiagnostics.js index e9024ee415..d20054a6a7 100644 --- a/lib/services/computeManagement2/lib/models/containerServiceVMDiagnostics.js +++ b/lib/services/computeManagement2/lib/models/containerServiceVMDiagnostics.js @@ -14,12 +14,13 @@ * @class * Initializes a new instance of the ContainerServiceVMDiagnostics class. * @constructor - * Describes VM Diagnostics. - * @member {boolean} [enabled] whether VM Diagnostic Agent should be - * provisioned on the Virtual Machine. + * Profile for diagnostics on the container service VMs. + * + * @member {boolean} enabled Whether the VM diagnostic agent is provisioned on + * the VM. * - * @member {string} [storageUri] whether VM Diagnostic Agent should be - * provisioned on the Virtual Machine. + * @member {string} [storageUri] The URI of the storage account where + * diagnostics are stored. * */ function ContainerServiceVMDiagnostics() { @@ -40,7 +41,7 @@ ContainerServiceVMDiagnostics.prototype.mapper = function () { className: 'ContainerServiceVMDiagnostics', modelProperties: { enabled: { - required: false, + required: true, serializedName: 'enabled', type: { name: 'Boolean' diff --git a/lib/services/computeManagement2/lib/models/containerServiceWindowsProfile.js b/lib/services/computeManagement2/lib/models/containerServiceWindowsProfile.js index af826707b6..5118e75672 100644 --- a/lib/services/computeManagement2/lib/models/containerServiceWindowsProfile.js +++ b/lib/services/computeManagement2/lib/models/containerServiceWindowsProfile.js @@ -14,12 +14,13 @@ * @class * Initializes a new instance of the ContainerServiceWindowsProfile class. * @constructor - * Profile for Windows VMs - * @member {string} adminUsername The administrator username to use for - * Windows VMs + * Profile for Windows VMs in the container service cluster. + * + * @member {string} adminUsername The administrator user name to use for + * Windows VMs. * * @member {string} adminPassword The administrator password to use for - * Windows VMs + * Windows VMs. * */ function ContainerServiceWindowsProfile() { @@ -42,6 +43,9 @@ ContainerServiceWindowsProfile.prototype.mapper = function () { adminUsername: { required: true, serializedName: 'adminUsername', + constraints: { + Pattern: '^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$' + }, type: { name: 'String' } @@ -49,6 +53,9 @@ ContainerServiceWindowsProfile.prototype.mapper = function () { adminPassword: { required: true, serializedName: 'adminPassword', + constraints: { + Pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\^&\*\(\)])[a-zA-Z\d!@#$%\^&\*\(\)]{12,123}$' + }, type: { name: 'String' } diff --git a/lib/services/computeManagement2/lib/models/dataDisk.js b/lib/services/computeManagement2/lib/models/dataDisk.js index f410472892..ef9a8e19a8 100644 --- a/lib/services/computeManagement2/lib/models/dataDisk.js +++ b/lib/services/computeManagement2/lib/models/dataDisk.js @@ -17,6 +17,7 @@ var models = require('./index'); * Initializes a new instance of the DataDisk class. * @constructor * Describes a data disk. + * * @member {number} lun the logical unit number. * * @member {string} name the disk name. @@ -28,8 +29,8 @@ var models = require('./index'); * * @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. + * Machine. If SourceImage is provided, the destination VirtualHardDisk + * should not exist. * * @member {string} [image.uri] the virtual hard disk's uri. It should be a * valid Uri to a virtual hard disk. diff --git a/lib/services/computeManagement2/lib/models/dataDiskImage.js b/lib/services/computeManagement2/lib/models/dataDiskImage.js index 49a53a3631..4887fad93a 100644 --- a/lib/services/computeManagement2/lib/models/dataDiskImage.js +++ b/lib/services/computeManagement2/lib/models/dataDiskImage.js @@ -15,9 +15,10 @@ * Initializes a new instance of the DataDiskImage class. * @constructor * Contains the data disk images information. - * @member {number} [lun] the LUN number for a data disk.This value is used to - * identify data disk image inside the VMImage therefore it must be unique - * for each data disk.The allowed character for the value is digit. + * + * @member {number} [lun] the LUN number for a data disk. This value is used + * to identify data disk image inside the VMImage therefore it must be unique + * for each data disk. The allowed character for the value is digit. * */ function DataDiskImage() { diff --git a/lib/services/computeManagement2/lib/models/deleteOperationResult.js b/lib/services/computeManagement2/lib/models/deleteOperationResult.js deleted file mode 100644 index 852428b970..0000000000 --- a/lib/services/computeManagement2/lib/models/deleteOperationResult.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator 0.15.0.0 - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -var models = require('./index'); - -/** - * @class - * Initializes a new instance of the DeleteOperationResult class. - * @constructor - * The compute long running operation response. - * @member {string} operationId Gets the operation identifier. - * - * @member {string} status Gets the operation status. Possible values include: - * 'InProgress', 'Succeeded', 'Failed' - * - * @member {date} startTime Gets the operation start time - * - * @member {date} [endTime] Gets the operation end time - * - * @member {object} [error] Gets or sets the operation error if any occurred - * - * @member {array} [error.details] Gets or sets the Api error details - * - * @member {object} [error.innererror] Gets or sets the Api inner error - * - * @member {string} [error.innererror.exceptiontype] Gets or sets the - * exception type. - * - * @member {string} [error.innererror.errordetail] Gets or sets the internal - * error message or exception dump. - * - * @member {string} [error.code] Gets or sets the error code. - * - * @member {string} [error.target] Gets or sets the target of the particular - * error. - * - * @member {string} [error.message] Gets or sets the error message. - * - */ -function DeleteOperationResult() { -} - -/** - * Defines the metadata of DeleteOperationResult - * - * @returns {object} metadata of DeleteOperationResult - * - */ -DeleteOperationResult.prototype.mapper = function () { - return { - required: false, - serializedName: 'DeleteOperationResult', - type: { - name: 'Composite', - className: 'DeleteOperationResult', - modelProperties: { - operationId: { - required: true, - serializedName: 'operationId', - type: { - name: 'String' - } - }, - status: { - required: true, - serializedName: 'status', - type: { - name: 'Enum', - allowedValues: [ 'InProgress', 'Succeeded', 'Failed' ] - } - }, - startTime: { - required: true, - serializedName: 'startTime', - type: { - name: 'DateTime' - } - }, - endTime: { - required: false, - serializedName: 'endTime', - type: { - name: 'DateTime' - } - }, - error: { - required: false, - serializedName: 'error', - type: { - name: 'Composite', - className: 'ApiError' - } - } - } - } - }; -}; - -module.exports = DeleteOperationResult; diff --git a/lib/services/computeManagement2/lib/models/diagnosticsProfile.js b/lib/services/computeManagement2/lib/models/diagnosticsProfile.js index 843ca8e98d..7e12b3f47d 100644 --- a/lib/services/computeManagement2/lib/models/diagnosticsProfile.js +++ b/lib/services/computeManagement2/lib/models/diagnosticsProfile.js @@ -17,13 +17,16 @@ var models = require('./index'); * Initializes a new instance of the DiagnosticsProfile class. * @constructor * Describes a diagnostics profile. - * @member {object} [bootDiagnostics] the boot diagnostics. + * + * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature + * which allows the user to view console output and/or a screenshot of the + * virtual machine from the hypervisor. * - * @member {boolean} [bootDiagnostics.enabled] whether boot diagnostics should + * @member {boolean} [bootDiagnostics.enabled] Whether boot diagnostics should * be enabled on the Virtual Machine. * - * @member {string} [bootDiagnostics.storageUri] the boot diagnostics storage - * Uri. It should be a valid Uri + * @member {string} [bootDiagnostics.storageUri] URI of the storage account to + * use for placing the console output and screenshot. * */ function DiagnosticsProfile() { diff --git a/lib/services/computeManagement2/lib/models/diskEncryptionSettings.js b/lib/services/computeManagement2/lib/models/diskEncryptionSettings.js index 3abe83f222..ac2366adcf 100644 --- a/lib/services/computeManagement2/lib/models/diskEncryptionSettings.js +++ b/lib/services/computeManagement2/lib/models/diskEncryptionSettings.js @@ -17,6 +17,7 @@ var models = require('./index'); * Initializes a new instance of the DiskEncryptionSettings class. * @constructor * Describes a Encryption Settings for a Disk + * * @member {object} [diskEncryptionKey] the disk encryption key which is a * KeyVault Secret. * diff --git a/lib/services/computeManagement2/lib/models/diskInstanceView.js b/lib/services/computeManagement2/lib/models/diskInstanceView.js index 8ccb7cb1f7..12edd5eea6 100644 --- a/lib/services/computeManagement2/lib/models/diskInstanceView.js +++ b/lib/services/computeManagement2/lib/models/diskInstanceView.js @@ -19,9 +19,10 @@ var util = require('util'); * Initializes a new instance of the DiskInstanceView class. * @constructor * The instance view of the disk. - * @member {string} [name] the disk name. + * + * @member {string} [name] The disk name. * - * @member {array} [statuses] the resource status information. + * @member {array} [statuses] The resource status information. * */ function DiskInstanceView() { diff --git a/lib/services/computeManagement2/lib/models/hardwareProfile.js b/lib/services/computeManagement2/lib/models/hardwareProfile.js index e72ef874f2..02d8b9745b 100644 --- a/lib/services/computeManagement2/lib/models/hardwareProfile.js +++ b/lib/services/computeManagement2/lib/models/hardwareProfile.js @@ -15,6 +15,7 @@ * Initializes a new instance of the HardwareProfile class. * @constructor * Describes a hardware profile. + * * @member {string} [vmSize] The virtual machine size name. Possible values * include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', * 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', diff --git a/lib/services/computeManagement2/lib/models/imageReference.js b/lib/services/computeManagement2/lib/models/imageReference.js index 8cf4e54cd4..68713702cb 100644 --- a/lib/services/computeManagement2/lib/models/imageReference.js +++ b/lib/services/computeManagement2/lib/models/imageReference.js @@ -15,15 +15,16 @@ * Initializes a new instance of the ImageReference class. * @constructor * The image reference. - * @member {string} [publisher] the image publisher. + * + * @member {string} [publisher] The image publisher. * - * @member {string} [offer] the image offer. + * @member {string} [offer] The image offer. * - * @member {string} [sku] the image sku. + * @member {string} [sku] The image SKU. * - * @member {string} [version] the image version. The allowed formats are + * @member {string} [version] The image version. The allowed formats are * Major.Minor.Build or 'latest'. Major, Minor and Build being decimal - * numbers. Specify 'latest' to use the latest version of image. + * numbers. Specify 'latest' to use the latest version of the image. * */ function ImageReference() { diff --git a/lib/services/computeManagement2/lib/models/index.d.ts b/lib/services/computeManagement2/lib/models/index.d.ts index ec96f7321f..d9eab0d962 100644 --- a/lib/services/computeManagement2/lib/models/index.d.ts +++ b/lib/services/computeManagement2/lib/models/index.d.ts @@ -6,15 +6,18 @@ * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. -// TODO: Include PageTemplateModels here too?? Probably */ +import * as msRestAzure from 'ms-rest-azure'; +exports.BaseResource = msRestAzure.BaseResource; +exports.CloudError = msRestAzure.CloudError; /** * @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', @@ -29,11 +32,11 @@ * */ export interface InstanceViewStatus { - code?: string; - level?: string; - displayStatus?: string; - message?: string; - time?: Date; + code?: string; + level?: string; + displayStatus?: string; + message?: string; + time?: Date; } /** @@ -44,30 +47,32 @@ export interface InstanceViewStatus { * */ export interface SubResource extends BaseResource { - id?: string; + id?: string; } /** * @class * Initializes a new instance of the Resource class. * @constructor - * @member {string} [id] Resource Id + * The resource model definition. + * + * @member {string} [id] Resource ID. * - * @member {string} [name] Resource name + * @member {string} [name] Resource name. * - * @member {string} [type] Resource type + * @member {string} [type] Resource type. * - * @member {string} location Resource location + * @member {string} location Resource location. * - * @member {object} [tags] Resource tags + * @member {object} [tags] Resource tags. * */ export interface Resource extends BaseResource { - id?: string; - name?: string; - type?: string; - location: string; - tags?: { [propertyName: string]: string }; + id?: string; + name?: string; + type?: string; + location: string; + tags?: { [propertyName: string]: string }; } /** @@ -75,21 +80,35 @@ export interface Resource extends BaseResource { * Initializes a new instance of the AvailabilitySet class. * @constructor * Create or update Availability Set parameters. + * * @member {number} [platformUpdateDomainCount] Update Domain count. * * @member {number} [platformFaultDomainCount] Fault Domain count. * - * @member {array} [virtualMachines] a list containing reference to all - * Virtual Machines created under this Availability Set. + * @member {array} [virtualMachines] A list of references to all virtual + * machines in the availability set. * * @member {array} [statuses] the resource status information. * */ export interface AvailabilitySet extends Resource { - platformUpdateDomainCount?: number; - platformFaultDomainCount?: number; - virtualMachines?: SubResource[]; - statuses?: InstanceViewStatus[]; + platformUpdateDomainCount?: number; + platformFaultDomainCount?: number; + virtualMachines?: SubResource[]; + statuses?: InstanceViewStatus[]; +} + +/** + * @class + * Initializes a new instance of the AvailabilitySetListResult class. + * @constructor + * The List Availability Set operation response. + * + * @member {array} [value] The list of availability sets + * + */ +export interface AvailabilitySetListResult { + value?: AvailabilitySet[]; } /** @@ -97,28 +116,45 @@ export interface AvailabilitySet extends Resource { * Initializes a new instance of the VirtualMachineSize class. * @constructor * Describes the properties of a VM size. - * @member {string} [name] the VM size name. + * + * @member {string} [name] The name of the virtual machine size. * - * @member {number} [numberOfCores] the Number of cores supported by a VM size. + * @member {number} [numberOfCores] The number of cores supported by the + * virtual machine size. * - * @member {number} [osDiskSizeInMB] the OS disk size allowed by a VM size. + * @member {number} [osDiskSizeInMB] The OS disk size, in MB, allowed by the + * virtual machine size. * - * @member {number} [resourceDiskSizeInMB] the Resource disk size allowed by a - * VM size. + * @member {number} [resourceDiskSizeInMB] The resource disk size, in MB, + * allowed by the virtual machine size. * - * @member {number} [memoryInMB] the Memory size supported by a VM 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 - * allowed by a VM 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; + name?: string; + numberOfCores?: number; + osDiskSizeInMB?: number; + resourceDiskSizeInMB?: number; + memoryInMB?: number; + maxDataDiskCount?: number; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineSizeListResult class. + * @constructor + * The List Virtual Machine operation response. + * + * @member {array} [value] the list of virtual machine sizes. + * + */ +export interface VirtualMachineSizeListResult { + value?: VirtualMachineSize[]; } /** @@ -126,6 +162,7 @@ export interface VirtualMachineSize { * Initializes a new instance of the VirtualMachineExtensionImage class. * @constructor * Describes a Virtual Machine Extension Image. + * * @member {string} operatingSystem the operating system this extension * supports. * @@ -136,7 +173,7 @@ export interface VirtualMachineSize { * 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, + * 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. * @@ -145,11 +182,11 @@ export interface VirtualMachineSize { * */ export interface VirtualMachineExtensionImage extends Resource { - operatingSystem: string; - computeRole: string; - handlerSchema: string; - vmScaleSetEnabled?: boolean; - supportsMultipleExtensions?: boolean; + operatingSystem: string; + computeRole: string; + handlerSchema: string; + vmScaleSetEnabled?: boolean; + supportsMultipleExtensions?: boolean; } /** @@ -157,17 +194,18 @@ export interface VirtualMachineExtensionImage extends Resource { * Initializes a new instance of the VirtualMachineImageResource class. * @constructor * Virtual machine image resource information. - * @member {string} name the name of the resource. + * + * @member {string} name The name of the resource. * - * @member {string} location the location of the resource. + * @member {string} location The supported Azure location of the resource. * - * @member {object} [tags] the tags attached to the resource. + * @member {object} [tags] The tags attached to the resource. * */ export interface VirtualMachineImageResource extends SubResource { - name: string; - location: string; - tags?: { [propertyName: string]: string }; + name: string; + location: string; + tags?: { [propertyName: string]: string }; } /** @@ -175,6 +213,7 @@ export interface VirtualMachineImageResource extends SubResource { * 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] the full type of the extension handler which @@ -189,11 +228,11 @@ export interface VirtualMachineImageResource extends SubResource { * */ export interface VirtualMachineExtensionInstanceView { - name?: string; - type?: string; - typeHandlerVersion?: string; - substatuses?: InstanceViewStatus[]; - statuses?: InstanceViewStatus[]; + name?: string; + type?: string; + typeHandlerVersion?: string; + substatuses?: InstanceViewStatus[]; + statuses?: InstanceViewStatus[]; } /** @@ -201,6 +240,7 @@ export interface VirtualMachineExtensionInstanceView { * 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. * @@ -240,15 +280,15 @@ export interface VirtualMachineExtensionInstanceView { * */ export interface VirtualMachineExtension extends Resource { - forceUpdateTag?: string; - publisher?: string; - virtualMachineExtensionType?: string; - typeHandlerVersion?: string; - autoUpgradeMinorVersion?: boolean; - settings?: any; - protectedSettings?: any; - provisioningState?: string; - instanceView?: VirtualMachineExtensionInstanceView; + forceUpdateTag?: string; + publisher?: string; + virtualMachineExtensionType?: string; + typeHandlerVersion?: string; + autoUpgradeMinorVersion?: boolean; + settings?: any; + protectedSettings?: any; + provisioningState?: string; + instanceView?: VirtualMachineExtensionInstanceView; } /** @@ -257,6 +297,7 @@ export interface VirtualMachineExtension extends Resource { * @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. @@ -265,9 +306,9 @@ export interface VirtualMachineExtension extends Resource { * */ export interface PurchasePlan { - publisher: string; - name: string; - product: string; + publisher: string; + name: string; + product: string; } /** @@ -275,12 +316,13 @@ export interface PurchasePlan { * Initializes a new instance of the OSDiskImage class. * @constructor * Contains the os disk image information. - * @member {string} operatingSystem the operating system of the osDiskImage. + * + * @member {string} operatingSystem The operating system of the osDiskImage. * Possible values include: 'Windows', 'Linux' * */ export interface OSDiskImage { - operatingSystem: string; + operatingSystem: string; } /** @@ -288,13 +330,14 @@ export interface OSDiskImage { * Initializes a new instance of the DataDiskImage class. * @constructor * Contains the data disk images information. - * @member {number} [lun] the LUN number for a data disk.This value is used to - * identify data disk image inside the VMImage therefore it must be unique - * for each data disk.The allowed character for the value is digit. + * + * @member {number} [lun] the LUN number for a data disk. This value is used + * to identify data disk image inside the VMImage therefore it must be unique + * for each data disk. The allowed character for the value is digit. * */ export interface DataDiskImage { - lun?: number; + lun?: number; } /** @@ -302,6 +345,7 @@ export interface DataDiskImage { * Initializes a new instance of the VirtualMachineImage class. * @constructor * Describes a Virtual Machine Image. + * * @member {object} [plan] * * @member {string} [plan.publisher] the publisher ID. @@ -312,16 +356,16 @@ export interface DataDiskImage { * * @member {object} [osDiskImage] * - * @member {string} [osDiskImage.operatingSystem] the operating system of the + * @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[]; + plan?: PurchasePlan; + osDiskImage?: OSDiskImage; + dataDiskImages?: DataDiskImage[]; } /** @@ -329,6 +373,7 @@ export interface VirtualMachineImage extends VirtualMachineImageResource { * Initializes a new instance of the UsageName class. * @constructor * The Usage Names. + * * @member {string} [value] a string describing the resource name. * * @member {string} [localizedValue] a localized string describing the @@ -336,8 +381,8 @@ export interface VirtualMachineImage extends VirtualMachineImageResource { * */ export interface UsageName { - value?: string; - localizedValue?: string; + value?: string; + localizedValue?: string; } /** @@ -345,6 +390,7 @@ export interface UsageName { * Initializes a new instance of the Usage class. * @constructor * Describes Compute Resource Usage. + * * @member {number} currentValue the current value of the usage. * * @member {number} limit the limit of usage. @@ -358,9 +404,27 @@ export interface UsageName { * */ export interface Usage { - currentValue: number; - limit: number; - name: UsageName; + currentValue: number; + limit: number; + name: UsageName; +} + +/** + * @class + * Initializes a new instance of the ListUsagesResult class. + * @constructor + * The List Usages operation response. + * + * @member {array} value the list Compute Resource Usages. + * + * @member {string} [nextLink] the uri to fetch the next page of Compute + * Resource Usages. Call ListNext() with this to fetch the next page of + * Compute Resource Usages. + * + */ +export interface ListUsagesResult { + value: Usage[]; + nextLink?: string; } /** @@ -368,6 +432,7 @@ export interface Usage { * Initializes a new instance of the VirtualMachineCaptureParameters class. * @constructor * Capture Virtual Machine parameters. + * * @member {string} vhdPrefix the captured VirtualHardDisk's name prefix. * * @member {string} destinationContainerName the destination container name. @@ -377,9 +442,9 @@ export interface Usage { * */ export interface VirtualMachineCaptureParameters { - vhdPrefix: string; - destinationContainerName: string; - overwriteVhds: boolean; + vhdPrefix: string; + destinationContainerName: string; + overwriteVhds: boolean; } /** @@ -387,11 +452,12 @@ export interface VirtualMachineCaptureParameters { * 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; + output?: any; } /** @@ -399,6 +465,7 @@ export interface VirtualMachineCaptureResult extends SubResource { * Initializes a new instance of the Plan class. * @constructor * Plan for the resource. + * * @member {string} [name] the plan ID. * * @member {string} [publisher] the publisher ID. @@ -409,10 +476,10 @@ export interface VirtualMachineCaptureResult extends SubResource { * */ export interface Plan { - name?: string; - publisher?: string; - product?: string; - promotionCode?: string; + name?: string; + publisher?: string; + product?: string; + promotionCode?: string; } /** @@ -420,6 +487,7 @@ export interface Plan { * Initializes a new instance of the HardwareProfile class. * @constructor * Describes a hardware profile. + * * @member {string} [vmSize] The virtual machine size name. Possible values * include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', * 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', @@ -440,7 +508,7 @@ export interface Plan { * */ export interface HardwareProfile { - vmSize?: string; + vmSize?: string; } /** @@ -448,22 +516,23 @@ export interface HardwareProfile { * Initializes a new instance of the ImageReference class. * @constructor * The image reference. - * @member {string} [publisher] the image publisher. + * + * @member {string} [publisher] The image publisher. * - * @member {string} [offer] the image offer. + * @member {string} [offer] The image offer. * - * @member {string} [sku] the image sku. + * @member {string} [sku] The image SKU. * - * @member {string} [version] the image version. The allowed formats are + * @member {string} [version] The image version. The allowed formats are * Major.Minor.Build or 'latest'. Major, Minor and Build being decimal - * numbers. Specify 'latest' to use the latest version of image. + * numbers. Specify 'latest' to use the latest version of the image. * */ export interface ImageReference { - publisher?: string; - offer?: string; - sku?: string; - version?: string; + publisher?: string; + offer?: string; + sku?: string; + version?: string; } /** @@ -471,6 +540,7 @@ export interface ImageReference { * 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 @@ -480,8 +550,8 @@ export interface ImageReference { * */ export interface KeyVaultSecretReference { - secretUrl: string; - sourceVault: SubResource; + secretUrl: string; + sourceVault: SubResource; } /** @@ -489,6 +559,7 @@ export interface KeyVaultSecretReference { * Initializes a new instance of the KeyVaultKeyReference class. * @constructor * Describes a reference to Key Vault Key + * * @member {string} keyUrl the URL referencing a key in a Key Vault. * * @member {object} sourceVault the Relative URL of the Key Vault containing @@ -498,8 +569,8 @@ export interface KeyVaultSecretReference { * */ export interface KeyVaultKeyReference { - keyUrl: string; - sourceVault: SubResource; + keyUrl: string; + sourceVault: SubResource; } /** @@ -507,6 +578,7 @@ export interface KeyVaultKeyReference { * Initializes a new instance of the DiskEncryptionSettings class. * @constructor * Describes a Encryption Settings for a Disk + * * @member {object} [diskEncryptionKey] the disk encryption key which is a * KeyVault Secret. * @@ -534,9 +606,9 @@ export interface KeyVaultKeyReference { * */ export interface DiskEncryptionSettings { - diskEncryptionKey?: KeyVaultSecretReference; - keyEncryptionKey?: KeyVaultKeyReference; - enabled?: boolean; + diskEncryptionKey?: KeyVaultSecretReference; + keyEncryptionKey?: KeyVaultKeyReference; + enabled?: boolean; } /** @@ -544,12 +616,13 @@ export interface DiskEncryptionSettings { * Initializes a new instance of the VirtualHardDisk class. * @constructor * Describes the uri of a disk. + * * @member {string} [uri] the virtual hard disk's uri. It should be a valid * Uri to a virtual hard disk. * */ export interface VirtualHardDisk { - uri?: string; + uri?: string; } /** @@ -557,6 +630,7 @@ export interface VirtualHardDisk { * Initializes a new instance of the OSDisk class. * @constructor * Describes an Operating System disk. + * * @member {string} [osType] the Operating System type. Possible values * include: 'Windows', 'Linux' * @@ -598,8 +672,8 @@ export interface VirtualHardDisk { * * @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. + * Machine. If SourceImage is provided, the destination VirtualHardDisk + * should not exist. * * @member {string} [image.uri] the virtual hard disk's uri. It should be a * valid Uri to a virtual hard disk. @@ -615,14 +689,14 @@ export interface VirtualHardDisk { * */ export interface OSDisk { - osType?: string; - encryptionSettings?: DiskEncryptionSettings; - name: string; - vhd: VirtualHardDisk; - image?: VirtualHardDisk; - caching?: string; - createOption: string; - diskSizeGB?: number; + osType?: string; + encryptionSettings?: DiskEncryptionSettings; + name: string; + vhd: VirtualHardDisk; + image?: VirtualHardDisk; + caching?: string; + createOption: string; + diskSizeGB?: number; } /** @@ -630,6 +704,7 @@ export interface OSDisk { * Initializes a new instance of the DataDisk class. * @constructor * Describes a data disk. + * * @member {number} lun the logical unit number. * * @member {string} name the disk name. @@ -641,8 +716,8 @@ export interface OSDisk { * * @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. + * Machine. If SourceImage is provided, the destination VirtualHardDisk + * should not exist. * * @member {string} [image.uri] the virtual hard disk's uri. It should be a * valid Uri to a virtual hard disk. @@ -658,13 +733,13 @@ export interface OSDisk { * */ export interface DataDisk { - lun: number; - name: string; - vhd: VirtualHardDisk; - image?: VirtualHardDisk; - caching?: string; - createOption: string; - diskSizeGB?: number; + lun: number; + name: string; + vhd: VirtualHardDisk; + image?: VirtualHardDisk; + caching?: string; + createOption: string; + diskSizeGB?: number; } /** @@ -672,19 +747,20 @@ export interface DataDisk { * Initializes a new instance of the StorageProfile class. * @constructor * Describes a storage profile. - * @member {object} [imageReference] the image reference. + * + * @member {object} [imageReference] The image reference. * - * @member {string} [imageReference.publisher] the image publisher. + * @member {string} [imageReference.publisher] The image publisher. * - * @member {string} [imageReference.offer] the image offer. + * @member {string} [imageReference.offer] The image offer. * - * @member {string} [imageReference.sku] the image sku. + * @member {string} [imageReference.sku] The image SKU. * - * @member {string} [imageReference.version] the image version. The allowed + * @member {string} [imageReference.version] The image version. The allowed * formats are Major.Minor.Build or 'latest'. Major, Minor and Build being - * decimal numbers. Specify 'latest' to use the latest version of image. + * decimal numbers. Specify 'latest' to use the latest version of the image. * - * @member {object} [osDisk] the OS disk. + * @member {object} [osDisk] The OS disk. * * @member {string} [osDisk.osType] the Operating System type. Possible values * include: 'Windows', 'Linux' @@ -727,8 +803,8 @@ export interface DataDisk { * * @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. + * Machine. If SourceImage is provided, the destination VirtualHardDisk + * should not exist. * * @member {string} [osDisk.image.uri] the virtual hard disk's uri. It should * be a valid Uri to a virtual hard disk. @@ -742,27 +818,28 @@ export interface DataDisk { * @member {number} [osDisk.diskSizeGB] the initial disk size in GB for blank * data disks, and the new desired size for existing OS and Data disks. * - * @member {array} [dataDisks] the data disks. + * @member {array} [dataDisks] The data disks. * */ export interface StorageProfile { - imageReference?: ImageReference; - osDisk?: OSDisk; - dataDisks?: DataDisk[]; + imageReference?: ImageReference; + osDisk?: OSDisk; + dataDisks?: DataDisk[]; } /** * @class * Initializes a new instance of the AdditionalUnattendContent class. * @constructor - * additional XML formatted information that can be included in the + * 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 a * applied. - * @member {string} [passName] the pass name. Currently, the only allowable + * + * @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 + * @member {string} [componentName] The component name. Currently, the only * allowable value is Microsoft-Windows-Shell-Setup. Possible values include: * 'Microsoft-Windows-Shell-Setup' * @@ -770,16 +847,16 @@ export interface StorageProfile { * AutoLogon ). Possible values include: 'AutoLogon', 'FirstLogonCommands' * * @member {string} [content] XML formatted content that is added to the - * unattend.xml file in the specified pass and component.The XML must be less - * than 4 KB and must include the root element for the setting or feature - * that is being inserted. + * unattend.xml file in the specified pass and component. The XML must be + * less than 4 KB 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; + passName?: string; + componentName?: string; + settingName?: string; + content?: string; } /** @@ -787,16 +864,17 @@ export interface AdditionalUnattendContent { * Initializes a new instance of the WinRMListener class. * @constructor * Describes Protocol and thumbprint of Windows Remote Management listener - * @member {string} [protocol] the Protocol used by WinRM listener. Currently - * only Http and Https are supported. Possible values include: 'Http', 'Https' + * + * @member {string} [protocol] The Protocol used by the WinRM listener. Http + * and Https are supported. Possible values include: 'Http', 'Https' * * @member {string} [certificateUrl] the Certificate URL in KMS for Https * listeners. Should be null for Http listeners. * */ export interface WinRMListener { - protocol?: string; - certificateUrl?: string; + protocol?: string; + certificateUrl?: string; } /** @@ -804,11 +882,12 @@ export interface WinRMListener { * 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 + * + * @member {array} [listeners] The list of Windows Remote Management listeners * */ export interface WinRMConfiguration { - listeners?: WinRMListener[]; + listeners?: WinRMListener[]; } /** @@ -816,30 +895,32 @@ export interface WinRMConfiguration { * Initializes a new instance of the WindowsConfiguration class. * @constructor * Describes Windows Configuration of the OS Profile. - * @member {boolean} [provisionVMAgent] whether VM Agent should be provisioned - * on the Virtual Machine. + * + * @member {boolean} [provisionVMAgent] Indicates whether the virtual machine + * agent should be provisioned on the Virtual Machine. If not specified, then + * the default behavior is to set it to true. * - * @member {boolean} [enableAutomaticUpdates] whether Windows updates are - * automatically installed on the VM + * @member {boolean} [enableAutomaticUpdates] Indicates whether Windows + * updates are automatically installed on the VM. * - * @member {string} [timeZone] the Time Zone of the VM + * @member {string} [timeZone] The Time Zone of the VM * - * @member {array} [additionalUnattendContent] the additional base-64 encoded - * XML formatted information that can be included in the Unattend.xml file. + * @member {array} [additionalUnattendContent] Additional base-64 encoded XML + * formatted information that can be included in the Unattend.xml file. * - * @member {object} [winRM] the Windows Remote Management configuration of the + * @member {object} [winRM] The Windows Remote Management configuration of the * VM * - * @member {array} [winRM.listeners] the list of Windows Remote Management + * @member {array} [winRM.listeners] The list of Windows Remote Management * listeners * */ export interface WindowsConfiguration { - provisionVMAgent?: boolean; - enableAutomaticUpdates?: boolean; - timeZone?: string; - additionalUnattendContent?: AdditionalUnattendContent[]; - winRM?: WinRMConfiguration; + provisionVMAgent?: boolean; + enableAutomaticUpdates?: boolean; + timeZone?: string; + additionalUnattendContent?: AdditionalUnattendContent[]; + winRM?: WinRMConfiguration; } /** @@ -848,18 +929,19 @@ export interface WindowsConfiguration { * @constructor * Contains information about SSH certificate public key and the path on the * Linux VM where the public key is placed. - * @member {string} [path] 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. + * + * @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. * - * @member {string} [keyData] Certificate public key used to authenticate with - * VM through SSH.The certificate must be in Pem format with or without + * @member {string} [keyData] Certificate public key used to authenticate to + * the VM through SSH. The certificate must be in Pem format with or without * headers. * */ export interface SshPublicKey { - path?: string; - keyData?: string; + path?: string; + keyData?: string; } /** @@ -867,12 +949,13 @@ export interface SshPublicKey { * 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 + * + * @member {array} [publicKeys] The list of SSH public keys used to + * authenticate with linux based VMs. * */ export interface SshConfiguration { - publicKeys?: SshPublicKey[]; + publicKeys?: SshPublicKey[]; } /** @@ -880,18 +963,19 @@ export interface SshConfiguration { * Initializes a new instance of the LinuxConfiguration class. * @constructor * Describes Windows Configuration of the OS Profile. - * @member {boolean} [disablePasswordAuthentication] whether Authentication - * using user name and password is allowed or not + * + * @member {boolean} [disablePasswordAuthentication] Specifies whether + * password authentication should be disabled. * - * @member {object} [ssh] the SSH configuration for linux VMs + * @member {object} [ssh] The SSH configuration for linux VMs. * - * @member {array} [ssh.publicKeys] the list of SSH public keys used to - * authenticate with linux based VMs + * @member {array} [ssh.publicKeys] The list of SSH public keys used to + * authenticate with linux based VMs. * */ export interface LinuxConfiguration { - disablePasswordAuthentication?: boolean; - ssh?: SshConfiguration; + disablePasswordAuthentication?: boolean; + ssh?: SshConfiguration; } /** @@ -900,16 +984,17 @@ export interface LinuxConfiguration { * @constructor * Describes a single certificate reference in a Key Vault, and where the * certificate should reside on the VM. - * @member {string} [certificateUrl] the URL referencing a secret in a Key + * + * @member {string} [certificateUrl] The URL referencing a secret in a Key * Vault which contains a properly formatted certificate. * - * @member {string} [certificateStore] the Certificate store in LocalMachine + * @member {string} [certificateStore] The Certificate store in LocalMachine * to add the certificate to on Windows, leave empty on Linux. * */ export interface VaultCertificate { - certificateUrl?: string; - certificateStore?: string; + certificateUrl?: string; + certificateStore?: string; } /** @@ -917,18 +1002,19 @@ export interface VaultCertificate { * 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 + * + * @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 + * @member {array} [vaultCertificates] The list of key vault references in + * SourceVault which contain certificates. * */ export interface VaultSecretGroup { - sourceVault?: SubResource; - vaultCertificates?: VaultCertificate[]; + sourceVault?: SubResource; + vaultCertificates?: VaultCertificate[]; } /** @@ -936,58 +1022,66 @@ export interface VaultSecretGroup { * Initializes a new instance of the OSProfile class. * @constructor * Describes an OS profile. - * @member {string} [computerName] the computer name. + * + * @member {string} [computerName] Specifies the host OS name of the virtual + * machine. * - * @member {string} [adminUsername] the admin user name. + * @member {string} [adminUsername] Specifies the name of the administrator + * account. * - * @member {string} [adminPassword] the admin user password. + * @member {string} [adminPassword] Specifies the password of the + * administrator account. * - * @member {string} [customData] a base-64 encoded string of custom data. + * @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 * * @member {object} [windowsConfiguration] the Windows Configuration of the OS * profile. * - * @member {boolean} [windowsConfiguration.provisionVMAgent] whether VM Agent - * should be provisioned on the Virtual Machine. + * @member {boolean} [windowsConfiguration.provisionVMAgent] Indicates whether + * the virtual machine agent should be provisioned on the Virtual Machine. If + * not specified, then the default behavior is to set it to true. * - * @member {boolean} [windowsConfiguration.enableAutomaticUpdates] whether - * Windows updates are automatically installed on the VM + * @member {boolean} [windowsConfiguration.enableAutomaticUpdates] Indicates + * whether Windows updates are automatically installed on the VM. * - * @member {string} [windowsConfiguration.timeZone] the Time Zone of the VM + * @member {string} [windowsConfiguration.timeZone] The Time Zone of the VM * - * @member {array} [windowsConfiguration.additionalUnattendContent] the - * additional base-64 encoded XML formatted information that can be included - * in the Unattend.xml file. + * @member {array} [windowsConfiguration.additionalUnattendContent] Additional + * base-64 encoded XML formatted information that can be included in the + * Unattend.xml file. * - * @member {object} [windowsConfiguration.winRM] the Windows Remote Management + * @member {object} [windowsConfiguration.winRM] The Windows Remote Management * configuration of the VM * - * @member {array} [windowsConfiguration.winRM.listeners] the list of Windows + * @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] - * whether Authentication using user name and password is allowed or not + * Specifies whether password authentication should be disabled. * - * @member {object} [linuxConfiguration.ssh] the SSH configuration for linux - * VMs + * @member {object} [linuxConfiguration.ssh] The SSH configuration for linux + * VMs. * - * @member {array} [linuxConfiguration.ssh.publicKeys] the list of SSH public - * keys used to authenticate with linux based VMs + * @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 OSProfile { - computerName?: string; - adminUsername?: string; - adminPassword?: string; - customData?: string; - windowsConfiguration?: WindowsConfiguration; - linuxConfiguration?: LinuxConfiguration; - secrets?: VaultSecretGroup[]; + computerName?: string; + adminUsername?: string; + adminPassword?: string; + customData?: string; + windowsConfiguration?: WindowsConfiguration; + linuxConfiguration?: LinuxConfiguration; + secrets?: VaultSecretGroup[]; } /** @@ -995,12 +1089,13 @@ export interface OSProfile { * Initializes a new instance of the NetworkInterfaceReference class. * @constructor * Describes a network interface reference. - * @member {boolean} [primary] whether this is a primary NIC on a virtual - * machine + * + * @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; + primary?: boolean; } /** @@ -1008,11 +1103,13 @@ export interface NetworkInterfaceReference extends SubResource { * Initializes a new instance of the NetworkProfile class. * @constructor * Describes a network profile. - * @member {array} [networkInterfaces] the network interfaces. + * + * @member {array} [networkInterfaces] Specifies the list of resource Ids for + * the network interfaces associated with the virtual machine. * */ export interface NetworkProfile { - networkInterfaces?: NetworkInterfaceReference[]; + networkInterfaces?: NetworkInterfaceReference[]; } /** @@ -1020,16 +1117,17 @@ export interface NetworkProfile { * Initializes a new instance of the BootDiagnostics class. * @constructor * Describes Boot Diagnostics. - * @member {boolean} [enabled] whether boot diagnostics should be enabled on + * + * @member {boolean} [enabled] Whether boot diagnostics should be enabled on * the Virtual Machine. * - * @member {string} [storageUri] the boot diagnostics storage Uri. It should - * be a valid Uri + * @member {string} [storageUri] URI of the storage account to use for placing + * the console output and screenshot. * */ export interface BootDiagnostics { - enabled?: boolean; - storageUri?: string; + enabled?: boolean; + storageUri?: string; } /** @@ -1037,17 +1135,20 @@ export interface BootDiagnostics { * Initializes a new instance of the DiagnosticsProfile class. * @constructor * Describes a diagnostics profile. - * @member {object} [bootDiagnostics] the boot diagnostics. + * + * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature + * which allows the user to view console output and/or a screenshot of the + * virtual machine from the hypervisor. * - * @member {boolean} [bootDiagnostics.enabled] whether boot diagnostics should + * @member {boolean} [bootDiagnostics.enabled] Whether boot diagnostics should * be enabled on the Virtual Machine. * - * @member {string} [bootDiagnostics.storageUri] the boot diagnostics storage - * Uri. It should be a valid Uri + * @member {string} [bootDiagnostics.storageUri] URI of the storage account to + * use for placing the console output and screenshot. * */ export interface DiagnosticsProfile { - bootDiagnostics?: BootDiagnostics; + bootDiagnostics?: BootDiagnostics; } /** @@ -1055,6 +1156,7 @@ export interface DiagnosticsProfile { * Initializes a new instance of the VirtualMachineExtensionHandlerInstanceView class. * @constructor * The instance view of a virtual machine extension handler. + * * @member {string} [type] full type of the extension handler which includes * both publisher and type. * @@ -1078,9 +1180,9 @@ export interface DiagnosticsProfile { * */ export interface VirtualMachineExtensionHandlerInstanceView { - type?: string; - typeHandlerVersion?: string; - status?: InstanceViewStatus; + type?: string; + typeHandlerVersion?: string; + status?: InstanceViewStatus; } /** @@ -1088,18 +1190,19 @@ export interface VirtualMachineExtensionHandlerInstanceView { * 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 {string} [vmAgentVersion] The VM Agent full version. * - * @member {array} [extensionHandlers] the virtual machine extension handler + * @member {array} [extensionHandlers] The virtual machine extension handler * instance view. * - * @member {array} [statuses] the resource status information. + * @member {array} [statuses] The resource status information. * */ export interface VirtualMachineAgentInstanceView { - vmAgentVersion?: string; - extensionHandlers?: VirtualMachineExtensionHandlerInstanceView[]; - statuses?: InstanceViewStatus[]; + vmAgentVersion?: string; + extensionHandlers?: VirtualMachineExtensionHandlerInstanceView[]; + statuses?: InstanceViewStatus[]; } /** @@ -1107,14 +1210,15 @@ export interface VirtualMachineAgentInstanceView { * Initializes a new instance of the DiskInstanceView class. * @constructor * The instance view of the disk. - * @member {string} [name] the disk name. + * + * @member {string} [name] The disk name. * - * @member {array} [statuses] the resource status information. + * @member {array} [statuses] The resource status information. * */ export interface DiskInstanceView { - name?: string; - statuses?: InstanceViewStatus[]; + name?: string; + statuses?: InstanceViewStatus[]; } /** @@ -1122,15 +1226,16 @@ export interface DiskInstanceView { * 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} [consoleScreenshotBlobUri] The console screenshot blob URI. * - * @member {string} [serialConsoleLogBlobUri] the Linux serial console log + * @member {string} [serialConsoleLogBlobUri] The Linux serial console log * blob Uri. * */ export interface BootDiagnosticsInstanceView { - consoleScreenshotBlobUri?: string; - serialConsoleLogBlobUri?: string; + consoleScreenshotBlobUri?: string; + serialConsoleLogBlobUri?: string; } /** @@ -1138,20 +1243,23 @@ export interface BootDiagnosticsInstanceView { * Initializes a new instance of the VirtualMachineInstanceView class. * @constructor * The instance view of a virtual machine. - * @member {number} [platformUpdateDomain] the Update Domain count. + * + * @member {number} [platformUpdateDomain] Specifies the update domain of the + * virtual machine. * - * @member {number} [platformFaultDomain] the Fault Domain count. + * @member {number} [platformFaultDomain] Specifies the fault domain of the + * virtual machine. * - * @member {string} [rdpThumbPrint] the Remote desktop certificate thumbprint. + * @member {string} [rdpThumbPrint] The Remote desktop certificate thumbprint. * - * @member {object} [vmAgent] the VM Agent running on the virtual machine. + * @member {object} [vmAgent] The VM Agent running on the virtual machine. * - * @member {string} [vmAgent.vmAgentVersion] the VM Agent full version. + * @member {string} [vmAgent.vmAgentVersion] The VM Agent full version. * - * @member {array} [vmAgent.extensionHandlers] the virtual machine extension + * @member {array} [vmAgent.extensionHandlers] The virtual machine extension * handler instance view. * - * @member {array} [vmAgent.statuses] the resource status information. + * @member {array} [vmAgent.statuses] The resource status information. * * @member {array} [disks] the disks information. * @@ -1159,24 +1267,24 @@ export interface BootDiagnosticsInstanceView { * * @member {object} [bootDiagnostics] the boot diagnostics. * - * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] the console - * screenshot blob Uri. + * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console + * screenshot blob URI. * - * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] the Linux serial + * @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; - rdpThumbPrint?: string; - vmAgent?: VirtualMachineAgentInstanceView; - disks?: DiskInstanceView[]; - extensions?: VirtualMachineExtensionInstanceView[]; - bootDiagnostics?: BootDiagnosticsInstanceView; - statuses?: InstanceViewStatus[]; + platformUpdateDomain?: number; + platformFaultDomain?: number; + rdpThumbPrint?: string; + vmAgent?: VirtualMachineAgentInstanceView; + disks?: DiskInstanceView[]; + extensions?: VirtualMachineExtensionInstanceView[]; + bootDiagnostics?: BootDiagnosticsInstanceView; + statuses?: InstanceViewStatus[]; } /** @@ -1184,7 +1292,8 @@ export interface VirtualMachineInstanceView { * Initializes a new instance of the VirtualMachine class. * @constructor * Describes a Virtual Machine. - * @member {object} [plan] the purchase plan when deploying virtual machine + * + * @member {object} [plan] The purchase plan when deploying virtual machine * from VM Marketplace images. * * @member {string} [plan.name] the plan ID. @@ -1195,7 +1304,7 @@ export interface VirtualMachineInstanceView { * * @member {string} [plan.promotionCode] the promotion code. * - * @member {object} [hardwareProfile] the hardware profile. + * @member {object} [hardwareProfile] The hardware profile. * * @member {string} [hardwareProfile.vmSize] The virtual machine size name. * Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', @@ -1215,23 +1324,23 @@ export interface VirtualMachineInstanceView { * 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5' * - * @member {object} [storageProfile] the storage profile. + * @member {object} [storageProfile] The storage profile. * - * @member {object} [storageProfile.imageReference] the image reference. + * @member {object} [storageProfile.imageReference] The image reference. * - * @member {string} [storageProfile.imageReference.publisher] the image + * @member {string} [storageProfile.imageReference.publisher] The image * publisher. * - * @member {string} [storageProfile.imageReference.offer] the image offer. + * @member {string} [storageProfile.imageReference.offer] The image offer. * - * @member {string} [storageProfile.imageReference.sku] the image sku. + * @member {string} [storageProfile.imageReference.sku] The image SKU. * - * @member {string} [storageProfile.imageReference.version] the image version. + * @member {string} [storageProfile.imageReference.version] The image version. * The allowed formats are Major.Minor.Build or 'latest'. Major, Minor and * Build being decimal numbers. Specify 'latest' to use the latest version of - * image. + * the image. * - * @member {object} [storageProfile.osDisk] the OS disk. + * @member {object} [storageProfile.osDisk] The OS disk. * * @member {string} [storageProfile.osDisk.osType] the Operating System type. * Possible values include: 'Windows', 'Linux' @@ -1283,7 +1392,7 @@ export interface VirtualMachineInstanceView { * * @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 + * attach to the Virtual Machine. If SourceImage is provided, the destination * VirtualHardDisk should not exist. * * @member {string} [storageProfile.osDisk.image.uri] the virtual hard disk's @@ -1299,99 +1408,111 @@ export interface VirtualMachineInstanceView { * in GB for blank data disks, and the new desired size for existing OS and * Data disks. * - * @member {array} [storageProfile.dataDisks] the data disks. + * @member {array} [storageProfile.dataDisks] The data disks. * - * @member {object} [osProfile] the OS profile. + * @member {object} [osProfile] The OS profile. * - * @member {string} [osProfile.computerName] the computer name. + * @member {string} [osProfile.computerName] Specifies the host OS name of the + * virtual machine. * - * @member {string} [osProfile.adminUsername] the admin user name. + * @member {string} [osProfile.adminUsername] Specifies the name of the + * administrator account. * - * @member {string} [osProfile.adminPassword] the admin user password. + * @member {string} [osProfile.adminPassword] Specifies the password of the + * administrator account. * - * @member {string} [osProfile.customData] a base-64 encoded string of custom - * data. + * @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 * * @member {object} [osProfile.windowsConfiguration] the Windows Configuration * of the OS profile. * - * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] whether - * VM Agent should be provisioned on the Virtual Machine. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether the virtual machine agent should be provisioned on the + * Virtual Machine. If not specified, then the default behavior is to set it + * to true. * * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] - * whether Windows updates are automatically installed on the VM + * Indicates whether Windows updates are automatically installed on the VM. * - * @member {string} [osProfile.windowsConfiguration.timeZone] the Time Zone of + * @member {string} [osProfile.windowsConfiguration.timeZone] The Time Zone of * the VM * * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] - * the additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file. + * Additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file. * - * @member {object} [osProfile.windowsConfiguration.winRM] the Windows Remote + * @member {object} [osProfile.windowsConfiguration.winRM] The Windows Remote * Management configuration of the VM * - * @member {array} [osProfile.windowsConfiguration.winRM.listeners] the list + * @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] whether - * Authentication using user name and password is allowed or not + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. * - * @member {object} [osProfile.linuxConfiguration.ssh] the SSH configuration - * for linux VMs + * @member {object} [osProfile.linuxConfiguration.ssh] The SSH configuration + * for linux VMs. * - * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] the list of - * SSH public keys used to authenticate with linux based VMs + * @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} [networkProfile] the network profile. + * @member {object} [networkProfile] The network profile. * - * @member {array} [networkProfile.networkInterfaces] the network interfaces. + * @member {array} [networkProfile.networkInterfaces] Specifies the list of + * resource Ids for the network interfaces associated with the virtual + * machine. * - * @member {object} [diagnosticsProfile] the diagnostics profile. + * @member {object} [diagnosticsProfile] The diagnostics profile. * - * @member {object} [diagnosticsProfile.bootDiagnostics] the boot diagnostics. + * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows the user to view console output and/or a + * screenshot of the virtual machine from the hypervisor. * - * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] whether boot + * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether boot * diagnostics should be enabled on the Virtual Machine. * - * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] the boot - * diagnostics storage Uri. It should be a valid Uri + * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] URI of the + * storage account to use for placing the console output and screenshot. * - * @member {object} [availabilitySet] the reference Id of the availability set - * to which this virtual machine belongs. + * @member {object} [availabilitySet] The reference Id of the availability set + * to which the virtual machine belongs. * * @member {string} [availabilitySet.id] Resource Id * - * @member {string} [provisioningState] the provisioning state, which only + * @member {string} [provisioningState] The provisioning state, which only * appears in the response. * - * @member {object} [instanceView] the virtual machine instance view. + * @member {object} [instanceView] The virtual machine instance view. * - * @member {number} [instanceView.platformUpdateDomain] the Update Domain - * count. + * @member {number} [instanceView.platformUpdateDomain] Specifies the update + * domain of the virtual machine. * - * @member {number} [instanceView.platformFaultDomain] the Fault Domain count. + * @member {number} [instanceView.platformFaultDomain] Specifies the fault + * domain of the virtual machine. * - * @member {string} [instanceView.rdpThumbPrint] the Remote desktop + * @member {string} [instanceView.rdpThumbPrint] The Remote desktop * certificate thumbprint. * - * @member {object} [instanceView.vmAgent] the VM Agent running on the virtual + * @member {object} [instanceView.vmAgent] The VM Agent running on the virtual * machine. * - * @member {string} [instanceView.vmAgent.vmAgentVersion] the VM Agent full + * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full * version. * - * @member {array} [instanceView.vmAgent.extensionHandlers] the virtual + * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual * machine extension handler instance view. * - * @member {array} [instanceView.vmAgent.statuses] the resource status + * @member {array} [instanceView.vmAgent.statuses] The resource status * information. * * @member {array} [instanceView.disks] the disks information. @@ -1401,34 +1522,54 @@ export interface VirtualMachineInstanceView { * @member {object} [instanceView.bootDiagnostics] the boot diagnostics. * * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] - * the console screenshot blob Uri. + * The console screenshot blob URI. * - * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] the + * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] The * Linux serial console log blob Uri. * * @member {array} [instanceView.statuses] the resource status information. * - * @member {string} [licenseType] the license type, which is for bring your - * own license scenario. + * @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. * - * @member {string} [vmId] the virtual machine unique id. + * @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. * */ export interface VirtualMachine extends Resource { - plan?: Plan; - hardwareProfile?: HardwareProfile; - storageProfile?: StorageProfile; - osProfile?: OSProfile; - networkProfile?: NetworkProfile; - diagnosticsProfile?: DiagnosticsProfile; - availabilitySet?: SubResource; - provisioningState?: string; - instanceView?: VirtualMachineInstanceView; - licenseType?: string; - vmId?: string; - resources?: VirtualMachineExtension[]; + plan?: Plan; + hardwareProfile?: HardwareProfile; + storageProfile?: StorageProfile; + osProfile?: OSProfile; + networkProfile?: NetworkProfile; + diagnosticsProfile?: DiagnosticsProfile; + availabilitySet?: SubResource; + provisioningState?: string; + instanceView?: VirtualMachineInstanceView; + licenseType?: string; + vmId?: string; + resources?: VirtualMachineExtension[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineListResult class. + * @constructor + * The List Virtual Machine operation response. + * + * @member {array} value The list of virtual machines. + * + * @member {string} [nextLink] The URI to fetch the next page of VMs. Call + * ListNext() with this to fetch the next page of Virtual Machines. + * + */ +export interface VirtualMachineListResult { + value: VirtualMachine[]; + nextLink?: string; } /** @@ -1436,17 +1577,18 @@ export interface VirtualMachine extends Resource { * Initializes a new instance of the Sku class. * @constructor * Describes a virtual machine scale set sku. - * @member {string} [name] the sku name. + * + * @member {string} [name] The sku name. * - * @member {string} [tier] the sku tier. + * @member {string} [tier] The sku tier. * * @member {number} [capacity] the sku capacity. * */ export interface Sku { - name?: string; - tier?: string; - capacity?: number; + name?: string; + tier?: string; + capacity?: number; } /** @@ -1454,12 +1596,13 @@ export interface Sku { * Initializes a new instance of the UpgradePolicy class. * @constructor * Describes an upgrade policy - automatic or manual. + * * @member {string} [mode] the upgrade mode. Possible values include: * 'Automatic', 'Manual' * */ export interface UpgradePolicy { - mode?: string; + mode?: string; } /** @@ -1467,6 +1610,7 @@ export interface UpgradePolicy { * Initializes a new instance of the VirtualMachineScaleSetOSProfile class. * @constructor * Describes a virtual machine scale set OS profile. + * * @member {string} [computerNamePrefix] the computer name prefix. * * @member {string} [adminUsername] the admin user name. @@ -1478,47 +1622,48 @@ export interface UpgradePolicy { * @member {object} [windowsConfiguration] the Windows Configuration of the OS * profile. * - * @member {boolean} [windowsConfiguration.provisionVMAgent] whether VM Agent - * should be provisioned on the Virtual Machine. + * @member {boolean} [windowsConfiguration.provisionVMAgent] Indicates whether + * the virtual machine agent should be provisioned on the Virtual Machine. If + * not specified, then the default behavior is to set it to true. * - * @member {boolean} [windowsConfiguration.enableAutomaticUpdates] whether - * Windows updates are automatically installed on the VM + * @member {boolean} [windowsConfiguration.enableAutomaticUpdates] Indicates + * whether Windows updates are automatically installed on the VM. * - * @member {string} [windowsConfiguration.timeZone] the Time Zone of the VM + * @member {string} [windowsConfiguration.timeZone] The Time Zone of the VM * - * @member {array} [windowsConfiguration.additionalUnattendContent] the - * additional base-64 encoded XML formatted information that can be included - * in the Unattend.xml file. + * @member {array} [windowsConfiguration.additionalUnattendContent] Additional + * base-64 encoded XML formatted information that can be included in the + * Unattend.xml file. * - * @member {object} [windowsConfiguration.winRM] the Windows Remote Management + * @member {object} [windowsConfiguration.winRM] The Windows Remote Management * configuration of the VM * - * @member {array} [windowsConfiguration.winRM.listeners] the list of Windows + * @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] - * whether Authentication using user name and password is allowed or not + * Specifies whether password authentication should be disabled. * - * @member {object} [linuxConfiguration.ssh] the SSH configuration for linux - * VMs + * @member {object} [linuxConfiguration.ssh] The SSH configuration for linux + * VMs. * - * @member {array} [linuxConfiguration.ssh.publicKeys] the list of SSH public - * keys used to authenticate with linux based VMs + * @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 VirtualMachineScaleSetOSProfile { - computerNamePrefix?: string; - adminUsername?: string; - adminPassword?: string; - customData?: string; - windowsConfiguration?: WindowsConfiguration; - linuxConfiguration?: LinuxConfiguration; - secrets?: VaultSecretGroup[]; + computerNamePrefix?: string; + adminUsername?: string; + adminPassword?: string; + customData?: string; + windowsConfiguration?: WindowsConfiguration; + linuxConfiguration?: LinuxConfiguration; + secrets?: VaultSecretGroup[]; } /** @@ -1526,6 +1671,7 @@ export interface VirtualMachineScaleSetOSProfile { * 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] the caching type. Possible values include: @@ -1539,8 +1685,8 @@ export interface VirtualMachineScaleSetOSProfile { * * @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. + * Machine. If SourceImage is provided, the destination VirtualHardDisk + * should not exist. * * @member {string} [image.uri] the virtual hard disk's uri. It should be a * valid Uri to a virtual hard disk. @@ -1550,12 +1696,12 @@ export interface VirtualMachineScaleSetOSProfile { * */ export interface VirtualMachineScaleSetOSDisk { - name: string; - caching?: string; - createOption: string; - osType?: string; - image?: VirtualHardDisk; - vhdContainers?: string[]; + name: string; + caching?: string; + createOption: string; + osType?: string; + image?: VirtualHardDisk; + vhdContainers?: string[]; } /** @@ -1563,17 +1709,18 @@ export interface VirtualMachineScaleSetOSDisk { * Initializes a new instance of the VirtualMachineScaleSetStorageProfile 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.publisher] The image publisher. * - * @member {string} [imageReference.offer] the image offer. + * @member {string} [imageReference.offer] The image offer. * - * @member {string} [imageReference.sku] the image sku. + * @member {string} [imageReference.sku] The image SKU. * - * @member {string} [imageReference.version] the image version. The allowed + * @member {string} [imageReference.version] The image version. The allowed * formats are Major.Minor.Build or 'latest'. Major, Minor and Build being - * decimal numbers. Specify 'latest' to use the latest version of image. + * decimal numbers. Specify 'latest' to use the latest version of the image. * * @member {object} [osDisk] the OS disk. * @@ -1590,8 +1737,8 @@ export interface VirtualMachineScaleSetOSDisk { * * @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. + * Machine. If SourceImage is provided, the destination VirtualHardDisk + * should not exist. * * @member {string} [osDisk.image.uri] the virtual hard disk's uri. It should * be a valid Uri to a virtual hard disk. @@ -1601,8 +1748,8 @@ export interface VirtualMachineScaleSetOSDisk { * */ export interface VirtualMachineScaleSetStorageProfile { - imageReference?: ImageReference; - osDisk?: VirtualMachineScaleSetOSDisk; + imageReference?: ImageReference; + osDisk?: VirtualMachineScaleSetOSDisk; } /** @@ -1610,12 +1757,13 @@ export interface VirtualMachineScaleSetStorageProfile { * 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; + id?: string; } /** @@ -1623,6 +1771,7 @@ export interface ApiEntityReference { * 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 the subnet. @@ -1641,11 +1790,11 @@ export interface ApiEntityReference { * */ export interface VirtualMachineScaleSetIPConfiguration extends SubResource { - name: string; - subnet: ApiEntityReference; - applicationGatewayBackendAddressPools?: SubResource[]; - loadBalancerBackendAddressPools?: SubResource[]; - loadBalancerInboundNatPools?: SubResource[]; + name: string; + subnet: ApiEntityReference; + applicationGatewayBackendAddressPools?: SubResource[]; + loadBalancerBackendAddressPools?: SubResource[]; + loadBalancerInboundNatPools?: SubResource[]; } /** @@ -1654,6 +1803,7 @@ export interface VirtualMachineScaleSetIPConfiguration extends SubResource { * @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 @@ -1664,9 +1814,9 @@ export interface VirtualMachineScaleSetIPConfiguration extends SubResource { * */ export interface VirtualMachineScaleSetNetworkConfiguration extends SubResource { - name: string; - primary?: boolean; - ipConfigurations: VirtualMachineScaleSetIPConfiguration[]; + name: string; + primary?: boolean; + ipConfigurations: VirtualMachineScaleSetIPConfiguration[]; } /** @@ -1674,12 +1824,13 @@ export interface VirtualMachineScaleSetNetworkConfiguration extends SubResource * Initializes a new instance of the VirtualMachineScaleSetNetworkProfile class. * @constructor * Describes a virtual machine scale set network profile. + * * @member {array} [networkInterfaceConfigurations] the list of network * configurations. * */ export interface VirtualMachineScaleSetNetworkProfile { - networkInterfaceConfigurations?: VirtualMachineScaleSetNetworkConfiguration[]; + networkInterfaceConfigurations?: VirtualMachineScaleSetNetworkConfiguration[]; } /** @@ -1687,6 +1838,7 @@ export interface VirtualMachineScaleSetNetworkProfile { * 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} [publisher] the name of the extension handler publisher. @@ -1710,14 +1862,14 @@ export interface VirtualMachineScaleSetNetworkProfile { * */ export interface VirtualMachineScaleSetExtension extends SubResource { - name?: string; - publisher?: string; - type?: string; - typeHandlerVersion?: string; - autoUpgradeMinorVersion?: boolean; - settings?: any; - protectedSettings?: any; - provisioningState?: string; + name?: string; + publisher?: string; + type?: string; + typeHandlerVersion?: string; + autoUpgradeMinorVersion?: boolean; + settings?: any; + protectedSettings?: any; + provisioningState?: string; } /** @@ -1725,12 +1877,13 @@ export interface VirtualMachineScaleSetExtension extends SubResource { * 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[]; + extensions?: VirtualMachineScaleSetExtension[]; } /** @@ -1738,6 +1891,7 @@ export interface VirtualMachineScaleSetExtensionProfile { * Initializes a new instance of the VirtualMachineScaleSetVMProfile class. * @constructor * Describes a virtual machine scale set virtual machine profile. + * * @member {object} [osProfile] the virtual machine scale set OS profile. * * @member {string} [osProfile.computerNamePrefix] the computer name prefix. @@ -1752,37 +1906,39 @@ export interface VirtualMachineScaleSetExtensionProfile { * @member {object} [osProfile.windowsConfiguration] the Windows Configuration * of the OS profile. * - * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] whether - * VM Agent should be provisioned on the Virtual Machine. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether the virtual machine agent should be provisioned on the + * Virtual Machine. If not specified, then the default behavior is to set it + * to true. * * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] - * whether Windows updates are automatically installed on the VM + * Indicates whether Windows updates are automatically installed on the VM. * - * @member {string} [osProfile.windowsConfiguration.timeZone] the Time Zone of + * @member {string} [osProfile.windowsConfiguration.timeZone] The Time Zone of * the VM * * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] - * the additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file. + * Additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file. * - * @member {object} [osProfile.windowsConfiguration.winRM] the Windows Remote + * @member {object} [osProfile.windowsConfiguration.winRM] The Windows Remote * Management configuration of the VM * - * @member {array} [osProfile.windowsConfiguration.winRM.listeners] the list + * @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] whether - * Authentication using user name and password is allowed or not + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. * - * @member {object} [osProfile.linuxConfiguration.ssh] the SSH configuration - * for linux VMs + * @member {object} [osProfile.linuxConfiguration.ssh] The SSH configuration + * for linux VMs. * - * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] the list of - * SSH public keys used to authenticate with linux based VMs + * @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. @@ -1792,17 +1948,17 @@ export interface VirtualMachineScaleSetExtensionProfile { * * @member {object} [storageProfile.imageReference] the image reference. * - * @member {string} [storageProfile.imageReference.publisher] the image + * @member {string} [storageProfile.imageReference.publisher] The image * publisher. * - * @member {string} [storageProfile.imageReference.offer] the image offer. + * @member {string} [storageProfile.imageReference.offer] The image offer. * - * @member {string} [storageProfile.imageReference.sku] the image sku. + * @member {string} [storageProfile.imageReference.sku] The image SKU. * - * @member {string} [storageProfile.imageReference.version] the image version. + * @member {string} [storageProfile.imageReference.version] The image version. * The allowed formats are Major.Minor.Build or 'latest'. Major, Minor and * Build being decimal numbers. Specify 'latest' to use the latest version of - * image. + * the image. * * @member {object} [storageProfile.osDisk] the OS disk. * @@ -1819,7 +1975,7 @@ export interface VirtualMachineScaleSetExtensionProfile { * * @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 + * attach to the Virtual Machine. If SourceImage is provided, the destination * VirtualHardDisk should not exist. * * @member {string} [storageProfile.osDisk.image.uri] the virtual hard disk's @@ -1842,10 +1998,10 @@ export interface VirtualMachineScaleSetExtensionProfile { * */ export interface VirtualMachineScaleSetVMProfile { - osProfile?: VirtualMachineScaleSetOSProfile; - storageProfile?: VirtualMachineScaleSetStorageProfile; - networkProfile?: VirtualMachineScaleSetNetworkProfile; - extensionProfile?: VirtualMachineScaleSetExtensionProfile; + osProfile?: VirtualMachineScaleSetOSProfile; + storageProfile?: VirtualMachineScaleSetStorageProfile; + networkProfile?: VirtualMachineScaleSetNetworkProfile; + extensionProfile?: VirtualMachineScaleSetExtensionProfile; } /** @@ -1853,11 +2009,12 @@ export interface VirtualMachineScaleSetVMProfile { * 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.name] The sku name. * - * @member {string} [sku.tier] the sku tier. + * @member {string} [sku.tier] The sku tier. * * @member {number} [sku.capacity] the sku capacity. * @@ -1888,27 +2045,29 @@ export interface VirtualMachineScaleSetVMProfile { * * @member {boolean} * [virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] - * whether VM Agent should be provisioned on the Virtual Machine. + * Indicates whether the virtual machine agent should be provisioned on the + * Virtual Machine. If not specified, then the default behavior is to set it + * to true. * * @member {boolean} * [virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] - * whether Windows updates are automatically installed on the VM + * Indicates whether Windows updates are automatically installed on the VM. * * @member {string} - * [virtualMachineProfile.osProfile.windowsConfiguration.timeZone] the Time + * [virtualMachineProfile.osProfile.windowsConfiguration.timeZone] The Time * Zone of the VM * * @member {array} * [virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] - * the additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file. + * Additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file. * * @member {object} - * [virtualMachineProfile.osProfile.windowsConfiguration.winRM] the Windows + * [virtualMachineProfile.osProfile.windowsConfiguration.winRM] The Windows * Remote Management configuration of the VM * * @member {array} - * [virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] the + * [virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] The * list of Windows Remote Management listeners * * @member {object} [virtualMachineProfile.osProfile.linuxConfiguration] the @@ -1916,14 +2075,14 @@ export interface VirtualMachineScaleSetVMProfile { * * @member {boolean} * [virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] - * whether Authentication using user name and password is allowed or not + * Specifies whether password authentication should be disabled. * * @member {object} [virtualMachineProfile.osProfile.linuxConfiguration.ssh] - * the SSH configuration for linux VMs + * The SSH configuration for linux VMs. * * @member {array} - * [virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] the - * list of SSH public keys used to authenticate with linux based VMs + * [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. @@ -1935,21 +2094,21 @@ export interface VirtualMachineScaleSetVMProfile { * image reference. * * @member {string} - * [virtualMachineProfile.storageProfile.imageReference.publisher] the image + * [virtualMachineProfile.storageProfile.imageReference.publisher] The image * publisher. * * @member {string} - * [virtualMachineProfile.storageProfile.imageReference.offer] the image + * [virtualMachineProfile.storageProfile.imageReference.offer] The image * offer. * * @member {string} [virtualMachineProfile.storageProfile.imageReference.sku] - * the image sku. + * The image SKU. * * @member {string} - * [virtualMachineProfile.storageProfile.imageReference.version] the image + * [virtualMachineProfile.storageProfile.imageReference.version] The image * version. The allowed formats are Major.Minor.Build or 'latest'. Major, * Minor and Build being decimal numbers. Specify 'latest' to use the latest - * version of image. + * version of the image. * * @member {object} [virtualMachineProfile.storageProfile.osDisk] the OS disk. * @@ -1967,7 +2126,7 @@ export interface VirtualMachineScaleSetVMProfile { * * @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 + * 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] @@ -1993,40 +2152,42 @@ export interface VirtualMachineScaleSetVMProfile { * @member {string} [provisioningState] the provisioning state, which only * appears in the response. * - * @member {boolean} [overProvision] Specifies whether the Virtual Machine + * @member {boolean} [overprovision] Specifies whether the Virtual Machine * Scale Set should be overprovisioned. * */ export interface VirtualMachineScaleSet extends Resource { - sku?: Sku; - upgradePolicy?: UpgradePolicy; - virtualMachineProfile?: VirtualMachineScaleSetVMProfile; - provisioningState?: string; - overProvision?: boolean; + sku?: Sku; + upgradePolicy?: UpgradePolicy; + virtualMachineProfile?: VirtualMachineScaleSetVMProfile; + provisioningState?: string; + overprovision?: boolean; } /** * @class * Initializes a new instance of the VirtualMachineScaleSetVMInstanceIDs class. * @constructor - * Specifies the list of virtual machine scale set instance IDs. + * 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 VirtualMachineScaleSetVMInstanceIDs { - instanceIds?: string[]; + instanceIds?: string[]; } /** * @class * Initializes a new instance of the VirtualMachineScaleSetVMInstanceRequiredIDs class. * @constructor - * Specifies the list of virtual machine scale set instance IDs. + * 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[]; + instanceIds: string[]; } /** @@ -2035,6 +2196,7 @@ export interface VirtualMachineScaleSetVMInstanceRequiredIDs { * @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 @@ -2042,8 +2204,8 @@ export interface VirtualMachineScaleSetVMInstanceRequiredIDs { * */ export interface VirtualMachineStatusCodeCount { - code?: string; - count?: number; + code?: string; + count?: number; } /** @@ -2052,11 +2214,12 @@ export interface VirtualMachineStatusCodeCount { * @constructor * Instance view statuses summary for virtual machines of a virtual machine * scale set. + * * @member {array} [statusesSummary] the extensions information. * */ export interface VirtualMachineScaleSetInstanceViewStatusesSummary { - statusesSummary?: VirtualMachineStatusCodeCount[]; + statusesSummary?: VirtualMachineStatusCodeCount[]; } /** @@ -2064,14 +2227,15 @@ export interface VirtualMachineScaleSetInstanceViewStatusesSummary { * 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 { - name?: string; - statusesSummary?: VirtualMachineStatusCodeCount[]; + name?: string; + statusesSummary?: VirtualMachineStatusCodeCount[]; } /** @@ -2079,6 +2243,7 @@ export interface VirtualMachineScaleSetVMExtensionsSummary { * 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. * @@ -2090,9 +2255,45 @@ export interface VirtualMachineScaleSetVMExtensionsSummary { * */ export interface VirtualMachineScaleSetInstanceView { - virtualMachine?: VirtualMachineScaleSetInstanceViewStatusesSummary; - extensions?: VirtualMachineScaleSetVMExtensionsSummary[]; - statuses?: InstanceViewStatus[]; + virtualMachine?: VirtualMachineScaleSetInstanceViewStatusesSummary; + extensions?: VirtualMachineScaleSetVMExtensionsSummary[]; + statuses?: InstanceViewStatus[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetListResult class. + * @constructor + * The List Virtual Machine operation response. + * + * @member {array} value the list of virtual machine scale sets. + * + * @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 { + value: VirtualMachineScaleSet[]; + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetListWithLinkResult class. + * @constructor + * The List Virtual Machine operation response. + * + * @member {array} value the list of virtual machine scale sets. + * + * @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 { + value: VirtualMachineScaleSet[]; + nextLink?: string; } /** @@ -2100,6 +2301,7 @@ export interface VirtualMachineScaleSetInstanceView { * 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. @@ -2111,10 +2313,10 @@ export interface VirtualMachineScaleSetInstanceView { * */ export interface VirtualMachineScaleSetSkuCapacity { - minimum?: number; - maximum?: number; - defaultCapacity?: number; - scaleType?: string; + minimum?: number; + maximum?: number; + defaultCapacity?: number; + scaleType?: string; } /** @@ -2122,13 +2324,14 @@ export interface VirtualMachineScaleSetSkuCapacity { * 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.name] The sku name. * - * @member {string} [sku.tier] the sku tier. + * @member {string} [sku.tier] The sku tier. * * @member {number} [sku.capacity] the sku capacity. * @@ -2145,9 +2348,28 @@ export interface VirtualMachineScaleSetSkuCapacity { * */ export interface VirtualMachineScaleSetSku { - resourceType?: string; - sku?: Sku; - capacity?: VirtualMachineScaleSetSkuCapacity; + resourceType?: string; + sku?: Sku; + capacity?: VirtualMachineScaleSetSkuCapacity; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetListSkusResult class. + * @constructor + * The Virtual Machine Scale Set List Skus operation response. + * + * @member {array} value the list of skus available for the virtual machine + * scale set. + * + * @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 { + value: VirtualMachineScaleSetSku[]; + nextLink?: string; } /** @@ -2155,13 +2377,14 @@ export interface VirtualMachineScaleSetSku { * 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 {string} [instanceId] The virtual machine instance ID. * - * @member {object} [sku] the virtual machine sku. + * @member {object} [sku] The virtual machine SKU. * - * @member {string} [sku.name] the sku name. + * @member {string} [sku.name] The sku name. * - * @member {string} [sku.tier] the sku tier. + * @member {string} [sku.tier] The sku tier. * * @member {number} [sku.capacity] the sku capacity. * @@ -2170,24 +2393,25 @@ export interface VirtualMachineScaleSetSku { * * @member {object} [instanceView] the virtual machine instance view. * - * @member {number} [instanceView.platformUpdateDomain] the Update Domain - * count. + * @member {number} [instanceView.platformUpdateDomain] Specifies the update + * domain of the virtual machine. * - * @member {number} [instanceView.platformFaultDomain] the Fault Domain count. + * @member {number} [instanceView.platformFaultDomain] Specifies the fault + * domain of the virtual machine. * - * @member {string} [instanceView.rdpThumbPrint] the Remote desktop + * @member {string} [instanceView.rdpThumbPrint] The Remote desktop * certificate thumbprint. * - * @member {object} [instanceView.vmAgent] the VM Agent running on the virtual + * @member {object} [instanceView.vmAgent] The VM Agent running on the virtual * machine. * - * @member {string} [instanceView.vmAgent.vmAgentVersion] the VM Agent full + * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full * version. * - * @member {array} [instanceView.vmAgent.extensionHandlers] the virtual + * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual * machine extension handler instance view. * - * @member {array} [instanceView.vmAgent.statuses] the resource status + * @member {array} [instanceView.vmAgent.statuses] The resource status * information. * * @member {array} [instanceView.disks] the disks information. @@ -2197,9 +2421,9 @@ export interface VirtualMachineScaleSetSku { * @member {object} [instanceView.bootDiagnostics] the boot diagnostics. * * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] - * the console screenshot blob Uri. + * The console screenshot blob URI. * - * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] the + * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] The * Linux serial console log blob Uri. * * @member {array} [instanceView.statuses] the resource status information. @@ -2226,21 +2450,21 @@ export interface VirtualMachineScaleSetSku { * * @member {object} [storageProfile] the storage profile. * - * @member {object} [storageProfile.imageReference] the image reference. + * @member {object} [storageProfile.imageReference] The image reference. * - * @member {string} [storageProfile.imageReference.publisher] the image + * @member {string} [storageProfile.imageReference.publisher] The image * publisher. * - * @member {string} [storageProfile.imageReference.offer] the image offer. + * @member {string} [storageProfile.imageReference.offer] The image offer. * - * @member {string} [storageProfile.imageReference.sku] the image sku. + * @member {string} [storageProfile.imageReference.sku] The image SKU. * - * @member {string} [storageProfile.imageReference.version] the image version. + * @member {string} [storageProfile.imageReference.version] The image version. * The allowed formats are Major.Minor.Build or 'latest'. Major, Minor and * Build being decimal numbers. Specify 'latest' to use the latest version of - * image. + * the image. * - * @member {object} [storageProfile.osDisk] the OS disk. + * @member {object} [storageProfile.osDisk] The OS disk. * * @member {string} [storageProfile.osDisk.osType] the Operating System type. * Possible values include: 'Windows', 'Linux' @@ -2292,7 +2516,7 @@ export interface VirtualMachineScaleSetSku { * * @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 + * attach to the Virtual Machine. If SourceImage is provided, the destination * VirtualHardDisk should not exist. * * @member {string} [storageProfile.osDisk.image.uri] the virtual hard disk's @@ -2308,70 +2532,81 @@ export interface VirtualMachineScaleSetSku { * in GB for blank data disks, and the new desired size for existing OS and * Data disks. * - * @member {array} [storageProfile.dataDisks] the data disks. + * @member {array} [storageProfile.dataDisks] The data disks. * * @member {object} [osProfile] the OS profile. * - * @member {string} [osProfile.computerName] the computer name. + * @member {string} [osProfile.computerName] Specifies the host OS name of the + * virtual machine. * - * @member {string} [osProfile.adminUsername] the admin user name. + * @member {string} [osProfile.adminUsername] Specifies the name of the + * administrator account. * - * @member {string} [osProfile.adminPassword] the admin user password. + * @member {string} [osProfile.adminPassword] Specifies the password of the + * administrator account. * - * @member {string} [osProfile.customData] a base-64 encoded string of custom - * data. + * @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 * * @member {object} [osProfile.windowsConfiguration] the Windows Configuration * of the OS profile. * - * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] whether - * VM Agent should be provisioned on the Virtual Machine. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether the virtual machine agent should be provisioned on the + * Virtual Machine. If not specified, then the default behavior is to set it + * to true. * * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] - * whether Windows updates are automatically installed on the VM + * Indicates whether Windows updates are automatically installed on the VM. * - * @member {string} [osProfile.windowsConfiguration.timeZone] the Time Zone of + * @member {string} [osProfile.windowsConfiguration.timeZone] The Time Zone of * the VM * * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] - * the additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file. + * Additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file. * - * @member {object} [osProfile.windowsConfiguration.winRM] the Windows Remote + * @member {object} [osProfile.windowsConfiguration.winRM] The Windows Remote * Management configuration of the VM * - * @member {array} [osProfile.windowsConfiguration.winRM.listeners] the list + * @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] whether - * Authentication using user name and password is allowed or not + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. * - * @member {object} [osProfile.linuxConfiguration.ssh] the SSH configuration - * for linux VMs + * @member {object} [osProfile.linuxConfiguration.ssh] The SSH configuration + * for linux VMs. * - * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] the list of - * SSH public keys used to authenticate with linux based VMs + * @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} [networkProfile] the network profile. * - * @member {array} [networkProfile.networkInterfaces] the network interfaces. + * @member {array} [networkProfile.networkInterfaces] Specifies the list of + * resource Ids for the network interfaces associated with the virtual + * machine. * * @member {object} [diagnosticsProfile] the diagnostics profile. * - * @member {object} [diagnosticsProfile.bootDiagnostics] the boot diagnostics. + * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows the user to view console output and/or a + * screenshot of the virtual machine from the hypervisor. * - * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] whether boot + * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether boot * diagnostics should be enabled on the Virtual Machine. * - * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] the boot - * diagnostics storage Uri. It should be a valid Uri + * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] URI of the + * storage account to use for placing the console output and screenshot. * * @member {object} [availabilitySet] the reference Id of the availability set * to which this virtual machine belongs. @@ -2384,7 +2619,7 @@ export interface VirtualMachineScaleSetSku { * @member {string} [licenseType] the license type, which is for bring your * own license scenario. * - * @member {object} [plan] the purchase plan when deploying virtual machine + * @member {object} [plan] The purchase plan when deploying virtual machine * from VM Marketplace images. * * @member {string} [plan.name] the plan ID. @@ -2399,20 +2634,20 @@ export interface VirtualMachineScaleSetSku { * */ export interface VirtualMachineScaleSetVM extends Resource { - instanceId?: string; - sku?: Sku; - latestModelApplied?: boolean; - instanceView?: VirtualMachineInstanceView; - hardwareProfile?: HardwareProfile; - storageProfile?: StorageProfile; - osProfile?: OSProfile; - networkProfile?: NetworkProfile; - diagnosticsProfile?: DiagnosticsProfile; - availabilitySet?: SubResource; - provisioningState?: string; - licenseType?: string; - plan?: Plan; - resources?: VirtualMachineExtension[]; + instanceId?: string; + sku?: Sku; + latestModelApplied?: boolean; + instanceView?: VirtualMachineInstanceView; + hardwareProfile?: HardwareProfile; + storageProfile?: StorageProfile; + osProfile?: OSProfile; + networkProfile?: NetworkProfile; + diagnosticsProfile?: DiagnosticsProfile; + availabilitySet?: SubResource; + provisioningState?: string; + licenseType?: string; + plan?: Plan; + resources?: VirtualMachineExtension[]; } /** @@ -2420,6 +2655,7 @@ export interface VirtualMachineScaleSetVM extends Resource { * 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. @@ -2428,12 +2664,12 @@ export interface VirtualMachineScaleSetVM extends Resource { * * @member {object} [vmAgent] the VM Agent running on the virtual machine. * - * @member {string} [vmAgent.vmAgentVersion] the VM Agent full version. + * @member {string} [vmAgent.vmAgentVersion] The VM Agent full version. * - * @member {array} [vmAgent.extensionHandlers] the virtual machine extension + * @member {array} [vmAgent.extensionHandlers] The virtual machine extension * handler instance view. * - * @member {array} [vmAgent.statuses] the resource status information. + * @member {array} [vmAgent.statuses] The resource status information. * * @member {array} [disks] the disks information. * @@ -2441,24 +2677,42 @@ export interface VirtualMachineScaleSetVM extends Resource { * * @member {object} [bootDiagnostics] the boot diagnostics. * - * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] the console - * screenshot blob Uri. + * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console + * screenshot blob URI. * - * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] the Linux serial + * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] The Linux serial * console log blob Uri. * * @member {array} [statuses] the resource status information. * */ export interface VirtualMachineScaleSetVMInstanceView { - platformUpdateDomain?: number; - platformFaultDomain?: number; - rdpThumbPrint?: string; - vmAgent?: VirtualMachineAgentInstanceView; - disks?: DiskInstanceView[]; - extensions?: VirtualMachineExtensionInstanceView[]; - bootDiagnostics?: BootDiagnosticsInstanceView; - statuses?: InstanceViewStatus[]; + platformUpdateDomain?: number; + platformFaultDomain?: number; + rdpThumbPrint?: string; + vmAgent?: VirtualMachineAgentInstanceView; + disks?: DiskInstanceView[]; + extensions?: VirtualMachineExtensionInstanceView[]; + bootDiagnostics?: BootDiagnosticsInstanceView; + statuses?: InstanceViewStatus[]; +} + +/** + * @class + * Initializes a new instance of the VirtualMachineScaleSetVMListResult class. + * @constructor + * The List Virtual Machine Scale Set VMs operation response. + * + * @member {array} value the list of virtual machine scale sets VMs. + * + * @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 { + value: VirtualMachineScaleSetVM[]; + nextLink?: string; } /** @@ -2466,6 +2720,7 @@ export interface VirtualMachineScaleSetVMInstanceView { * 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. @@ -2474,9 +2729,9 @@ export interface VirtualMachineScaleSetVMInstanceView { * */ export interface ApiErrorBase { - code?: string; - target?: string; - message?: string; + code?: string; + target?: string; + message?: string; } /** @@ -2484,14 +2739,15 @@ export interface ApiErrorBase { * 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; + exceptiontype?: string; + errordetail?: string; } /** @@ -2499,6 +2755,7 @@ export interface InnerError { * 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 @@ -2516,11 +2773,11 @@ export interface InnerError { * */ export interface ApiError { - details?: ApiErrorBase[]; - innererror?: InnerError; - code?: string; - target?: string; - message?: string; + details?: ApiErrorBase[]; + innererror?: InnerError; + code?: string; + target?: string; + message?: string; } /** @@ -2528,57 +2785,96 @@ export interface ApiError { * 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; + output?: any; +} + +/** + * @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 Orchestrator - * @member {string} [orchestratorType] Specifies what orchestrator will be - * used to manage container cluster resources. Possible values include: - * 'Swarm', 'DCOS' + * 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' * */ export interface ContainerServiceOrchestratorProfile { - orchestratorType?: string; + orchestratorType: string; } /** * @class * Initializes a new instance of the ContainerServiceMasterProfile class. * @constructor - * Profile for container service master - * @member {number} [count] Number of masters (VMs) in the container cluster + * 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 FQDN for master + * @member {string} dnsPrefix DNS prefix to be used to create the FQDN for + * master. * - * @member {string} [fqdn] FDQN for the master + * @member {string} [fqdn] FDQN for the master. * */ export interface ContainerServiceMasterProfile { - count?: number; - dnsPrefix: string; - fqdn?: string; + count?: number; + dnsPrefix: string; + fqdn?: string; } /** * @class * Initializes a new instance of the ContainerServiceAgentPoolProfile class. * @constructor - * Profile for container service agent pool - * @member {string} name Unique name of the agent pool profile within the - * context of the subscription and resource group + * 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] No. of agents (VMs) that will host docker - * containers + * @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. * - * @member {string} [vmSize] Size of agent VMs. Possible values include: + * @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', @@ -2592,67 +2888,70 @@ export interface ContainerServiceMasterProfile { * 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', * 'Standard_GS5' * - * @member {string} dnsPrefix DNS prefix to be used to create FQDN for this - * agent pool + * @member {string} dnsPrefix DNS prefix to be used to create the FQDN for the + * agent pool. * - * @member {string} [fqdn] FDQN for the agent pool + * @member {string} [fqdn] FDQN for the agent pool. * */ export interface ContainerServiceAgentPoolProfile { - name: string; - count?: number; - vmSize?: string; - dnsPrefix: string; - fqdn?: string; + name: string; + count: number; + vmSize: string; + dnsPrefix: string; + fqdn?: string; } /** * @class * Initializes a new instance of the ContainerServiceWindowsProfile class. * @constructor - * Profile for Windows VMs - * @member {string} adminUsername The administrator username to use for - * Windows VMs + * Profile for Windows VMs in the container service cluster. + * + * @member {string} adminUsername The administrator user name to use for + * Windows VMs. * * @member {string} adminPassword The administrator password to use for - * Windows VMs + * Windows VMs. * */ export interface ContainerServiceWindowsProfile { - adminUsername: string; - adminPassword: string; + adminUsername: string; + adminPassword: string; } /** * @class * Initializes a new instance of the ContainerServiceLinuxProfile class. * @constructor - * Profile for Linux VMs - * @member {string} adminUsername The administrator username to use for all - * Linux VMs + * Profile for Linux VMs in the container service cluster. + * + * @member {string} adminUsername The administrator user name to use for Linux + * VMs. * - * @member {object} ssh Specifies the ssh key configuration 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 + * @member {array} [ssh.publicKeys] The list of SSH public keys used to + * authenticate with Linux-based VMs. * */ export interface ContainerServiceLinuxProfile { - adminUsername: string; - ssh: ContainerServiceSshConfiguration; + adminUsername: string; + ssh: ContainerServiceSshConfiguration; } /** * @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 + * 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[]; + publicKeys: ContainerServiceSshPublicKey[]; } /** @@ -2660,113 +2959,273 @@ export interface ContainerServiceSshConfiguration { * 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 - * VM through SSH. The certificate must be in Pem format with or without + * VMs through SSH. The certificate must be in PEM format with or without * headers. * */ export interface ContainerServiceSshPublicKey { - keyData: string; + keyData: string; } /** * @class * Initializes a new instance of the ContainerServiceDiagnosticsProfile class. * @constructor - * @member {object} [vmDiagnostics] Profile for container service VM - * diagnostic agent + * @member {object} vmDiagnostics Profile for the container service VM + * diagnostic agent. * - * @member {boolean} [vmDiagnostics.enabled] whether VM Diagnostic Agent - * should be provisioned on the Virtual Machine. + * @member {boolean} [vmDiagnostics.enabled] Whether the VM diagnostic agent + * is provisioned on the VM. * - * @member {string} [vmDiagnostics.storageUri] whether VM Diagnostic Agent - * should be provisioned on the Virtual Machine. + * @member {string} [vmDiagnostics.storageUri] The URI of the storage account + * where diagnostics are stored. * */ export interface ContainerServiceDiagnosticsProfile { - vmDiagnostics?: ContainerServiceVMDiagnostics; + vmDiagnostics: ContainerServiceVMDiagnostics; } /** * @class * Initializes a new instance of the ContainerServiceVMDiagnostics class. * @constructor - * Describes VM Diagnostics. - * @member {boolean} [enabled] whether VM Diagnostic Agent should be - * provisioned on the Virtual Machine. + * Profile for diagnostics on the container service VMs. + * + * @member {boolean} enabled Whether the VM diagnostic agent is provisioned on + * the VM. * - * @member {string} [storageUri] whether VM Diagnostic Agent should be - * provisioned on the Virtual Machine. + * @member {string} [storageUri] The URI of the storage account where + * diagnostics are stored. * */ export interface ContainerServiceVMDiagnostics { - enabled?: boolean; - storageUri?: string; + enabled: boolean; + storageUri?: string; } /** * @class * Initializes a new instance of the ContainerService class. * @constructor - * Container service - * @member {string} [provisioningState] the provisioning state, which only - * appears in the response. + * Container service. + * + * @member {string} [provisioningState] The current deployment or provisioning + * state, which only appears in the response. * - * @member {object} [orchestratorProfile] Properties of orchestrator + * @member {object} [orchestratorProfile] Properties of the orchestrator. * - * @member {string} [orchestratorProfile.orchestratorType] Specifies what - * orchestrator will be used to manage container cluster resources. Possible - * values include: 'Swarm', 'DCOS' + * @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' * - * @member {object} masterProfile Properties of master agents + * @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 cluster + * 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 - * FQDN for master + * the FQDN for master. * - * @member {string} [masterProfile.fqdn] FDQN for the master + * @member {string} [masterProfile.fqdn] FDQN for the master. * - * @member {array} agentPoolProfiles Properties of agent pools + * @member {array} agentPoolProfiles Properties of the agent pool. * - * @member {object} [windowsProfile] Properties of Windows VMs + * @member {object} [windowsProfile] Properties of Windows VMs. * - * @member {string} [windowsProfile.adminUsername] The administrator username - * to use for Windows VMs + * @member {string} [windowsProfile.adminUsername] The administrator user name + * to use for Windows VMs. * * @member {string} [windowsProfile.adminPassword] The administrator password - * to use for Windows VMs + * to use for Windows VMs. * - * @member {object} linuxProfile Properties for Linux VMs + * @member {object} linuxProfile Properties of Linux VMs. * - * @member {string} [linuxProfile.adminUsername] The administrator username to - * use for all Linux VMs + * @member {string} [linuxProfile.adminUsername] The administrator user name + * to use for Linux VMs. * - * @member {object} [linuxProfile.ssh] Specifies the ssh key configuration 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 {array} [linuxProfile.ssh.publicKeys] The list of SSH public keys + * used to authenticate with Linux-based VMs. * - * @member {object} [diagnosticsProfile] Properties for Diagnostic Agent + * @member {object} [diagnosticsProfile] Properties of the diagnostic agent. * - * @member {object} [diagnosticsProfile.vmDiagnostics] Profile for container - * service VM diagnostic agent + * @member {object} [diagnosticsProfile.vmDiagnostics] Profile for the + * container service VM diagnostic agent. * - * @member {boolean} [diagnosticsProfile.vmDiagnostics.enabled] whether VM - * Diagnostic Agent should be provisioned on the Virtual Machine. + * @member {boolean} [diagnosticsProfile.vmDiagnostics.enabled] Whether the VM + * diagnostic agent is provisioned on the VM. * - * @member {string} [diagnosticsProfile.vmDiagnostics.storageUri] whether VM - * Diagnostic Agent should be provisioned on the Virtual Machine. + * @member {string} [diagnosticsProfile.vmDiagnostics.storageUri] The URI of + * the storage account where diagnostics are stored. * */ export interface ContainerService extends Resource { - provisioningState?: string; - orchestratorProfile?: ContainerServiceOrchestratorProfile; - masterProfile: ContainerServiceMasterProfile; - agentPoolProfiles: ContainerServiceAgentPoolProfile[]; - windowsProfile?: ContainerServiceWindowsProfile; - linuxProfile: ContainerServiceLinuxProfile; - diagnosticsProfile?: ContainerServiceDiagnosticsProfile; + 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 ContainerServiceListResult class. + * @constructor + * The response from the List Container Services operation. + * + * @member {array} [value] The list of container services. + * + * @member {string} [nextLink] The URL to get the next set of container + * service results. + * + */ +export interface ContainerServiceListResult { + value?: ContainerService[]; + nextLink?: string; +} + + +/** + * @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 Usages. Call ListNext() with this to fetch the next page of + * Compute Resource Usages. + * + */ +export interface ListUsagesResult 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 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 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 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/models/index.js b/lib/services/computeManagement2/lib/models/index.js index 4e9c0070ae..b320c5394a 100644 --- a/lib/services/computeManagement2/lib/models/index.js +++ b/lib/services/computeManagement2/lib/models/index.js @@ -22,7 +22,9 @@ exports.InstanceViewStatus = require('./instanceViewStatus'); exports.SubResource = require('./subResource'); exports.Resource = require('./resource'); exports.AvailabilitySet = require('./availabilitySet'); +exports.AvailabilitySetListResult = require('./availabilitySetListResult'); exports.VirtualMachineSize = require('./virtualMachineSize'); +exports.VirtualMachineSizeListResult = require('./virtualMachineSizeListResult'); exports.VirtualMachineExtensionImage = require('./virtualMachineExtensionImage'); exports.VirtualMachineImageResource = require('./virtualMachineImageResource'); exports.VirtualMachineExtensionInstanceView = require('./virtualMachineExtensionInstanceView'); @@ -33,6 +35,7 @@ exports.DataDiskImage = require('./dataDiskImage'); exports.VirtualMachineImage = require('./virtualMachineImage'); exports.UsageName = require('./usageName'); exports.Usage = require('./usage'); +exports.ListUsagesResult = require('./listUsagesResult'); exports.VirtualMachineCaptureParameters = require('./virtualMachineCaptureParameters'); exports.VirtualMachineCaptureResult = require('./virtualMachineCaptureResult'); exports.Plan = require('./plan'); @@ -65,6 +68,7 @@ exports.DiskInstanceView = require('./diskInstanceView'); exports.BootDiagnosticsInstanceView = require('./bootDiagnosticsInstanceView'); exports.VirtualMachineInstanceView = require('./virtualMachineInstanceView'); exports.VirtualMachine = require('./virtualMachine'); +exports.VirtualMachineListResult = require('./virtualMachineListResult'); exports.Sku = require('./sku'); exports.UpgradePolicy = require('./upgradePolicy'); exports.VirtualMachineScaleSetOSProfile = require('./virtualMachineScaleSetOSProfile'); @@ -84,14 +88,20 @@ exports.VirtualMachineStatusCodeCount = require('./virtualMachineStatusCodeCount exports.VirtualMachineScaleSetInstanceViewStatusesSummary = require('./virtualMachineScaleSetInstanceViewStatusesSummary'); exports.VirtualMachineScaleSetVMExtensionsSummary = require('./virtualMachineScaleSetVMExtensionsSummary'); exports.VirtualMachineScaleSetInstanceView = require('./virtualMachineScaleSetInstanceView'); +exports.VirtualMachineScaleSetListResult = require('./virtualMachineScaleSetListResult'); +exports.VirtualMachineScaleSetListWithLinkResult = require('./virtualMachineScaleSetListWithLinkResult'); exports.VirtualMachineScaleSetSkuCapacity = require('./virtualMachineScaleSetSkuCapacity'); exports.VirtualMachineScaleSetSku = require('./virtualMachineScaleSetSku'); +exports.VirtualMachineScaleSetListSkusResult = require('./virtualMachineScaleSetListSkusResult'); exports.VirtualMachineScaleSetVM = require('./virtualMachineScaleSetVM'); exports.VirtualMachineScaleSetVMInstanceView = require('./virtualMachineScaleSetVMInstanceView'); +exports.VirtualMachineScaleSetVMListResult = require('./virtualMachineScaleSetVMListResult'); exports.ApiErrorBase = require('./apiErrorBase'); exports.InnerError = require('./innerError'); exports.ApiError = require('./apiError'); exports.ComputeLongRunningOperationProperties = require('./computeLongRunningOperationProperties'); +exports.ContainerServiceCustomProfile = require('./containerServiceCustomProfile'); +exports.ContainerServiceServicePrincipalProfile = require('./containerServiceServicePrincipalProfile'); exports.ContainerServiceOrchestratorProfile = require('./containerServiceOrchestratorProfile'); exports.ContainerServiceMasterProfile = require('./containerServiceMasterProfile'); exports.ContainerServiceAgentPoolProfile = require('./containerServiceAgentPoolProfile'); @@ -102,12 +112,4 @@ exports.ContainerServiceSshPublicKey = require('./containerServiceSshPublicKey') exports.ContainerServiceDiagnosticsProfile = require('./containerServiceDiagnosticsProfile'); exports.ContainerServiceVMDiagnostics = require('./containerServiceVMDiagnostics'); exports.ContainerService = require('./containerService'); -exports.AvailabilitySetListResult = require('./availabilitySetListResult'); -exports.VirtualMachineSizeListResult = require('./virtualMachineSizeListResult'); -exports.ListUsagesResult = require('./listUsagesResult'); -exports.VirtualMachineListResult = require('./virtualMachineListResult'); -exports.VirtualMachineScaleSetListResult = require('./virtualMachineScaleSetListResult'); -exports.VirtualMachineScaleSetListWithLinkResult = require('./virtualMachineScaleSetListWithLinkResult'); -exports.VirtualMachineScaleSetListSkusResult = require('./virtualMachineScaleSetListSkusResult'); -exports.VirtualMachineScaleSetVMListResult = require('./virtualMachineScaleSetVMListResult'); exports.ContainerServiceListResult = require('./containerServiceListResult'); diff --git a/lib/services/computeManagement2/lib/models/innerError.js b/lib/services/computeManagement2/lib/models/innerError.js index b7c3d4f2c4..cc246c59f6 100644 --- a/lib/services/computeManagement2/lib/models/innerError.js +++ b/lib/services/computeManagement2/lib/models/innerError.js @@ -15,6 +15,7 @@ * 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. diff --git a/lib/services/computeManagement2/lib/models/instanceViewStatus.js b/lib/services/computeManagement2/lib/models/instanceViewStatus.js index b72b6c3998..c69d0c9bd3 100644 --- a/lib/services/computeManagement2/lib/models/instanceViewStatus.js +++ b/lib/services/computeManagement2/lib/models/instanceViewStatus.js @@ -15,6 +15,7 @@ * 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', diff --git a/lib/services/computeManagement2/lib/models/keyVaultKeyReference.js b/lib/services/computeManagement2/lib/models/keyVaultKeyReference.js index 1dc654426f..61b96fa6c9 100644 --- a/lib/services/computeManagement2/lib/models/keyVaultKeyReference.js +++ b/lib/services/computeManagement2/lib/models/keyVaultKeyReference.js @@ -17,6 +17,7 @@ var models = require('./index'); * Initializes a new instance of the KeyVaultKeyReference class. * @constructor * Describes a reference to Key Vault Key + * * @member {string} keyUrl the URL referencing a key in a Key Vault. * * @member {object} sourceVault the Relative URL of the Key Vault containing diff --git a/lib/services/computeManagement2/lib/models/keyVaultSecretReference.js b/lib/services/computeManagement2/lib/models/keyVaultSecretReference.js index bd4eb3771e..6f403efa43 100644 --- a/lib/services/computeManagement2/lib/models/keyVaultSecretReference.js +++ b/lib/services/computeManagement2/lib/models/keyVaultSecretReference.js @@ -17,6 +17,7 @@ var models = require('./index'); * 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 diff --git a/lib/services/computeManagement2/lib/models/linuxConfiguration.js b/lib/services/computeManagement2/lib/models/linuxConfiguration.js index f2cda7cc9a..324c7486cf 100644 --- a/lib/services/computeManagement2/lib/models/linuxConfiguration.js +++ b/lib/services/computeManagement2/lib/models/linuxConfiguration.js @@ -17,13 +17,14 @@ var models = require('./index'); * Initializes a new instance of the LinuxConfiguration class. * @constructor * Describes Windows Configuration of the OS Profile. - * @member {boolean} [disablePasswordAuthentication] whether Authentication - * using user name and password is allowed or not + * + * @member {boolean} [disablePasswordAuthentication] Specifies whether + * password authentication should be disabled. * - * @member {object} [ssh] the SSH configuration for linux VMs + * @member {object} [ssh] The SSH configuration for linux VMs. * - * @member {array} [ssh.publicKeys] the list of SSH public keys used to - * authenticate with linux based VMs + * @member {array} [ssh.publicKeys] The list of SSH public keys used to + * authenticate with linux based VMs. * */ function LinuxConfiguration() { diff --git a/lib/services/computeManagement2/lib/models/listUsagesResult.js b/lib/services/computeManagement2/lib/models/listUsagesResult.js index a3c0e1ac09..2f42a19355 100644 --- a/lib/services/computeManagement2/lib/models/listUsagesResult.js +++ b/lib/services/computeManagement2/lib/models/listUsagesResult.js @@ -17,8 +17,7 @@ var util = require('util'); * Initializes a new instance of the ListUsagesResult class. * @constructor * The List Usages operation response. - * @member {array} [value] the list Compute Resource Usages. - * + * * @member {string} [nextLink] the uri to fetch the next page of Compute * Resource Usages. Call ListNext() with this to fetch the next page of * Compute Resource Usages. @@ -44,7 +43,7 @@ ListUsagesResult.prototype.mapper = function () { className: 'ListUsagesResult', modelProperties: { value: { - required: false, + required: true, serializedName: '', type: { name: 'Sequence', diff --git a/lib/services/computeManagement2/lib/models/networkInterfaceReference.js b/lib/services/computeManagement2/lib/models/networkInterfaceReference.js index be47b08c23..cce826a1e2 100644 --- a/lib/services/computeManagement2/lib/models/networkInterfaceReference.js +++ b/lib/services/computeManagement2/lib/models/networkInterfaceReference.js @@ -19,8 +19,9 @@ var util = require('util'); * Initializes a new instance of the NetworkInterfaceReference class. * @constructor * Describes a network interface reference. - * @member {boolean} [primary] whether this is a primary NIC on a virtual - * machine + * + * @member {boolean} [primary] Specifies the primary network interface in case + * the virtual machine has more than 1 network interface. * */ function NetworkInterfaceReference() { diff --git a/lib/services/computeManagement2/lib/models/networkProfile.js b/lib/services/computeManagement2/lib/models/networkProfile.js index 2ad8aeb28c..a1935e2ab7 100644 --- a/lib/services/computeManagement2/lib/models/networkProfile.js +++ b/lib/services/computeManagement2/lib/models/networkProfile.js @@ -19,7 +19,9 @@ var util = require('util'); * Initializes a new instance of the NetworkProfile class. * @constructor * Describes a network profile. - * @member {array} [networkInterfaces] the network interfaces. + * + * @member {array} [networkInterfaces] Specifies the list of resource Ids for + * the network interfaces associated with the virtual machine. * */ function NetworkProfile() { diff --git a/lib/services/computeManagement2/lib/models/oSDisk.js b/lib/services/computeManagement2/lib/models/oSDisk.js index 974a57f3d5..221949051e 100644 --- a/lib/services/computeManagement2/lib/models/oSDisk.js +++ b/lib/services/computeManagement2/lib/models/oSDisk.js @@ -17,6 +17,7 @@ var models = require('./index'); * Initializes a new instance of the OSDisk class. * @constructor * Describes an Operating System disk. + * * @member {string} [osType] the Operating System type. Possible values * include: 'Windows', 'Linux' * @@ -58,8 +59,8 @@ var models = require('./index'); * * @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. + * Machine. If SourceImage is provided, the destination VirtualHardDisk + * should not exist. * * @member {string} [image.uri] the virtual hard disk's uri. It should be a * valid Uri to a virtual hard disk. diff --git a/lib/services/computeManagement2/lib/models/oSDiskImage.js b/lib/services/computeManagement2/lib/models/oSDiskImage.js index 326ebcf54d..2bcee145f2 100644 --- a/lib/services/computeManagement2/lib/models/oSDiskImage.js +++ b/lib/services/computeManagement2/lib/models/oSDiskImage.js @@ -15,7 +15,8 @@ * Initializes a new instance of the OSDiskImage class. * @constructor * Contains the os disk image information. - * @member {string} operatingSystem the operating system of the osDiskImage. + * + * @member {string} operatingSystem The operating system of the osDiskImage. * Possible values include: 'Windows', 'Linux' * */ diff --git a/lib/services/computeManagement2/lib/models/oSProfile.js b/lib/services/computeManagement2/lib/models/oSProfile.js index e36cef3bcb..45c4d51cad 100644 --- a/lib/services/computeManagement2/lib/models/oSProfile.js +++ b/lib/services/computeManagement2/lib/models/oSProfile.js @@ -19,46 +19,54 @@ var util = require('util'); * Initializes a new instance of the OSProfile class. * @constructor * Describes an OS profile. - * @member {string} [computerName] the computer name. + * + * @member {string} [computerName] Specifies the host OS name of the virtual + * machine. * - * @member {string} [adminUsername] the admin user name. + * @member {string} [adminUsername] Specifies the name of the administrator + * account. * - * @member {string} [adminPassword] the admin user password. + * @member {string} [adminPassword] Specifies the password of the + * administrator account. * - * @member {string} [customData] a base-64 encoded string of custom data. + * @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 * * @member {object} [windowsConfiguration] the Windows Configuration of the OS * profile. * - * @member {boolean} [windowsConfiguration.provisionVMAgent] whether VM Agent - * should be provisioned on the Virtual Machine. + * @member {boolean} [windowsConfiguration.provisionVMAgent] Indicates whether + * the virtual machine agent should be provisioned on the Virtual Machine. If + * not specified, then the default behavior is to set it to true. * - * @member {boolean} [windowsConfiguration.enableAutomaticUpdates] whether - * Windows updates are automatically installed on the VM + * @member {boolean} [windowsConfiguration.enableAutomaticUpdates] Indicates + * whether Windows updates are automatically installed on the VM. * - * @member {string} [windowsConfiguration.timeZone] the Time Zone of the VM + * @member {string} [windowsConfiguration.timeZone] The Time Zone of the VM * - * @member {array} [windowsConfiguration.additionalUnattendContent] the - * additional base-64 encoded XML formatted information that can be included - * in the Unattend.xml file. + * @member {array} [windowsConfiguration.additionalUnattendContent] Additional + * base-64 encoded XML formatted information that can be included in the + * Unattend.xml file. * - * @member {object} [windowsConfiguration.winRM] the Windows Remote Management + * @member {object} [windowsConfiguration.winRM] The Windows Remote Management * configuration of the VM * - * @member {array} [windowsConfiguration.winRM.listeners] the list of Windows + * @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] - * whether Authentication using user name and password is allowed or not + * Specifies whether password authentication should be disabled. * - * @member {object} [linuxConfiguration.ssh] the SSH configuration for linux - * VMs + * @member {object} [linuxConfiguration.ssh] The SSH configuration for linux + * VMs. * - * @member {array} [linuxConfiguration.ssh.publicKeys] the list of SSH public - * keys used to authenticate with linux based VMs + * @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. * diff --git a/lib/services/computeManagement2/lib/models/plan.js b/lib/services/computeManagement2/lib/models/plan.js index 56e220b101..ad8c526069 100644 --- a/lib/services/computeManagement2/lib/models/plan.js +++ b/lib/services/computeManagement2/lib/models/plan.js @@ -15,6 +15,7 @@ * Initializes a new instance of the Plan class. * @constructor * Plan for the resource. + * * @member {string} [name] the plan ID. * * @member {string} [publisher] the publisher ID. diff --git a/lib/services/computeManagement2/lib/models/purchasePlan.js b/lib/services/computeManagement2/lib/models/purchasePlan.js index 0ca017c363..668b934da1 100644 --- a/lib/services/computeManagement2/lib/models/purchasePlan.js +++ b/lib/services/computeManagement2/lib/models/purchasePlan.js @@ -16,6 +16,7 @@ * @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. diff --git a/lib/services/computeManagement2/lib/models/resource.js b/lib/services/computeManagement2/lib/models/resource.js index 13827d365a..eea1a3ae3c 100644 --- a/lib/services/computeManagement2/lib/models/resource.js +++ b/lib/services/computeManagement2/lib/models/resource.js @@ -18,15 +18,17 @@ var util = require('util'); * @class * Initializes a new instance of the Resource class. * @constructor - * @member {string} [id] Resource Id + * The resource model definition. + * + * @member {string} [id] Resource ID. * - * @member {string} [name] Resource name + * @member {string} [name] Resource name. * - * @member {string} [type] Resource type + * @member {string} [type] Resource type. * - * @member {string} location Resource location + * @member {string} location Resource location. * - * @member {object} [tags] Resource tags + * @member {object} [tags] Resource tags. * */ function Resource() { diff --git a/lib/services/computeManagement2/lib/models/sku.js b/lib/services/computeManagement2/lib/models/sku.js index cc15aa2c8c..ef399e9b44 100644 --- a/lib/services/computeManagement2/lib/models/sku.js +++ b/lib/services/computeManagement2/lib/models/sku.js @@ -15,9 +15,10 @@ * Initializes a new instance of the Sku class. * @constructor * Describes a virtual machine scale set sku. - * @member {string} [name] the sku name. + * + * @member {string} [name] The sku name. * - * @member {string} [tier] the sku tier. + * @member {string} [tier] The sku tier. * * @member {number} [capacity] the sku capacity. * diff --git a/lib/services/computeManagement2/lib/models/sshConfiguration.js b/lib/services/computeManagement2/lib/models/sshConfiguration.js index 2a51c2f199..4646a5324f 100644 --- a/lib/services/computeManagement2/lib/models/sshConfiguration.js +++ b/lib/services/computeManagement2/lib/models/sshConfiguration.js @@ -19,8 +19,9 @@ var util = require('util'); * 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 + * + * @member {array} [publicKeys] The list of SSH public keys used to + * authenticate with linux based VMs. * */ function SshConfiguration() { diff --git a/lib/services/computeManagement2/lib/models/sshPublicKey.js b/lib/services/computeManagement2/lib/models/sshPublicKey.js index 16ea6ac6de..f453e2313b 100644 --- a/lib/services/computeManagement2/lib/models/sshPublicKey.js +++ b/lib/services/computeManagement2/lib/models/sshPublicKey.js @@ -16,12 +16,13 @@ * @constructor * Contains information about SSH certificate public key and the path on the * Linux VM where the public key is placed. - * @member {string} [path] 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. + * + * @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. * - * @member {string} [keyData] Certificate public key used to authenticate with - * VM through SSH.The certificate must be in Pem format with or without + * @member {string} [keyData] Certificate public key used to authenticate to + * the VM through SSH. The certificate must be in Pem format with or without * headers. * */ diff --git a/lib/services/computeManagement2/lib/models/storageProfile.js b/lib/services/computeManagement2/lib/models/storageProfile.js index 691098fb4c..557accfaee 100644 --- a/lib/services/computeManagement2/lib/models/storageProfile.js +++ b/lib/services/computeManagement2/lib/models/storageProfile.js @@ -19,19 +19,20 @@ var util = require('util'); * Initializes a new instance of the StorageProfile class. * @constructor * Describes a storage profile. - * @member {object} [imageReference] the image reference. + * + * @member {object} [imageReference] The image reference. * - * @member {string} [imageReference.publisher] the image publisher. + * @member {string} [imageReference.publisher] The image publisher. * - * @member {string} [imageReference.offer] the image offer. + * @member {string} [imageReference.offer] The image offer. * - * @member {string} [imageReference.sku] the image sku. + * @member {string} [imageReference.sku] The image SKU. * - * @member {string} [imageReference.version] the image version. The allowed + * @member {string} [imageReference.version] The image version. The allowed * formats are Major.Minor.Build or 'latest'. Major, Minor and Build being - * decimal numbers. Specify 'latest' to use the latest version of image. + * decimal numbers. Specify 'latest' to use the latest version of the image. * - * @member {object} [osDisk] the OS disk. + * @member {object} [osDisk] The OS disk. * * @member {string} [osDisk.osType] the Operating System type. Possible values * include: 'Windows', 'Linux' @@ -74,8 +75,8 @@ var util = require('util'); * * @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. + * Machine. If SourceImage is provided, the destination VirtualHardDisk + * should not exist. * * @member {string} [osDisk.image.uri] the virtual hard disk's uri. It should * be a valid Uri to a virtual hard disk. @@ -89,7 +90,7 @@ var util = require('util'); * @member {number} [osDisk.diskSizeGB] the initial disk size in GB for blank * data disks, and the new desired size for existing OS and Data disks. * - * @member {array} [dataDisks] the data disks. + * @member {array} [dataDisks] The data disks. * */ function StorageProfile() { diff --git a/lib/services/computeManagement2/lib/models/upgradePolicy.js b/lib/services/computeManagement2/lib/models/upgradePolicy.js index 0668f3dcfa..f0968c50bf 100644 --- a/lib/services/computeManagement2/lib/models/upgradePolicy.js +++ b/lib/services/computeManagement2/lib/models/upgradePolicy.js @@ -15,6 +15,7 @@ * Initializes a new instance of the UpgradePolicy class. * @constructor * Describes an upgrade policy - automatic or manual. + * * @member {string} [mode] the upgrade mode. Possible values include: * 'Automatic', 'Manual' * diff --git a/lib/services/computeManagement2/lib/models/usage.js b/lib/services/computeManagement2/lib/models/usage.js index 066fe1fd5e..62763d16b4 100644 --- a/lib/services/computeManagement2/lib/models/usage.js +++ b/lib/services/computeManagement2/lib/models/usage.js @@ -17,6 +17,7 @@ var models = require('./index'); * Initializes a new instance of the Usage class. * @constructor * Describes Compute Resource Usage. + * * @member {number} currentValue the current value of the usage. * * @member {number} limit the limit of usage. diff --git a/lib/services/computeManagement2/lib/models/usageName.js b/lib/services/computeManagement2/lib/models/usageName.js index b83d6a9222..590655a118 100644 --- a/lib/services/computeManagement2/lib/models/usageName.js +++ b/lib/services/computeManagement2/lib/models/usageName.js @@ -15,6 +15,7 @@ * Initializes a new instance of the UsageName class. * @constructor * The Usage Names. + * * @member {string} [value] a string describing the resource name. * * @member {string} [localizedValue] a localized string describing the diff --git a/lib/services/computeManagement2/lib/models/vaultCertificate.js b/lib/services/computeManagement2/lib/models/vaultCertificate.js index 1fb4e39e38..59e1668c2d 100644 --- a/lib/services/computeManagement2/lib/models/vaultCertificate.js +++ b/lib/services/computeManagement2/lib/models/vaultCertificate.js @@ -16,10 +16,11 @@ * @constructor * Describes a single certificate reference in a Key Vault, and where the * certificate should reside on the VM. - * @member {string} [certificateUrl] the URL referencing a secret in a Key + * + * @member {string} [certificateUrl] The URL referencing a secret in a Key * Vault which contains a properly formatted certificate. * - * @member {string} [certificateStore] the Certificate store in LocalMachine + * @member {string} [certificateStore] The Certificate store in LocalMachine * to add the certificate to on Windows, leave empty on Linux. * */ diff --git a/lib/services/computeManagement2/lib/models/vaultSecretGroup.js b/lib/services/computeManagement2/lib/models/vaultSecretGroup.js index 21fbcd29a1..9da8cbb166 100644 --- a/lib/services/computeManagement2/lib/models/vaultSecretGroup.js +++ b/lib/services/computeManagement2/lib/models/vaultSecretGroup.js @@ -19,13 +19,14 @@ var util = require('util'); * 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 + * + * @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 + * @member {array} [vaultCertificates] The list of key vault references in + * SourceVault which contain certificates. * */ function VaultSecretGroup() { diff --git a/lib/services/computeManagement2/lib/models/virtualHardDisk.js b/lib/services/computeManagement2/lib/models/virtualHardDisk.js index 69cfa96821..51bfe0a594 100644 --- a/lib/services/computeManagement2/lib/models/virtualHardDisk.js +++ b/lib/services/computeManagement2/lib/models/virtualHardDisk.js @@ -15,6 +15,7 @@ * Initializes a new instance of the VirtualHardDisk class. * @constructor * Describes the uri of a disk. + * * @member {string} [uri] the virtual hard disk's uri. It should be a valid * Uri to a virtual hard disk. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachine.js b/lib/services/computeManagement2/lib/models/virtualMachine.js index 0533128b9e..32a11ce6cf 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachine.js +++ b/lib/services/computeManagement2/lib/models/virtualMachine.js @@ -19,7 +19,8 @@ var util = require('util'); * Initializes a new instance of the VirtualMachine class. * @constructor * Describes a Virtual Machine. - * @member {object} [plan] the purchase plan when deploying virtual machine + * + * @member {object} [plan] The purchase plan when deploying virtual machine * from VM Marketplace images. * * @member {string} [plan.name] the plan ID. @@ -30,7 +31,7 @@ var util = require('util'); * * @member {string} [plan.promotionCode] the promotion code. * - * @member {object} [hardwareProfile] the hardware profile. + * @member {object} [hardwareProfile] The hardware profile. * * @member {string} [hardwareProfile.vmSize] The virtual machine size name. * Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', @@ -50,23 +51,23 @@ var util = require('util'); * 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5' * - * @member {object} [storageProfile] the storage profile. + * @member {object} [storageProfile] The storage profile. * - * @member {object} [storageProfile.imageReference] the image reference. + * @member {object} [storageProfile.imageReference] The image reference. * - * @member {string} [storageProfile.imageReference.publisher] the image + * @member {string} [storageProfile.imageReference.publisher] The image * publisher. * - * @member {string} [storageProfile.imageReference.offer] the image offer. + * @member {string} [storageProfile.imageReference.offer] The image offer. * - * @member {string} [storageProfile.imageReference.sku] the image sku. + * @member {string} [storageProfile.imageReference.sku] The image SKU. * - * @member {string} [storageProfile.imageReference.version] the image version. + * @member {string} [storageProfile.imageReference.version] The image version. * The allowed formats are Major.Minor.Build or 'latest'. Major, Minor and * Build being decimal numbers. Specify 'latest' to use the latest version of - * image. + * the image. * - * @member {object} [storageProfile.osDisk] the OS disk. + * @member {object} [storageProfile.osDisk] The OS disk. * * @member {string} [storageProfile.osDisk.osType] the Operating System type. * Possible values include: 'Windows', 'Linux' @@ -118,7 +119,7 @@ var util = require('util'); * * @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 + * attach to the Virtual Machine. If SourceImage is provided, the destination * VirtualHardDisk should not exist. * * @member {string} [storageProfile.osDisk.image.uri] the virtual hard disk's @@ -134,99 +135,111 @@ var util = require('util'); * in GB for blank data disks, and the new desired size for existing OS and * Data disks. * - * @member {array} [storageProfile.dataDisks] the data disks. + * @member {array} [storageProfile.dataDisks] The data disks. * - * @member {object} [osProfile] the OS profile. + * @member {object} [osProfile] The OS profile. * - * @member {string} [osProfile.computerName] the computer name. + * @member {string} [osProfile.computerName] Specifies the host OS name of the + * virtual machine. * - * @member {string} [osProfile.adminUsername] the admin user name. + * @member {string} [osProfile.adminUsername] Specifies the name of the + * administrator account. * - * @member {string} [osProfile.adminPassword] the admin user password. + * @member {string} [osProfile.adminPassword] Specifies the password of the + * administrator account. * - * @member {string} [osProfile.customData] a base-64 encoded string of custom - * data. + * @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 * * @member {object} [osProfile.windowsConfiguration] the Windows Configuration * of the OS profile. * - * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] whether - * VM Agent should be provisioned on the Virtual Machine. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether the virtual machine agent should be provisioned on the + * Virtual Machine. If not specified, then the default behavior is to set it + * to true. * * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] - * whether Windows updates are automatically installed on the VM + * Indicates whether Windows updates are automatically installed on the VM. * - * @member {string} [osProfile.windowsConfiguration.timeZone] the Time Zone of + * @member {string} [osProfile.windowsConfiguration.timeZone] The Time Zone of * the VM * * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] - * the additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file. + * Additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file. * - * @member {object} [osProfile.windowsConfiguration.winRM] the Windows Remote + * @member {object} [osProfile.windowsConfiguration.winRM] The Windows Remote * Management configuration of the VM * - * @member {array} [osProfile.windowsConfiguration.winRM.listeners] the list + * @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] whether - * Authentication using user name and password is allowed or not + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. * - * @member {object} [osProfile.linuxConfiguration.ssh] the SSH configuration - * for linux VMs + * @member {object} [osProfile.linuxConfiguration.ssh] The SSH configuration + * for linux VMs. * - * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] the list of - * SSH public keys used to authenticate with linux based VMs + * @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} [networkProfile] the network profile. + * @member {object} [networkProfile] The network profile. * - * @member {array} [networkProfile.networkInterfaces] the network interfaces. + * @member {array} [networkProfile.networkInterfaces] Specifies the list of + * resource Ids for the network interfaces associated with the virtual + * machine. * - * @member {object} [diagnosticsProfile] the diagnostics profile. + * @member {object} [diagnosticsProfile] The diagnostics profile. * - * @member {object} [diagnosticsProfile.bootDiagnostics] the boot diagnostics. + * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows the user to view console output and/or a + * screenshot of the virtual machine from the hypervisor. * - * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] whether boot + * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether boot * diagnostics should be enabled on the Virtual Machine. * - * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] the boot - * diagnostics storage Uri. It should be a valid Uri + * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] URI of the + * storage account to use for placing the console output and screenshot. * - * @member {object} [availabilitySet] the reference Id of the availability set - * to which this virtual machine belongs. + * @member {object} [availabilitySet] The reference Id of the availability set + * to which the virtual machine belongs. * * @member {string} [availabilitySet.id] Resource Id * - * @member {string} [provisioningState] the provisioning state, which only + * @member {string} [provisioningState] The provisioning state, which only * appears in the response. * - * @member {object} [instanceView] the virtual machine instance view. + * @member {object} [instanceView] The virtual machine instance view. * - * @member {number} [instanceView.platformUpdateDomain] the Update Domain - * count. + * @member {number} [instanceView.platformUpdateDomain] Specifies the update + * domain of the virtual machine. * - * @member {number} [instanceView.platformFaultDomain] the Fault Domain count. + * @member {number} [instanceView.platformFaultDomain] Specifies the fault + * domain of the virtual machine. * - * @member {string} [instanceView.rdpThumbPrint] the Remote desktop + * @member {string} [instanceView.rdpThumbPrint] The Remote desktop * certificate thumbprint. * - * @member {object} [instanceView.vmAgent] the VM Agent running on the virtual + * @member {object} [instanceView.vmAgent] The VM Agent running on the virtual * machine. * - * @member {string} [instanceView.vmAgent.vmAgentVersion] the VM Agent full + * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full * version. * - * @member {array} [instanceView.vmAgent.extensionHandlers] the virtual + * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual * machine extension handler instance view. * - * @member {array} [instanceView.vmAgent.statuses] the resource status + * @member {array} [instanceView.vmAgent.statuses] The resource status * information. * * @member {array} [instanceView.disks] the disks information. @@ -236,17 +249,20 @@ var util = require('util'); * @member {object} [instanceView.bootDiagnostics] the boot diagnostics. * * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] - * the console screenshot blob Uri. + * The console screenshot blob URI. * - * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] the + * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] The * Linux serial console log blob Uri. * * @member {array} [instanceView.statuses] the resource status information. * - * @member {string} [licenseType] the license type, which is for bring your - * own license scenario. + * @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. * - * @member {string} [vmId] the virtual machine unique id. + * @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. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineAgentInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineAgentInstanceView.js index 2a38494d67..6efbec8b92 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineAgentInstanceView.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineAgentInstanceView.js @@ -19,12 +19,13 @@ var util = require('util'); * 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 {string} [vmAgentVersion] The VM Agent full version. * - * @member {array} [extensionHandlers] the virtual machine extension handler + * @member {array} [extensionHandlers] The virtual machine extension handler * instance view. * - * @member {array} [statuses] the resource status information. + * @member {array} [statuses] The resource status information. * */ function VirtualMachineAgentInstanceView() { diff --git a/lib/services/computeManagement2/lib/models/virtualMachineCaptureParameters.js b/lib/services/computeManagement2/lib/models/virtualMachineCaptureParameters.js index 8a664aec87..1ad247a3a1 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineCaptureParameters.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineCaptureParameters.js @@ -15,6 +15,7 @@ * Initializes a new instance of the VirtualMachineCaptureParameters class. * @constructor * Capture Virtual Machine parameters. + * * @member {string} vhdPrefix the captured VirtualHardDisk's name prefix. * * @member {string} destinationContainerName the destination container name. diff --git a/lib/services/computeManagement2/lib/models/virtualMachineCaptureResult.js b/lib/services/computeManagement2/lib/models/virtualMachineCaptureResult.js index 743f0e1884..153455b50d 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineCaptureResult.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineCaptureResult.js @@ -19,6 +19,7 @@ var util = require('util'); * Initializes a new instance of the VirtualMachineCaptureResult class. * @constructor * Resource Id. + * * @member {object} [output] Operation output data (raw JSON) * */ diff --git a/lib/services/computeManagement2/lib/models/virtualMachineExtension.js b/lib/services/computeManagement2/lib/models/virtualMachineExtension.js index d0c6489749..d923979492 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineExtension.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineExtension.js @@ -19,6 +19,7 @@ var util = require('util'); * 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. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineExtensionHandlerInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineExtensionHandlerInstanceView.js index 8bfb98a027..8dff7a2940 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineExtensionHandlerInstanceView.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineExtensionHandlerInstanceView.js @@ -17,6 +17,7 @@ var models = require('./index'); * Initializes a new instance of the VirtualMachineExtensionHandlerInstanceView class. * @constructor * The instance view of a virtual machine extension handler. + * * @member {string} [type] full type of the extension handler which includes * both publisher and type. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineExtensionImage.js b/lib/services/computeManagement2/lib/models/virtualMachineExtensionImage.js index 88a8f50468..b5326d615d 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineExtensionImage.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineExtensionImage.js @@ -19,6 +19,7 @@ var util = require('util'); * Initializes a new instance of the VirtualMachineExtensionImage class. * @constructor * Describes a Virtual Machine Extension Image. + * * @member {string} operatingSystem the operating system this extension * supports. * @@ -29,7 +30,7 @@ var util = require('util'); * 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, + * 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. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineExtensionInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineExtensionInstanceView.js index 83f6cce298..7a0fe46892 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineExtensionInstanceView.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineExtensionInstanceView.js @@ -19,6 +19,7 @@ var util = require('util'); * 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] the full type of the extension handler which diff --git a/lib/services/computeManagement2/lib/models/virtualMachineImage.js b/lib/services/computeManagement2/lib/models/virtualMachineImage.js index facd274673..4999fede41 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineImage.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineImage.js @@ -19,6 +19,7 @@ var util = require('util'); * Initializes a new instance of the VirtualMachineImage class. * @constructor * Describes a Virtual Machine Image. + * * @member {object} [plan] * * @member {string} [plan.publisher] the publisher ID. @@ -29,7 +30,7 @@ var util = require('util'); * * @member {object} [osDiskImage] * - * @member {string} [osDiskImage.operatingSystem] the operating system of the + * @member {string} [osDiskImage.operatingSystem] The operating system of the * osDiskImage. Possible values include: 'Windows', 'Linux' * * @member {array} [dataDiskImages] diff --git a/lib/services/computeManagement2/lib/models/virtualMachineImageResource.js b/lib/services/computeManagement2/lib/models/virtualMachineImageResource.js index 9d55bee02f..6b08d2eb7f 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineImageResource.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineImageResource.js @@ -19,11 +19,12 @@ var util = require('util'); * Initializes a new instance of the VirtualMachineImageResource class. * @constructor * Virtual machine image resource information. - * @member {string} name the name of the resource. + * + * @member {string} name The name of the resource. * - * @member {string} location the location of the resource. + * @member {string} location The supported Azure location of the resource. * - * @member {object} [tags] the tags attached to the resource. + * @member {object} [tags] The tags attached to the resource. * */ function VirtualMachineImageResource() { diff --git a/lib/services/computeManagement2/lib/models/virtualMachineInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineInstanceView.js index 1212c54b92..4e41b52b17 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineInstanceView.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineInstanceView.js @@ -19,20 +19,23 @@ var util = require('util'); * Initializes a new instance of the VirtualMachineInstanceView class. * @constructor * The instance view of a virtual machine. - * @member {number} [platformUpdateDomain] the Update Domain count. + * + * @member {number} [platformUpdateDomain] Specifies the update domain of the + * virtual machine. * - * @member {number} [platformFaultDomain] the Fault Domain count. + * @member {number} [platformFaultDomain] Specifies the fault domain of the + * virtual machine. * - * @member {string} [rdpThumbPrint] the Remote desktop certificate thumbprint. + * @member {string} [rdpThumbPrint] The Remote desktop certificate thumbprint. * - * @member {object} [vmAgent] the VM Agent running on the virtual machine. + * @member {object} [vmAgent] The VM Agent running on the virtual machine. * - * @member {string} [vmAgent.vmAgentVersion] the VM Agent full version. + * @member {string} [vmAgent.vmAgentVersion] The VM Agent full version. * - * @member {array} [vmAgent.extensionHandlers] the virtual machine extension + * @member {array} [vmAgent.extensionHandlers] The virtual machine extension * handler instance view. * - * @member {array} [vmAgent.statuses] the resource status information. + * @member {array} [vmAgent.statuses] The resource status information. * * @member {array} [disks] the disks information. * @@ -40,10 +43,10 @@ var util = require('util'); * * @member {object} [bootDiagnostics] the boot diagnostics. * - * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] the console - * screenshot blob Uri. + * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console + * screenshot blob URI. * - * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] the Linux serial + * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] The Linux serial * console log blob Uri. * * @member {array} [statuses] the resource status information. diff --git a/lib/services/computeManagement2/lib/models/virtualMachineListResult.js b/lib/services/computeManagement2/lib/models/virtualMachineListResult.js index f386b013e0..6c970a532d 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineListResult.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineListResult.js @@ -17,9 +17,8 @@ var util = require('util'); * Initializes a new instance of the VirtualMachineListResult class. * @constructor * The List Virtual Machine operation response. - * @member {array} [value] the list of virtual machines. - * - * @member {string} [nextLink] the uri to fetch the next page of VMs. Call + * + * @member {string} [nextLink] The URI to fetch the next page of VMs. Call * ListNext() with this to fetch the next page of Virtual Machines. * */ @@ -43,7 +42,7 @@ VirtualMachineListResult.prototype.mapper = function () { className: 'VirtualMachineListResult', modelProperties: { value: { - required: false, + required: true, serializedName: '', type: { name: 'Sequence', diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js index ebf07dbae3..b61ffba3ed 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js @@ -19,11 +19,12 @@ var util = require('util'); * 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.name] The sku name. * - * @member {string} [sku.tier] the sku tier. + * @member {string} [sku.tier] The sku tier. * * @member {number} [sku.capacity] the sku capacity. * @@ -54,27 +55,29 @@ var util = require('util'); * * @member {boolean} * [virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] - * whether VM Agent should be provisioned on the Virtual Machine. + * Indicates whether the virtual machine agent should be provisioned on the + * Virtual Machine. If not specified, then the default behavior is to set it + * to true. * * @member {boolean} * [virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] - * whether Windows updates are automatically installed on the VM + * Indicates whether Windows updates are automatically installed on the VM. * * @member {string} - * [virtualMachineProfile.osProfile.windowsConfiguration.timeZone] the Time + * [virtualMachineProfile.osProfile.windowsConfiguration.timeZone] The Time * Zone of the VM * * @member {array} * [virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] - * the additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file. + * Additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file. * * @member {object} - * [virtualMachineProfile.osProfile.windowsConfiguration.winRM] the Windows + * [virtualMachineProfile.osProfile.windowsConfiguration.winRM] The Windows * Remote Management configuration of the VM * * @member {array} - * [virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] the + * [virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] The * list of Windows Remote Management listeners * * @member {object} [virtualMachineProfile.osProfile.linuxConfiguration] the @@ -82,14 +85,14 @@ var util = require('util'); * * @member {boolean} * [virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] - * whether Authentication using user name and password is allowed or not + * Specifies whether password authentication should be disabled. * * @member {object} [virtualMachineProfile.osProfile.linuxConfiguration.ssh] - * the SSH configuration for linux VMs + * The SSH configuration for linux VMs. * * @member {array} - * [virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] the - * list of SSH public keys used to authenticate with linux based VMs + * [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. @@ -101,21 +104,21 @@ var util = require('util'); * image reference. * * @member {string} - * [virtualMachineProfile.storageProfile.imageReference.publisher] the image + * [virtualMachineProfile.storageProfile.imageReference.publisher] The image * publisher. * * @member {string} - * [virtualMachineProfile.storageProfile.imageReference.offer] the image + * [virtualMachineProfile.storageProfile.imageReference.offer] The image * offer. * * @member {string} [virtualMachineProfile.storageProfile.imageReference.sku] - * the image sku. + * The image SKU. * * @member {string} - * [virtualMachineProfile.storageProfile.imageReference.version] the image + * [virtualMachineProfile.storageProfile.imageReference.version] The image * version. The allowed formats are Major.Minor.Build or 'latest'. Major, * Minor and Build being decimal numbers. Specify 'latest' to use the latest - * version of image. + * version of the image. * * @member {object} [virtualMachineProfile.storageProfile.osDisk] the OS disk. * @@ -133,7 +136,7 @@ var util = require('util'); * * @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 + * 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] @@ -159,7 +162,7 @@ var util = require('util'); * @member {string} [provisioningState] the provisioning state, which only * appears in the response. * - * @member {boolean} [overProvision] Specifies whether the Virtual Machine + * @member {boolean} [overprovision] Specifies whether the Virtual Machine * Scale Set should be overprovisioned. * */ @@ -260,9 +263,9 @@ VirtualMachineScaleSet.prototype.mapper = function () { name: 'String' } }, - overProvision: { + overprovision: { required: false, - serializedName: 'properties.overProvision', + serializedName: 'properties.overprovision', type: { name: 'Boolean' } diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtension.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtension.js index 215b3fa3bc..649e240d7f 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtension.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtension.js @@ -19,6 +19,7 @@ var util = require('util'); * 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} [publisher] the name of the extension handler publisher. diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtensionProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtensionProfile.js index b212874af9..e687eb4f1f 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtensionProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtensionProfile.js @@ -19,6 +19,7 @@ var util = require('util'); * 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. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIPConfiguration.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIPConfiguration.js index 07fe1d98cd..2b12a27811 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIPConfiguration.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIPConfiguration.js @@ -19,6 +19,7 @@ var util = require('util'); * 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 the subnet. diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceView.js index 88db701ab5..9579de6493 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceView.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceView.js @@ -19,6 +19,7 @@ var util = require('util'); * 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. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js index e9b2b2c87c..d010800057 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js @@ -20,6 +20,7 @@ var util = require('util'); * @constructor * Instance view statuses summary for virtual machines of a virtual machine * scale set. + * * @member {array} [statusesSummary] the extensions information. * */ diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListResult.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListResult.js index 081472e7bc..3346074ba2 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListResult.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListResult.js @@ -17,8 +17,7 @@ var util = require('util'); * Initializes a new instance of the VirtualMachineScaleSetListResult class. * @constructor * The List Virtual Machine operation response. - * @member {array} [value] the list of virtual machine scale sets. - * + * * @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. @@ -44,7 +43,7 @@ VirtualMachineScaleSetListResult.prototype.mapper = function () { className: 'VirtualMachineScaleSetListResult', modelProperties: { value: { - required: false, + required: true, serializedName: '', type: { name: 'Sequence', diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListSkusResult.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListSkusResult.js index b6662f24ca..490279b4c6 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListSkusResult.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListSkusResult.js @@ -17,9 +17,7 @@ var util = require('util'); * Initializes a new instance of the VirtualMachineScaleSetListSkusResult class. * @constructor * The Virtual Machine Scale Set List Skus operation response. - * @member {array} [value] the list of skus available for the virtual machine - * scale set. - * + * * @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. @@ -45,8 +43,7 @@ VirtualMachineScaleSetListSkusResult.prototype.mapper = function () { className: 'VirtualMachineScaleSetListSkusResult', modelProperties: { value: { - required: false, - readOnly: true, + required: true, serializedName: '', type: { name: 'Sequence', diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListWithLinkResult.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListWithLinkResult.js index 05c2d90a30..8aa5bd09ba 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListWithLinkResult.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListWithLinkResult.js @@ -17,8 +17,7 @@ var util = require('util'); * Initializes a new instance of the VirtualMachineScaleSetListWithLinkResult class. * @constructor * The List Virtual Machine operation response. - * @member {array} [value] the list of virtual machine scale sets. - * + * * @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. @@ -44,7 +43,7 @@ VirtualMachineScaleSetListWithLinkResult.prototype.mapper = function () { className: 'VirtualMachineScaleSetListWithLinkResult', modelProperties: { value: { - required: false, + required: true, serializedName: '', type: { name: 'Sequence', diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkConfiguration.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkConfiguration.js index 4d0f9f9561..b77f7a03f5 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkConfiguration.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkConfiguration.js @@ -20,6 +20,7 @@ var util = require('util'); * @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 diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkProfile.js index 5e8491ecbc..ad0ea6a4c7 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkProfile.js @@ -19,6 +19,7 @@ var util = require('util'); * Initializes a new instance of the VirtualMachineScaleSetNetworkProfile class. * @constructor * Describes a virtual machine scale set network profile. + * * @member {array} [networkInterfaceConfigurations] the list of network * configurations. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js index ad1191b20d..29f6b0028a 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js @@ -19,6 +19,7 @@ var util = require('util'); * 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] the caching type. Possible values include: @@ -32,8 +33,8 @@ var util = require('util'); * * @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. + * Machine. If SourceImage is provided, the destination VirtualHardDisk + * should not exist. * * @member {string} [image.uri] the virtual hard disk's uri. It should be a * valid Uri to a virtual hard disk. diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSProfile.js index 07a8561e64..79acce8c44 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSProfile.js @@ -19,6 +19,7 @@ var util = require('util'); * Initializes a new instance of the VirtualMachineScaleSetOSProfile class. * @constructor * Describes a virtual machine scale set OS profile. + * * @member {string} [computerNamePrefix] the computer name prefix. * * @member {string} [adminUsername] the admin user name. @@ -30,35 +31,36 @@ var util = require('util'); * @member {object} [windowsConfiguration] the Windows Configuration of the OS * profile. * - * @member {boolean} [windowsConfiguration.provisionVMAgent] whether VM Agent - * should be provisioned on the Virtual Machine. + * @member {boolean} [windowsConfiguration.provisionVMAgent] Indicates whether + * the virtual machine agent should be provisioned on the Virtual Machine. If + * not specified, then the default behavior is to set it to true. * - * @member {boolean} [windowsConfiguration.enableAutomaticUpdates] whether - * Windows updates are automatically installed on the VM + * @member {boolean} [windowsConfiguration.enableAutomaticUpdates] Indicates + * whether Windows updates are automatically installed on the VM. * - * @member {string} [windowsConfiguration.timeZone] the Time Zone of the VM + * @member {string} [windowsConfiguration.timeZone] The Time Zone of the VM * - * @member {array} [windowsConfiguration.additionalUnattendContent] the - * additional base-64 encoded XML formatted information that can be included - * in the Unattend.xml file. + * @member {array} [windowsConfiguration.additionalUnattendContent] Additional + * base-64 encoded XML formatted information that can be included in the + * Unattend.xml file. * - * @member {object} [windowsConfiguration.winRM] the Windows Remote Management + * @member {object} [windowsConfiguration.winRM] The Windows Remote Management * configuration of the VM * - * @member {array} [windowsConfiguration.winRM.listeners] the list of Windows + * @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] - * whether Authentication using user name and password is allowed or not + * Specifies whether password authentication should be disabled. * - * @member {object} [linuxConfiguration.ssh] the SSH configuration for linux - * VMs + * @member {object} [linuxConfiguration.ssh] The SSH configuration for linux + * VMs. * - * @member {array} [linuxConfiguration.ssh.publicKeys] the list of SSH public - * keys used to authenticate with linux based VMs + * @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. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSku.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSku.js index 9fa9a07b98..3c742d3ef6 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSku.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSku.js @@ -17,13 +17,14 @@ var models = require('./index'); * 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.name] The sku name. * - * @member {string} [sku.tier] the sku tier. + * @member {string} [sku.tier] The sku tier. * * @member {number} [sku.capacity] the sku capacity. * diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSkuCapacity.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSkuCapacity.js index bfd6c052b0..443e15dc61 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSkuCapacity.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSkuCapacity.js @@ -15,6 +15,7 @@ * 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. diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js index 35d16fed0e..489f6a5b94 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js @@ -17,17 +17,18 @@ var models = require('./index'); * Initializes a new instance of the VirtualMachineScaleSetStorageProfile 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.publisher] The image publisher. * - * @member {string} [imageReference.offer] the image offer. + * @member {string} [imageReference.offer] The image offer. * - * @member {string} [imageReference.sku] the image sku. + * @member {string} [imageReference.sku] The image SKU. * - * @member {string} [imageReference.version] the image version. The allowed + * @member {string} [imageReference.version] The image version. The allowed * formats are Major.Minor.Build or 'latest'. Major, Minor and Build being - * decimal numbers. Specify 'latest' to use the latest version of image. + * decimal numbers. Specify 'latest' to use the latest version of the image. * * @member {object} [osDisk] the OS disk. * @@ -44,8 +45,8 @@ var models = require('./index'); * * @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. + * Machine. If SourceImage is provided, the destination VirtualHardDisk + * should not exist. * * @member {string} [osDisk.image.uri] the virtual hard disk's uri. It should * be a valid Uri to a virtual hard disk. diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js index d9e67f7c0e..66ea3f6264 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js @@ -19,13 +19,14 @@ var util = require('util'); * 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 {string} [instanceId] The virtual machine instance ID. * - * @member {object} [sku] the virtual machine sku. + * @member {object} [sku] The virtual machine SKU. * - * @member {string} [sku.name] the sku name. + * @member {string} [sku.name] The sku name. * - * @member {string} [sku.tier] the sku tier. + * @member {string} [sku.tier] The sku tier. * * @member {number} [sku.capacity] the sku capacity. * @@ -34,24 +35,25 @@ var util = require('util'); * * @member {object} [instanceView] the virtual machine instance view. * - * @member {number} [instanceView.platformUpdateDomain] the Update Domain - * count. + * @member {number} [instanceView.platformUpdateDomain] Specifies the update + * domain of the virtual machine. * - * @member {number} [instanceView.platformFaultDomain] the Fault Domain count. + * @member {number} [instanceView.platformFaultDomain] Specifies the fault + * domain of the virtual machine. * - * @member {string} [instanceView.rdpThumbPrint] the Remote desktop + * @member {string} [instanceView.rdpThumbPrint] The Remote desktop * certificate thumbprint. * - * @member {object} [instanceView.vmAgent] the VM Agent running on the virtual + * @member {object} [instanceView.vmAgent] The VM Agent running on the virtual * machine. * - * @member {string} [instanceView.vmAgent.vmAgentVersion] the VM Agent full + * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full * version. * - * @member {array} [instanceView.vmAgent.extensionHandlers] the virtual + * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual * machine extension handler instance view. * - * @member {array} [instanceView.vmAgent.statuses] the resource status + * @member {array} [instanceView.vmAgent.statuses] The resource status * information. * * @member {array} [instanceView.disks] the disks information. @@ -61,9 +63,9 @@ var util = require('util'); * @member {object} [instanceView.bootDiagnostics] the boot diagnostics. * * @member {string} [instanceView.bootDiagnostics.consoleScreenshotBlobUri] - * the console screenshot blob Uri. + * The console screenshot blob URI. * - * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] the + * @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] The * Linux serial console log blob Uri. * * @member {array} [instanceView.statuses] the resource status information. @@ -90,21 +92,21 @@ var util = require('util'); * * @member {object} [storageProfile] the storage profile. * - * @member {object} [storageProfile.imageReference] the image reference. + * @member {object} [storageProfile.imageReference] The image reference. * - * @member {string} [storageProfile.imageReference.publisher] the image + * @member {string} [storageProfile.imageReference.publisher] The image * publisher. * - * @member {string} [storageProfile.imageReference.offer] the image offer. + * @member {string} [storageProfile.imageReference.offer] The image offer. * - * @member {string} [storageProfile.imageReference.sku] the image sku. + * @member {string} [storageProfile.imageReference.sku] The image SKU. * - * @member {string} [storageProfile.imageReference.version] the image version. + * @member {string} [storageProfile.imageReference.version] The image version. * The allowed formats are Major.Minor.Build or 'latest'. Major, Minor and * Build being decimal numbers. Specify 'latest' to use the latest version of - * image. + * the image. * - * @member {object} [storageProfile.osDisk] the OS disk. + * @member {object} [storageProfile.osDisk] The OS disk. * * @member {string} [storageProfile.osDisk.osType] the Operating System type. * Possible values include: 'Windows', 'Linux' @@ -156,7 +158,7 @@ var util = require('util'); * * @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 + * attach to the Virtual Machine. If SourceImage is provided, the destination * VirtualHardDisk should not exist. * * @member {string} [storageProfile.osDisk.image.uri] the virtual hard disk's @@ -172,70 +174,81 @@ var util = require('util'); * in GB for blank data disks, and the new desired size for existing OS and * Data disks. * - * @member {array} [storageProfile.dataDisks] the data disks. + * @member {array} [storageProfile.dataDisks] The data disks. * * @member {object} [osProfile] the OS profile. * - * @member {string} [osProfile.computerName] the computer name. + * @member {string} [osProfile.computerName] Specifies the host OS name of the + * virtual machine. * - * @member {string} [osProfile.adminUsername] the admin user name. + * @member {string} [osProfile.adminUsername] Specifies the name of the + * administrator account. * - * @member {string} [osProfile.adminPassword] the admin user password. + * @member {string} [osProfile.adminPassword] Specifies the password of the + * administrator account. * - * @member {string} [osProfile.customData] a base-64 encoded string of custom - * data. + * @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 * * @member {object} [osProfile.windowsConfiguration] the Windows Configuration * of the OS profile. * - * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] whether - * VM Agent should be provisioned on the Virtual Machine. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether the virtual machine agent should be provisioned on the + * Virtual Machine. If not specified, then the default behavior is to set it + * to true. * * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] - * whether Windows updates are automatically installed on the VM + * Indicates whether Windows updates are automatically installed on the VM. * - * @member {string} [osProfile.windowsConfiguration.timeZone] the Time Zone of + * @member {string} [osProfile.windowsConfiguration.timeZone] The Time Zone of * the VM * * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] - * the additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file. + * Additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file. * - * @member {object} [osProfile.windowsConfiguration.winRM] the Windows Remote + * @member {object} [osProfile.windowsConfiguration.winRM] The Windows Remote * Management configuration of the VM * - * @member {array} [osProfile.windowsConfiguration.winRM.listeners] the list + * @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] whether - * Authentication using user name and password is allowed or not + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. * - * @member {object} [osProfile.linuxConfiguration.ssh] the SSH configuration - * for linux VMs + * @member {object} [osProfile.linuxConfiguration.ssh] The SSH configuration + * for linux VMs. * - * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] the list of - * SSH public keys used to authenticate with linux based VMs + * @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} [networkProfile] the network profile. * - * @member {array} [networkProfile.networkInterfaces] the network interfaces. + * @member {array} [networkProfile.networkInterfaces] Specifies the list of + * resource Ids for the network interfaces associated with the virtual + * machine. * * @member {object} [diagnosticsProfile] the diagnostics profile. * - * @member {object} [diagnosticsProfile.bootDiagnostics] the boot diagnostics. + * @member {object} [diagnosticsProfile.bootDiagnostics] Boot Diagnostics is a + * debugging feature which allows the user to view console output and/or a + * screenshot of the virtual machine from the hypervisor. * - * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] whether boot + * @member {boolean} [diagnosticsProfile.bootDiagnostics.enabled] Whether boot * diagnostics should be enabled on the Virtual Machine. * - * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] the boot - * diagnostics storage Uri. It should be a valid Uri + * @member {string} [diagnosticsProfile.bootDiagnostics.storageUri] URI of the + * storage account to use for placing the console output and screenshot. * * @member {object} [availabilitySet] the reference Id of the availability set * to which this virtual machine belongs. @@ -248,7 +261,7 @@ var util = require('util'); * @member {string} [licenseType] the license type, which is for bring your * own license scenario. * - * @member {object} [plan] the purchase plan when deploying virtual machine + * @member {object} [plan] The purchase plan when deploying virtual machine * from VM Marketplace images. * * @member {string} [plan.name] the plan ID. diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMExtensionsSummary.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMExtensionsSummary.js index 116aeea91f..9439400bbc 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMExtensionsSummary.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMExtensionsSummary.js @@ -19,6 +19,7 @@ var util = require('util'); * 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. diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceIDs.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceIDs.js index d8d8d71f10..5dc32c766c 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceIDs.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceIDs.js @@ -16,7 +16,8 @@ var util = require('util'); * @class * Initializes a new instance of the VirtualMachineScaleSetVMInstanceIDs class. * @constructor - * Specifies the list of virtual machine scale set instance IDs. + * Specifies A list of virtual machine instance IDs from the VM scale set. + * * @member {array} [instanceIds] the virtual machine scale set instance ids. * */ diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceRequiredIDs.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceRequiredIDs.js index bbca0124b5..f5fba06bd8 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceRequiredIDs.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceRequiredIDs.js @@ -16,7 +16,8 @@ var util = require('util'); * @class * Initializes a new instance of the VirtualMachineScaleSetVMInstanceRequiredIDs class. * @constructor - * Specifies the list of virtual machine scale set instance IDs. + * Specifies A list of virtual machine instance IDs from the VM scale set. + * * @member {array} instanceIds the virtual machine scale set instance ids. * */ diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceView.js index 6d65b41773..172893518d 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceView.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceView.js @@ -19,6 +19,7 @@ var util = require('util'); * 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. @@ -27,12 +28,12 @@ var util = require('util'); * * @member {object} [vmAgent] the VM Agent running on the virtual machine. * - * @member {string} [vmAgent.vmAgentVersion] the VM Agent full version. + * @member {string} [vmAgent.vmAgentVersion] The VM Agent full version. * - * @member {array} [vmAgent.extensionHandlers] the virtual machine extension + * @member {array} [vmAgent.extensionHandlers] The virtual machine extension * handler instance view. * - * @member {array} [vmAgent.statuses] the resource status information. + * @member {array} [vmAgent.statuses] The resource status information. * * @member {array} [disks] the disks information. * @@ -40,10 +41,10 @@ var util = require('util'); * * @member {object} [bootDiagnostics] the boot diagnostics. * - * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] the console - * screenshot blob Uri. + * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console + * screenshot blob URI. * - * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] the Linux serial + * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] The Linux serial * console log blob Uri. * * @member {array} [statuses] the resource status information. diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMListResult.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMListResult.js index 89a1441b4b..ba5915fecd 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMListResult.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMListResult.js @@ -17,8 +17,7 @@ var util = require('util'); * Initializes a new instance of the VirtualMachineScaleSetVMListResult class. * @constructor * The List Virtual Machine Scale Set VMs operation response. - * @member {array} [value] the list of virtual machine scale sets VMs. - * + * * @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 @@ -44,7 +43,7 @@ VirtualMachineScaleSetVMListResult.prototype.mapper = function () { className: 'VirtualMachineScaleSetVMListResult', modelProperties: { value: { - required: false, + required: true, serializedName: '', type: { name: 'Sequence', diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js index cf926b4f49..03dccca94b 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js @@ -17,6 +17,7 @@ var models = require('./index'); * Initializes a new instance of the VirtualMachineScaleSetVMProfile class. * @constructor * Describes a virtual machine scale set virtual machine profile. + * * @member {object} [osProfile] the virtual machine scale set OS profile. * * @member {string} [osProfile.computerNamePrefix] the computer name prefix. @@ -31,37 +32,39 @@ var models = require('./index'); * @member {object} [osProfile.windowsConfiguration] the Windows Configuration * of the OS profile. * - * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] whether - * VM Agent should be provisioned on the Virtual Machine. + * @member {boolean} [osProfile.windowsConfiguration.provisionVMAgent] + * Indicates whether the virtual machine agent should be provisioned on the + * Virtual Machine. If not specified, then the default behavior is to set it + * to true. * * @member {boolean} [osProfile.windowsConfiguration.enableAutomaticUpdates] - * whether Windows updates are automatically installed on the VM + * Indicates whether Windows updates are automatically installed on the VM. * - * @member {string} [osProfile.windowsConfiguration.timeZone] the Time Zone of + * @member {string} [osProfile.windowsConfiguration.timeZone] The Time Zone of * the VM * * @member {array} [osProfile.windowsConfiguration.additionalUnattendContent] - * the additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file. + * Additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file. * - * @member {object} [osProfile.windowsConfiguration.winRM] the Windows Remote + * @member {object} [osProfile.windowsConfiguration.winRM] The Windows Remote * Management configuration of the VM * - * @member {array} [osProfile.windowsConfiguration.winRM.listeners] the list + * @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] whether - * Authentication using user name and password is allowed or not + * [osProfile.linuxConfiguration.disablePasswordAuthentication] Specifies + * whether password authentication should be disabled. * - * @member {object} [osProfile.linuxConfiguration.ssh] the SSH configuration - * for linux VMs + * @member {object} [osProfile.linuxConfiguration.ssh] The SSH configuration + * for linux VMs. * - * @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] the list of - * SSH public keys used to authenticate with linux based VMs + * @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. @@ -71,17 +74,17 @@ var models = require('./index'); * * @member {object} [storageProfile.imageReference] the image reference. * - * @member {string} [storageProfile.imageReference.publisher] the image + * @member {string} [storageProfile.imageReference.publisher] The image * publisher. * - * @member {string} [storageProfile.imageReference.offer] the image offer. + * @member {string} [storageProfile.imageReference.offer] The image offer. * - * @member {string} [storageProfile.imageReference.sku] the image sku. + * @member {string} [storageProfile.imageReference.sku] The image SKU. * - * @member {string} [storageProfile.imageReference.version] the image version. + * @member {string} [storageProfile.imageReference.version] The image version. * The allowed formats are Major.Minor.Build or 'latest'. Major, Minor and * Build being decimal numbers. Specify 'latest' to use the latest version of - * image. + * the image. * * @member {object} [storageProfile.osDisk] the OS disk. * @@ -98,7 +101,7 @@ var models = require('./index'); * * @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 + * attach to the Virtual Machine. If SourceImage is provided, the destination * VirtualHardDisk should not exist. * * @member {string} [storageProfile.osDisk.image.uri] the virtual hard disk's diff --git a/lib/services/computeManagement2/lib/models/virtualMachineSize.js b/lib/services/computeManagement2/lib/models/virtualMachineSize.js index cbb8ba9d84..6426907b9c 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineSize.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineSize.js @@ -15,19 +15,23 @@ * Initializes a new instance of the VirtualMachineSize class. * @constructor * Describes the properties of a VM size. - * @member {string} [name] the VM size name. + * + * @member {string} [name] The name of the virtual machine size. * - * @member {number} [numberOfCores] the Number of cores supported by a VM size. + * @member {number} [numberOfCores] The number of cores supported by the + * virtual machine size. * - * @member {number} [osDiskSizeInMB] the OS disk size allowed by a VM size. + * @member {number} [osDiskSizeInMB] The OS disk size, in MB, allowed by the + * virtual machine size. * - * @member {number} [resourceDiskSizeInMB] the Resource disk size allowed by a - * VM size. + * @member {number} [resourceDiskSizeInMB] The resource disk size, in MB, + * allowed by the virtual machine size. * - * @member {number} [memoryInMB] the Memory size supported by a VM 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 - * allowed by a VM size. + * @member {number} [maxDataDiskCount] The maximum number of data disks that + * can be attached to the virtual machine size. * */ function VirtualMachineSize() { diff --git a/lib/services/computeManagement2/lib/models/virtualMachineSizeListResult.js b/lib/services/computeManagement2/lib/models/virtualMachineSizeListResult.js index bb64e18263..f3e0a9f4a6 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineSizeListResult.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineSizeListResult.js @@ -17,8 +17,7 @@ var util = require('util'); * Initializes a new instance of the VirtualMachineSizeListResult class. * @constructor * The List Virtual Machine operation response. - * @member {array} [value] the list of virtual machine sizes. - * + * */ function VirtualMachineSizeListResult() { } diff --git a/lib/services/computeManagement2/lib/models/virtualMachineStatusCodeCount.js b/lib/services/computeManagement2/lib/models/virtualMachineStatusCodeCount.js index 05b243217d..57eca9ca1d 100644 --- a/lib/services/computeManagement2/lib/models/virtualMachineStatusCodeCount.js +++ b/lib/services/computeManagement2/lib/models/virtualMachineStatusCodeCount.js @@ -16,6 +16,7 @@ * @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 diff --git a/lib/services/computeManagement2/lib/models/winRMConfiguration.js b/lib/services/computeManagement2/lib/models/winRMConfiguration.js index 8647fff8bf..1278248465 100644 --- a/lib/services/computeManagement2/lib/models/winRMConfiguration.js +++ b/lib/services/computeManagement2/lib/models/winRMConfiguration.js @@ -19,7 +19,8 @@ var util = require('util'); * 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 + * + * @member {array} [listeners] The list of Windows Remote Management listeners * */ function WinRMConfiguration() { diff --git a/lib/services/computeManagement2/lib/models/winRMListener.js b/lib/services/computeManagement2/lib/models/winRMListener.js index 8746af11d3..80656b38fc 100644 --- a/lib/services/computeManagement2/lib/models/winRMListener.js +++ b/lib/services/computeManagement2/lib/models/winRMListener.js @@ -15,8 +15,9 @@ * Initializes a new instance of the WinRMListener class. * @constructor * Describes Protocol and thumbprint of Windows Remote Management listener - * @member {string} [protocol] the Protocol used by WinRM listener. Currently - * only Http and Https are supported. Possible values include: 'Http', 'Https' + * + * @member {string} [protocol] The Protocol used by the WinRM listener. Http + * and Https are supported. Possible values include: 'Http', 'Https' * * @member {string} [certificateUrl] the Certificate URL in KMS for Https * listeners. Should be null for Http listeners. diff --git a/lib/services/computeManagement2/lib/models/windowsConfiguration.js b/lib/services/computeManagement2/lib/models/windowsConfiguration.js index 2bc02e0ee6..ad423a4508 100644 --- a/lib/services/computeManagement2/lib/models/windowsConfiguration.js +++ b/lib/services/computeManagement2/lib/models/windowsConfiguration.js @@ -19,21 +19,23 @@ var util = require('util'); * Initializes a new instance of the WindowsConfiguration class. * @constructor * Describes Windows Configuration of the OS Profile. - * @member {boolean} [provisionVMAgent] whether VM Agent should be provisioned - * on the Virtual Machine. + * + * @member {boolean} [provisionVMAgent] Indicates whether the virtual machine + * agent should be provisioned on the Virtual Machine. If not specified, then + * the default behavior is to set it to true. * - * @member {boolean} [enableAutomaticUpdates] whether Windows updates are - * automatically installed on the VM + * @member {boolean} [enableAutomaticUpdates] Indicates whether Windows + * updates are automatically installed on the VM. * - * @member {string} [timeZone] the Time Zone of the VM + * @member {string} [timeZone] The Time Zone of the VM * - * @member {array} [additionalUnattendContent] the additional base-64 encoded - * XML formatted information that can be included in the Unattend.xml file. + * @member {array} [additionalUnattendContent] Additional base-64 encoded XML + * formatted information that can be included in the Unattend.xml file. * - * @member {object} [winRM] the Windows Remote Management configuration of the + * @member {object} [winRM] The Windows Remote Management configuration of the * VM * - * @member {array} [winRM.listeners] the list of Windows Remote Management + * @member {array} [winRM.listeners] The list of Windows Remote Management * listeners * */ diff --git a/lib/services/computeManagement2/lib/operations/availabilitySets.js b/lib/services/computeManagement2/lib/operations/availabilitySets.js index 18da134d45..e84d7d9be1 100644 --- a/lib/services/computeManagement2/lib/operations/availabilitySets.js +++ b/lib/services/computeManagement2/lib/operations/availabilitySets.js @@ -34,8 +34,7 @@ function AvailabilitySets(client) { * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name Parameters supplied to the Create Availability Set - * operation. + * @param {string} name The name of the availability set. * * @param {object} parameters Parameters supplied to the Create Availability * Set operation. @@ -44,14 +43,12 @@ function AvailabilitySets(client) { * * @param {number} [parameters.platformFaultDomainCount] Fault Domain count. * - * @param {array} [parameters.virtualMachines] a list containing reference to - * all Virtual Machines created under this Availability Set. + * @param {array} [parameters.virtualMachines] A list of references to all + * virtual machines in the availability set. * - * @param {array} [parameters.statuses] the resource status information. + * @param {string} parameters.location Resource location. * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -103,8 +100,8 @@ AvailabilitySets.prototype.createOrUpdate = function (resourceGroupName, name, p } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{name}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{name}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); @@ -113,9 +110,6 @@ AvailabilitySets.prototype.createOrUpdate = function (resourceGroupName, name, p if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -261,8 +255,8 @@ AvailabilitySets.prototype.deleteMethod = function (resourceGroupName, availabil } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'; + var baseUrl = this.client.baseUri; + var 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)); @@ -271,9 +265,6 @@ AvailabilitySets.prototype.deleteMethod = function (resourceGroupName, availabil if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -332,7 +323,7 @@ AvailabilitySets.prototype.deleteMethod = function (resourceGroupName, availabil }; /** - * The operation to get the availability set. + * Retrieves information about an availability set. * * @param {string} resourceGroupName The name of the resource group. * @@ -385,8 +376,8 @@ AvailabilitySets.prototype.get = function (resourceGroupName, availabilitySetNam } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'; + var baseUrl = this.client.baseUri; + var 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)); @@ -395,9 +386,6 @@ AvailabilitySets.prototype.get = function (resourceGroupName, availabilitySetNam if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -477,7 +465,7 @@ AvailabilitySets.prototype.get = function (resourceGroupName, availabilitySetNam }; /** - * The operation to list the availability sets. + * The operation to list all availability sets in a resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -526,8 +514,8 @@ AvailabilitySets.prototype.list = function (resourceGroupName, options, callback } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets'; + var baseUrl = this.client.baseUri; + var 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)); var queryParameters = []; @@ -535,9 +523,6 @@ AvailabilitySets.prototype.list = function (resourceGroupName, options, callback if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -672,8 +657,8 @@ AvailabilitySets.prototype.listAvailableSizes = function (resourceGroupName, ava } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes'; + var baseUrl = this.client.baseUri; + var 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)); @@ -682,9 +667,6 @@ AvailabilitySets.prototype.listAvailableSizes = function (resourceGroupName, ava if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); diff --git a/lib/services/computeManagement2/lib/operations/containerServiceOperations.js b/lib/services/computeManagement2/lib/operations/containerServices.js similarity index 54% rename from lib/services/computeManagement2/lib/operations/containerServiceOperations.js rename to lib/services/computeManagement2/lib/operations/containerServices.js index 934eb7d672..7b0e601d5e 100644 --- a/lib/services/computeManagement2/lib/operations/containerServiceOperations.js +++ b/lib/services/computeManagement2/lib/operations/containerServices.js @@ -17,77 +17,233 @@ var WebResource = msRest.WebResource; /** * @class - * ContainerServiceOperations + * ContainerServices * __NOTE__: An instance of this class is automatically created for an * instance of the ComputeManagementClient. - * Initializes a new instance of the ContainerServiceOperations class. + * Initializes a new instance of the ContainerServices class. * @constructor * * @param {ComputeManagementClient} client Reference to the service client. */ -function ContainerServiceOperations(client) { +function ContainerServices(client) { this.client = client; } /** + * @summary Gets a list of container services in the specified subscription. * - * The operation to create or update a container service. + * 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 + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link 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. + */ +ContainerServices.prototype.list = function (options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var apiVersion = '2016-09-30'; + // 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 + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['ContainerServiceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * + * @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 - * within the given subscription and 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' + * + * @param {object} [parameters.customProfile] Properties for custom clusters. + * + * @param {string} parameters.customProfile.orchestrator The name of the + * custom orchestrator to use. * - * @param {object} parameters Parameters supplied to the Create Container - * Service operation. + * @param {object} [parameters.servicePrincipalProfile] Properties for cluster + * service principals. * - * @param {object} [parameters.orchestratorProfile] Properties of orchestrator + * @param {string} parameters.servicePrincipalProfile.clientId The ID for the + * service principal. * - * @param {string} [parameters.orchestratorProfile.orchestratorType] Specifies - * what orchestrator will be used to manage container cluster resources. - * Possible values include: 'Swarm', 'DCOS' + * @param {string} parameters.servicePrincipalProfile.secret The secret + * password associated with the service principal. * - * @param {object} [parameters.masterProfile] Properties of master agents + * @param {object} parameters.masterProfile Properties of master agents. * * @param {number} [parameters.masterProfile.count] Number of masters (VMs) in - * the container cluster + * 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 FQDN for master + * @param {string} parameters.masterProfile.dnsPrefix DNS prefix to be used to + * create the FQDN for master. * - * @param {array} [parameters.agentPoolProfiles] Properties of agent pools + * @param {array} parameters.agentPoolProfiles Properties of the agent pool. * - * @param {object} [parameters.windowsProfile] Properties of Windows VMs + * @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.adminUsername The administrator + * user name to use for Windows VMs. * - * @param {string} [parameters.windowsProfile.adminPassword] The administrator - * password to use for Windows VMs + * @param {string} parameters.windowsProfile.adminPassword The administrator + * password to use for Windows VMs. * - * @param {object} [parameters.linuxProfile] Properties for Linux VMs + * @param {object} parameters.linuxProfile Properties of Linux VMs. * - * @param {string} [parameters.linuxProfile.adminUsername] The administrator - * username to use for all Linux VMs + * @param {string} parameters.linuxProfile.adminUsername The administrator + * user name to use for Linux VMs. * - * @param {object} [parameters.linuxProfile.ssh] Specifies the ssh key - * configuration 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 {array} parameters.linuxProfile.ssh.publicKeys The list of SSH + * public keys used to authenticate with Linux-based VMs. * - * @param {object} [parameters.diagnosticsProfile] Properties for Diagnostic - * Agent + * @param {object} [parameters.diagnosticsProfile] Properties of the + * diagnostic agent. * - * @param {object} [parameters.diagnosticsProfile.vmDiagnostics] Profile for - * container service VM diagnostic agent + * @param {object} parameters.diagnosticsProfile.vmDiagnostics Profile for the + * container service VM diagnostic agent. * - * @param {boolean} [parameters.diagnosticsProfile.vmDiagnostics.enabled] - * whether VM Diagnostic Agent should be provisioned on the Virtual Machine. + * @param {boolean} parameters.diagnosticsProfile.vmDiagnostics.enabled + * Whether the VM diagnostic agent is provisioned on the VM. * - * @param {string} [parameters.location] Resource location + * @param {string} parameters.location Resource location. * - * @param {object} [parameters.tags] Resource tags + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -107,42 +263,401 @@ function ContainerServiceOperations(client) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -ContainerServiceOperations.prototype.createOrUpdate = function (resourceGroupName, containerServiceName, parameters, options, callback) { +ContainerServices.prototype.createOrUpdate = function (resourceGroupName, containerServiceName, parameters, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, containerServiceName, parameters, options, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['ContainerService']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +}; + +/** + * @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 + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link 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. + */ +ContainerServices.prototype.get = function (resourceGroupName, containerServiceName, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var apiVersion = '2016-09-30'; + // 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 + var baseUrl = this.client.baseUri; + var 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)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['ContainerService']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * + * @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 + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +ContainerServices.prototype.deleteMethod = function (resourceGroupName, containerServiceName, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var 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 + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link 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. + */ +ContainerServices.prototype.listByResourceGroup = function (resourceGroupName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } - if (!callback) { throw new Error('callback cannot be null.'); } + var apiVersion = '2016-09-30'; + // 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); + } - // Send request - this.beginCreateOrUpdate(resourceGroupName, containerServiceName, parameters, options, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); + // Construct URL + var baseUrl = this.client.baseUri; + var 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)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; - - // Deserialize Response + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { var parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['ContainerService']().mapper(); + var resultMapper = new client.models['ContainerServiceListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -151,70 +666,90 @@ ContainerServiceOperations.prototype.createOrUpdate = function (resourceGroupNam deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } + } - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); }; /** - * The operation to create or update a container service. + * @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 - * within the given subscription and 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 Container - * Service operation. + * @param {object} parameters Parameters supplied to the Create or Update a + * Container Service operation. * - * @param {object} [parameters.orchestratorProfile] Properties of orchestrator + * @param {object} [parameters.orchestratorProfile] Properties of the + * orchestrator. * - * @param {string} [parameters.orchestratorProfile.orchestratorType] Specifies - * what orchestrator will be used to manage container cluster resources. - * Possible values include: 'Swarm', 'DCOS' + * @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' * - * @param {object} [parameters.masterProfile] Properties of master agents + * @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 cluster + * 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 FQDN for master + * @param {string} parameters.masterProfile.dnsPrefix DNS prefix to be used to + * create the FQDN for master. * - * @param {array} [parameters.agentPoolProfiles] Properties of agent pools + * @param {array} parameters.agentPoolProfiles Properties of the agent pool. * - * @param {object} [parameters.windowsProfile] Properties of Windows VMs + * @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.adminUsername The administrator + * user name to use for Windows VMs. * - * @param {string} [parameters.windowsProfile.adminPassword] The administrator - * password to use for Windows VMs + * @param {string} parameters.windowsProfile.adminPassword The administrator + * password to use for Windows VMs. * - * @param {object} [parameters.linuxProfile] Properties for Linux VMs + * @param {object} parameters.linuxProfile Properties of Linux VMs. * - * @param {string} [parameters.linuxProfile.adminUsername] The administrator - * username to use for all Linux VMs + * @param {string} parameters.linuxProfile.adminUsername The administrator + * user name to use for Linux VMs. * - * @param {object} [parameters.linuxProfile.ssh] Specifies the ssh key - * configuration 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 {array} parameters.linuxProfile.ssh.publicKeys The list of SSH + * public keys used to authenticate with Linux-based VMs. * - * @param {object} [parameters.diagnosticsProfile] Properties for Diagnostic - * Agent + * @param {object} [parameters.diagnosticsProfile] Properties of the + * diagnostic agent. * - * @param {object} [parameters.diagnosticsProfile.vmDiagnostics] Profile for - * container service VM diagnostic agent + * @param {object} parameters.diagnosticsProfile.vmDiagnostics Profile for the + * container service VM diagnostic agent. * - * @param {boolean} [parameters.diagnosticsProfile.vmDiagnostics.enabled] - * whether VM Diagnostic Agent should be provisioned on the Virtual Machine. + * @param {boolean} parameters.diagnosticsProfile.vmDiagnostics.enabled + * Whether the VM diagnostic agent is provisioned on the VM. * - * @param {string} [parameters.location] Resource location + * @param {string} parameters.location Resource location. * - * @param {object} [parameters.tags] Resource tags + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -234,7 +769,7 @@ ContainerServiceOperations.prototype.createOrUpdate = function (resourceGroupNam * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -ContainerServiceOperations.prototype.beginCreateOrUpdate = function (resourceGroupName, containerServiceName, parameters, options, callback) { +ContainerServices.prototype.beginCreateOrUpdate = function (resourceGroupName, containerServiceName, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -243,7 +778,7 @@ ContainerServiceOperations.prototype.beginCreateOrUpdate = function (resourceGro if (!callback) { throw new Error('callback cannot be null.'); } - var apiVersion = '2016-03-30'; + var apiVersion = '2016-09-30'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -266,8 +801,8 @@ ContainerServiceOperations.prototype.beginCreateOrUpdate = function (resourceGro } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'; + var baseUrl = this.client.baseUri; + var 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)); @@ -276,9 +811,6 @@ ContainerServiceOperations.prototype.beginCreateOrUpdate = function (resourceGro if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -406,12 +938,19 @@ ContainerServiceOperations.prototype.beginCreateOrUpdate = function (resourceGro }; /** - * The operation to get a container service. + * @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 - * within the given subscription and resource group. + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. * * @param {object} [options] Optional Parameters. * @@ -424,14 +963,13 @@ ContainerServiceOperations.prototype.beginCreateOrUpdate = function (resourceGro * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object. - * See {@link ContainerService} for more information. + * {null} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -ContainerServiceOperations.prototype.get = function (resourceGroupName, containerServiceName, options, callback) { +ContainerServices.prototype.beginDeleteMethod = function (resourceGroupName, containerServiceName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -440,7 +978,7 @@ ContainerServiceOperations.prototype.get = function (resourceGroupName, containe if (!callback) { throw new Error('callback cannot be null.'); } - var apiVersion = '2016-03-30'; + var apiVersion = '2016-09-30'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -460,8 +998,8 @@ ContainerServiceOperations.prototype.get = function (resourceGroupName, containe } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}'; + var baseUrl = this.client.baseUri; + var 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)); @@ -470,13 +1008,10 @@ ContainerServiceOperations.prototype.get = function (resourceGroupName, containe if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -501,7 +1036,7 @@ ContainerServiceOperations.prototype.get = function (resourceGroupName, containe return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 202 && statusCode !== 204) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -515,10 +1050,6 @@ ContainerServiceOperations.prototype.get = function (resourceGroupName, containe if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - var resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -529,97 +1060,21 @@ ContainerServiceOperations.prototype.get = function (resourceGroupName, containe // Create Result var result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - var parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['ContainerService']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); }; /** + * @summary Gets a list of container services in the specified subscription. * - * The operation to delete a container service. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} containerServiceName The name of the container service - * within the given subscription and resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -ContainerServiceOperations.prototype.deleteMethod = function (resourceGroupName, containerServiceName, options, callback) { - var 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, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - -/** - * The operation to delete a container service. + * 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} resourceGroupName The name of the resource group. - * - * @param {string} containerServiceName The name of the container service - * within the given subscription and resource group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -632,13 +1087,15 @@ ContainerServiceOperations.prototype.deleteMethod = function (resourceGroupName, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object. + * {object} [result] - The deserialized result object. + * 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. */ -ContainerServiceOperations.prototype.beginDeleteMethod = function (resourceGroupName, containerServiceName, options, callback) { +ContainerServices.prototype.listNext = function (nextPageLink, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -647,17 +1104,10 @@ ContainerServiceOperations.prototype.beginDeleteMethod = function (resourceGroup if (!callback) { throw new Error('callback cannot be null.'); } - var apiVersion = '2016-03-30'; // 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 (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.'); @@ -667,23 +1117,12 @@ ContainerServiceOperations.prototype.beginDeleteMethod = function (resourceGroup } // Construct URL - var requestUrl = this.client.baseUri + - '//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)); - var queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); + var requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -708,7 +1147,7 @@ ContainerServiceOperations.prototype.beginDeleteMethod = function (resourceGroup return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 204) { + if (statusCode !== 200) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -722,6 +1161,10 @@ ContainerServiceOperations.prototype.beginDeleteMethod = function (resourceGroup if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -732,15 +1175,38 @@ ContainerServiceOperations.prototype.beginDeleteMethod = function (resourceGroup // Create Result var result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['ContainerServiceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); }; /** - * The operation to list container services. + * @summary Gets a list of container services in the specified resource group. * - * @param {string} resourceGroupName The name of the 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. * @@ -761,7 +1227,7 @@ ContainerServiceOperations.prototype.beginDeleteMethod = function (resourceGroup * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -ContainerServiceOperations.prototype.list = function (resourceGroupName, options, callback) { +ContainerServices.prototype.listByResourceGroupNext = function (nextPageLink, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -770,14 +1236,10 @@ ContainerServiceOperations.prototype.list = function (resourceGroupName, options if (!callback) { throw new Error('callback cannot be null.'); } - var apiVersion = '2016-03-30'; // 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 (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.'); @@ -787,18 +1249,8 @@ ContainerServiceOperations.prototype.list = function (resourceGroupName, options } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - var queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); + var requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -878,4 +1330,4 @@ ContainerServiceOperations.prototype.list = function (resourceGroupName, options }; -module.exports = ContainerServiceOperations; +module.exports = ContainerServices; diff --git a/lib/services/computeManagement2/lib/operations/index.d.ts b/lib/services/computeManagement2/lib/operations/index.d.ts index 3dad6cc152..c88eae3499 100644 --- a/lib/services/computeManagement2/lib/operations/index.d.ts +++ b/lib/services/computeManagement2/lib/operations/index.d.ts @@ -25,8 +25,7 @@ export interface AvailabilitySets { * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name Parameters supplied to the Create Availability Set - * operation. + * @param {string} name The name of the availability set. * * @param {object} parameters Parameters supplied to the Create Availability * Set operation. @@ -35,14 +34,12 @@ export interface AvailabilitySets { * * @param {number} [parameters.platformFaultDomainCount] Fault Domain count. * - * @param {array} [parameters.virtualMachines] a list containing reference to - * all Virtual Machines created under this Availability Set. - * - * @param {array} [parameters.statuses] the resource status information. + * @param {array} [parameters.virtualMachines] A list of references to all + * virtual machines in the availability set. * - * @param {string} [parameters.location] Resource location + * @param {string} parameters.location Resource location. * - * @param {object} [parameters.tags] Resource tags + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -74,7 +71,7 @@ export interface AvailabilitySets { deleteMethod(resourceGroupName: string, availabilitySetName: string, callback: ServiceCallback): void; /** - * The operation to get the availability set. + * Retrieves information about an availability set. * * @param {string} resourceGroupName The name of the resource group. * @@ -92,7 +89,7 @@ export interface AvailabilitySets { get(resourceGroupName: string, availabilitySetName: string, callback: ServiceCallback): void; /** - * The operation to list the availability sets. + * The operation to list all availability sets in a resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -263,9 +260,9 @@ export interface VirtualMachineExtensions { * @param {array} [extensionParameters.instanceView.statuses] the resource * status information. * - * @param {string} [extensionParameters.location] Resource location + * @param {string} extensionParameters.location Resource location. * - * @param {object} [extensionParameters.tags] Resource tags + * @param {object} [extensionParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -278,6 +275,51 @@ export interface VirtualMachineExtensions { createOrUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtension, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; createOrUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtension, 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 + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: 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 + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + get(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void; + /** * The operation to create or update the extension. * @@ -331,9 +373,9 @@ export interface VirtualMachineExtensions { * @param {array} [extensionParameters.instanceView.statuses] the resource * status information. * - * @param {string} [extensionParameters.location] Resource location + * @param {string} extensionParameters.location Resource location. * - * @param {object} [extensionParameters.tags] Resource tags + * @param {object} [extensionParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -346,27 +388,6 @@ export interface VirtualMachineExtensions { beginCreateOrUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtension, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; beginCreateOrUpdate(resourceGroupName: string, vmName: string, vmExtensionName: string, extensionParameters: models.VirtualMachineExtension, 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 - * - * @param {ServiceCallback} [callback] callback function; see ServiceCallback - * doc in ms-rest index.d.ts for details - */ - deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void; - /** * The operation to delete the extension. * @@ -387,30 +408,6 @@ export interface VirtualMachineExtensions { */ beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: 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 - * - * @param {ServiceCallback} [callback] callback function; see ServiceCallback - * doc in ms-rest index.d.ts for details - */ - get(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - get(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void; } /** @@ -424,15 +421,15 @@ export interface VirtualMachineImages { /** * Gets a virtual machine image. * - * @param {string} location + * @param {string} location The name of a supported Azure region. * - * @param {string} publisherName + * @param {string} publisherName A valid image publisher. * - * @param {string} offer + * @param {string} offer A valid image publisher offer. * - * @param {string} skus + * @param {string} skus A valid image SKU. * - * @param {string} version + * @param {string} version A valid image SKU version. * * @param {object} [options] Optional Parameters. * @@ -446,15 +443,16 @@ export interface VirtualMachineImages { get(location: string, publisherName: string, offer: string, skus: string, version: string, callback: ServiceCallback): void; /** - * Gets a list of virtual machine images. + * Gets a list of all virtual machine image versions for the specified + * location, publisher, offer, and SKU. * - * @param {string} location + * @param {string} location The name of a supported Azure region. * - * @param {string} publisherName + * @param {string} publisherName A valid image publisher. * - * @param {string} offer + * @param {string} offer A valid image publisher offer. * - * @param {string} skus + * @param {string} skus A valid image SKU. * * @param {object} [options] Optional Parameters. * @@ -474,11 +472,12 @@ export interface VirtualMachineImages { list(location: string, publisherName: string, offer: string, skus: string, callback: ServiceCallback): void; /** - * Gets a list of virtual machine image offers. + * Gets a list of virtual machine image offers for the specified location and + * publisher. * - * @param {string} location + * @param {string} location The name of a supported Azure region. * - * @param {string} publisherName + * @param {string} publisherName A valid image publisher. * * @param {object} [options] Optional Parameters. * @@ -492,9 +491,10 @@ export interface VirtualMachineImages { listOffers(location: string, publisherName: string, callback: ServiceCallback): void; /** - * Gets a list of virtual machine image publishers. + * Gets a list of virtual machine image publishers for the specified Azure + * location. * - * @param {string} location + * @param {string} location The name of a supported Azure region. * * @param {object} [options] Optional Parameters. * @@ -508,13 +508,14 @@ export interface VirtualMachineImages { listPublishers(location: string, callback: ServiceCallback): void; /** - * Gets a list of virtual machine image skus. + * Gets a list of virtual machine image SKUs for the specified location, + * publisher, and offer. * - * @param {string} location + * @param {string} location The name of a supported Azure region. * - * @param {string} publisherName + * @param {string} publisherName A valid image publisher. * - * @param {string} offer + * @param {string} offer A valid image publisher offer. * * @param {object} [options] Optional Parameters. * @@ -537,7 +538,8 @@ export interface VirtualMachineImages { export interface UsageOperations { /** - * Lists compute usages for a subscription. + * Gets, for the specified location, the current compute usage information as + * well as the limits for compute resources under the subscription. * * @param {string} location The location upon which resource usage is queried. * @@ -553,7 +555,8 @@ export interface UsageOperations { list(location: string, callback: ServiceCallback): void; /** - * Lists compute usages for a subscription. + * Gets, for the specified location, the current compute 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. @@ -615,14 +618,14 @@ export interface VirtualMachines { * @param {object} parameters Parameters supplied to the Capture Virtual * Machine operation. * - * @param {string} [parameters.vhdPrefix] the captured VirtualHardDisk's name + * @param {string} parameters.vhdPrefix the captured VirtualHardDisk's name * prefix. * - * @param {string} [parameters.destinationContainerName] the destination + * @param {string} parameters.destinationContainerName the destination * container name. * - * @param {boolean} [parameters.overwriteVhds] whether it overwrites - * destination VirtualHardDisk if true, in case of conflict. + * @param {boolean} parameters.overwriteVhds whether it overwrites destination + * VirtualHardDisk if true, in case of conflict. * * @param {object} [options] Optional Parameters. * @@ -635,37 +638,6 @@ export interface VirtualMachines { capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, 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 VirtualHardDisk's name - * prefix. - * - * @param {string} [parameters.destinationContainerName] the destination - * container name. - * - * @param {boolean} [parameters.overwriteVhds] whether it overwrites - * destination VirtualHardDisk if true, in case of conflict. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [callback] callback function; see ServiceCallback - * doc in ms-rest index.d.ts for details - */ - beginCapture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginCapture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, callback: ServiceCallback): void; - /** * The operation to create or update a virtual machine. * @@ -676,7 +648,7 @@ export interface VirtualMachines { * @param {object} parameters Parameters supplied to the Create Virtual * Machine operation. * - * @param {object} [parameters.plan] the purchase plan when deploying virtual + * @param {object} [parameters.plan] The purchase plan when deploying virtual * machine from VM Marketplace images. * * @param {string} [parameters.plan.name] the plan ID. @@ -687,7 +659,7 @@ export interface VirtualMachines { * * @param {string} [parameters.plan.promotionCode] the promotion code. * - * @param {object} [parameters.hardwareProfile] the hardware profile. + * @param {object} [parameters.hardwareProfile] The hardware profile. * * @param {string} [parameters.hardwareProfile.vmSize] The virtual machine * size name. Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', @@ -707,26 +679,26 @@ export interface VirtualMachines { * 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5' * - * @param {object} [parameters.storageProfile] the storage profile. + * @param {object} [parameters.storageProfile] The storage profile. * - * @param {object} [parameters.storageProfile.imageReference] the image + * @param {object} [parameters.storageProfile.imageReference] The image * reference. * - * @param {string} [parameters.storageProfile.imageReference.publisher] the + * @param {string} [parameters.storageProfile.imageReference.publisher] The * image publisher. * - * @param {string} [parameters.storageProfile.imageReference.offer] the image + * @param {string} [parameters.storageProfile.imageReference.offer] The image * offer. * - * @param {string} [parameters.storageProfile.imageReference.sku] the image - * sku. + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. * - * @param {string} [parameters.storageProfile.imageReference.version] the + * @param {string} [parameters.storageProfile.imageReference.version] The * image version. The allowed formats are Major.Minor.Build or 'latest'. * Major, Minor and Build being decimal numbers. Specify 'latest' to use the - * latest version of image. + * latest version of the image. * - * @param {object} [parameters.storageProfile.osDisk] the OS disk. + * @param {object} [parameters.storageProfile.osDisk] The OS disk. * * @param {string} [parameters.storageProfile.osDisk.osType] the Operating * System type. Possible values include: 'Windows', 'Linux' @@ -739,11 +711,11 @@ export interface VirtualMachines { * the disk encryption key which is a KeyVault Secret. * * @param {string} - * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl] + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl * the URL referencing a secret in a Key Vault. * * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault] + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault * the Relative URL of the Key Vault containing the secret. * * @param {object} @@ -751,25 +723,24 @@ export interface VirtualMachines { * key encryption key which is KeyVault Key. * * @param {string} - * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl] + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl * the URL referencing a key in a Key Vault. * * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault] + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault * the Relative URL of the Key Vault containing the key * * @param {boolean} * [parameters.storageProfile.osDisk.encryptionSettings.enabled] whether disk * encryption should be enabled on the Virtual Machine. * - * @param {string} [parameters.storageProfile.osDisk.name] the disk name. + * @param {string} parameters.storageProfile.osDisk.name the disk name. * - * @param {object} [parameters.storageProfile.osDisk.vhd] the Virtual Hard - * Disk. + * @param {object} parameters.storageProfile.osDisk.vhd the Virtual Hard Disk. * * @param {object} [parameters.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 + * to attach to the Virtual Machine. If SourceImage is provided, the * destination VirtualHardDisk should not exist. * * @param {string} [parameters.storageProfile.osDisk.image.uri] the virtual @@ -778,95 +749,104 @@ export interface VirtualMachines { * @param {string} [parameters.storageProfile.osDisk.caching] the caching * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' * - * @param {string} [parameters.storageProfile.osDisk.createOption] the create + * @param {string} parameters.storageProfile.osDisk.createOption the create * option. Possible values include: 'fromImage', 'empty', 'attach' * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] the initial * disk size in GB for blank data disks, and the new desired size for * existing OS and Data disks. * - * @param {array} [parameters.storageProfile.dataDisks] the data disks. + * @param {array} [parameters.storageProfile.dataDisks] The data disks. * - * @param {object} [parameters.osProfile] the OS profile. + * @param {object} [parameters.osProfile] The OS profile. * - * @param {string} [parameters.osProfile.computerName] the computer name. + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine. * - * @param {string} [parameters.osProfile.adminUsername] the admin user name. + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account. * - * @param {string} [parameters.osProfile.adminPassword] the admin user - * password. + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account. * - * @param {string} [parameters.osProfile.customData] a base-64 encoded string - * of custom data. + * @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 * * @param {object} [parameters.osProfile.windowsConfiguration] the Windows * Configuration of the OS profile. * * @param {boolean} - * [parameters.osProfile.windowsConfiguration.provisionVMAgent] whether VM - * Agent should be provisioned on the Virtual Machine. + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether the virtual machine agent should be provisioned on the Virtual + * Machine. If not specified, then the default behavior is to set it to true. * * @param {boolean} - * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] whether - * Windows updates are automatically installed on the VM + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether Windows updates are automatically installed on the VM. * - * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] the + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] The * Time Zone of the VM * * @param {array} - * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] the - * additional base-64 encoded XML formatted information that can be included + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Additional base-64 encoded XML formatted information that can be included * in the Unattend.xml file. * - * @param {object} [parameters.osProfile.windowsConfiguration.winRM] the + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] The * Windows Remote Management configuration of the VM * * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] - * the list of Windows Remote Management listeners + * The list of Windows Remote Management listeners * * @param {object} [parameters.osProfile.linuxConfiguration] the Linux * Configuration of the OS profile. * * @param {boolean} * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] - * whether Authentication using user name and password is allowed or not + * Specifies whether password authentication should be disabled. * - * @param {object} [parameters.osProfile.linuxConfiguration.ssh] the SSH - * configuration for linux VMs + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] The SSH + * configuration for linux VMs. * - * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] the - * list of SSH public keys used to authenticate with linux based VMs + * @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] the List of certificates for * addition to the VM. * - * @param {object} [parameters.networkProfile] the network profile. + * @param {object} [parameters.networkProfile] The network profile. * - * @param {array} [parameters.networkProfile.networkInterfaces] the network - * interfaces. + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the + * virtual machine. * - * @param {object} [parameters.diagnosticsProfile] the diagnostics profile. + * @param {object} [parameters.diagnosticsProfile] The diagnostics profile. * - * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] the boot - * diagnostics. + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows the user to view console + * output and/or a screenshot of the virtual machine from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] - * whether boot diagnostics should be enabled on the Virtual Machine. + * Whether boot diagnostics should be enabled on the Virtual Machine. * * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] - * the boot diagnostics storage Uri. It should be a valid Uri + * URI of the storage account to use for placing the console output and + * screenshot. * - * @param {object} [parameters.availabilitySet] the reference Id of the - * availability set to which this virtual machine belongs. + * @param {object} [parameters.availabilitySet] The reference Id of the + * availability set to which the virtual machine belongs. * * @param {string} [parameters.availabilitySet.id] Resource Id * - * @param {string} [parameters.licenseType] the license type, which is for - * bring your own license scenario. + * @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. * - * @param {string} [parameters.location] Resource location + * @param {string} parameters.location Resource location. * - * @param {object} [parameters.tags] Resource tags + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -880,220 +860,116 @@ export interface VirtualMachines { createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, callback: ServiceCallback): void; /** - * The operation to create or update a virtual machine. + * 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} parameters Parameters supplied to the Create Virtual - * Machine operation. - * - * @param {object} [parameters.plan] the purchase plan when deploying virtual - * machine from VM Marketplace images. - * - * @param {string} [parameters.plan.name] the plan ID. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.plan.publisher] the publisher ID. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.plan.product] the offer ID. + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + deleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + + /** + * The operation to get a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.plan.promotionCode] the promotion code. + * @param {string} vmName The name of the virtual machine. * - * @param {object} [parameters.hardwareProfile] the hardware profile. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.hardwareProfile.vmSize] The virtual machine - * size name. 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_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', - * 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', - * 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', - * 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', - * 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', - * 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', - * 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', - * 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', - * 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', - * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_G1', 'Standard_G2', - * 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', - * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5' + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'instanceView' * - * @param {object} [parameters.storageProfile] the storage profile. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.storageProfile.imageReference] the image - * reference. + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + get(resourceGroupName: string, vmName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, vmName: 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} [parameters.storageProfile.imageReference.publisher] the - * image publisher. + * @param {string} vmName The name of the virtual machine. * - * @param {string} [parameters.storageProfile.imageReference.offer] the image - * offer. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.storageProfile.imageReference.sku] the image - * sku. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.storageProfile.imageReference.version] the - * image version. The allowed formats are Major.Minor.Build or 'latest'. - * Major, Minor and Build being decimal numbers. Specify 'latest' to use the - * latest version of image. + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + deallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + + /** + * Sets the state of the VM as Generalized. + * + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.storageProfile.osDisk] the OS disk. + * @param {string} vmName The name of the virtual machine. * - * @param {string} [parameters.storageProfile.osDisk.osType] the Operating - * System type. Possible values include: 'Windows', 'Linux' + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] the - * disk encryption settings. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] - * the disk encryption key which is a KeyVault Secret. + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + generalize(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + generalize(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + + /** + * The operation to list virtual machines under a resource group. + * + * @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 {object} [options] Optional Parameters. * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault] - * the Relative URL of the Key Vault containing the secret. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey] the - * key encryption key which is KeyVault Key. + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, callback: ServiceCallback): void; + + /** + * Gets the list of Virtual Machines in the subscription. Use nextLink + * property in the response to get the next page of Virtual Machines. Do this + * till nextLink is not null to fetch all the Virtual Machines. + * + * @param {object} [options] Optional Parameters. * - * @param {string} - * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl] - * the URL referencing a key in a 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] 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 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.storageProfile.osDisk.image.uri] the virtual - * hard disk's uri. It should be a valid Uri to a virtual hard disk. - * - * @param {string} [parameters.storageProfile.osDisk.caching] the caching - * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - * - * @param {string} [parameters.storageProfile.osDisk.createOption] the create - * option. Possible values include: 'fromImage', 'empty', 'attach' - * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] the initial - * disk size in GB for blank data disks, and the new desired size for - * existing OS and Data disks. - * - * @param {array} [parameters.storageProfile.dataDisks] the data disks. - * - * @param {object} [parameters.osProfile] the OS profile. - * - * @param {string} [parameters.osProfile.computerName] the computer name. - * - * @param {string} [parameters.osProfile.adminUsername] the admin user name. - * - * @param {string} [parameters.osProfile.adminPassword] the admin user - * password. - * - * @param {string} [parameters.osProfile.customData] a base-64 encoded string - * of custom data. - * - * @param {object} [parameters.osProfile.windowsConfiguration] the Windows - * Configuration of the OS profile. - * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.provisionVMAgent] whether VM - * Agent should be provisioned on the Virtual Machine. - * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] whether - * Windows updates are automatically installed on the VM - * - * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] the - * Time Zone of the VM - * - * @param {array} - * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] the - * additional base-64 encoded XML formatted information that can be included - * in the Unattend.xml file. - * - * @param {object} [parameters.osProfile.windowsConfiguration.winRM] the - * Windows Remote Management configuration of the VM - * - * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] - * the list of Windows Remote Management listeners - * - * @param {object} [parameters.osProfile.linuxConfiguration] the Linux - * Configuration of the OS profile. - * - * @param {boolean} - * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] - * whether Authentication using user name and password is allowed or not - * - * @param {object} [parameters.osProfile.linuxConfiguration.ssh] the SSH - * configuration for linux VMs - * - * @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] the List of certificates for - * addition to the VM. - * - * @param {object} [parameters.networkProfile] the network profile. - * - * @param {array} [parameters.networkProfile.networkInterfaces] the network - * interfaces. - * - * @param {object} [parameters.diagnosticsProfile] the diagnostics profile. - * - * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] the boot - * diagnostics. - * - * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] - * whether boot diagnostics should be enabled on the Virtual Machine. - * - * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] - * the boot diagnostics storage Uri. It should be a valid Uri - * - * @param {object} [parameters.availabilitySet] the reference Id of the - * availability set to which this virtual machine belongs. - * - * @param {string} [parameters.availabilitySet.id] Resource Id - * - * @param {string} [parameters.licenseType] the license type, which is for - * bring your own license scenario. - * - * @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 {object} [options.customHeaders] Headers that will be added to the + * request * * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginCreateOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAll(callback: ServiceCallback): void; /** - * The operation to delete a virtual machine. + * Lists all available virtual machine sizes to which the specified virtual + * machine can be resized. * * @param {string} resourceGroupName The name of the resource group. * @@ -1107,11 +983,11 @@ export interface VirtualMachines { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - deleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + listAvailableSizes(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAvailableSizes(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; /** - * The operation to delete a virtual machine. + * The operation to power off (stop) a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -1125,11 +1001,11 @@ export interface VirtualMachines { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginDeleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; /** - * The operation to get a virtual machine. + * The operation to restart a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -1137,21 +1013,17 @@ export interface VirtualMachines { * * @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} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - get(resourceGroupName: string, vmName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - get(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmName: 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. + * The operation to start a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -1165,12 +1037,11 @@ export interface VirtualMachines { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - deallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - deallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + start(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + start(resourceGroupName: string, vmName: 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. + * The operation to redeploy a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -1184,16 +1055,29 @@ export interface VirtualMachines { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginDeallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginDeallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + redeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + redeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; /** - * Sets the state of the VM as Generalized. + * 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 VirtualHardDisk's name + * prefix. + * + * @param {string} parameters.destinationContainerName the destination + * container name. + * + * @param {boolean} parameters.overwriteVhds whether it overwrites destination + * VirtualHardDisk if true, in case of conflict. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1202,84 +1086,218 @@ export interface VirtualMachines { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - generalize(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - generalize(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginCapture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCapture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, callback: ServiceCallback): void; /** - * The operation to list virtual machines under a resource group. + * The operation to create or update a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [options] Optional Parameters. + * @param {string} vmName The name of the virtual machine. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} parameters Parameters supplied to the Create Virtual + * Machine operation. * - * @param {ServiceCallback} [callback] callback function; see ServiceCallback - * doc in ms-rest index.d.ts for details - */ - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - list(resourceGroupName: string, callback: ServiceCallback): void; - - /** - * Gets the list of Virtual Machines in the subscription. Use nextLink - * property in the response to get the next page of Virtual Machines. Do this - * till nextLink is not null to fetch all the Virtual Machines. - * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.plan] The purchase plan when deploying virtual + * machine from VM Marketplace images. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.plan.name] the plan ID. * - * @param {ServiceCallback} [callback] callback function; see ServiceCallback - * doc in ms-rest index.d.ts for details - */ - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - listAll(callback: ServiceCallback): void; - - /** - * Lists all available virtual machine sizes it can be resized to for a + * @param {string} [parameters.plan.publisher] the publisher ID. + * + * @param {string} [parameters.plan.product] the offer ID. + * + * @param {string} [parameters.plan.promotionCode] the promotion code. + * + * @param {object} [parameters.hardwareProfile] The hardware profile. + * + * @param {string} [parameters.hardwareProfile.vmSize] The virtual machine + * size name. 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_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', + * 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', + * 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', + * 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', + * 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', + * 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', + * 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', + * 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', + * 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_G1', 'Standard_G2', + * 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5' + * + * @param {object} [parameters.storageProfile] The storage profile. + * + * @param {object} [parameters.storageProfile.imageReference] The image + * reference. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] The image + * offer. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] The + * image version. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor and Build being decimal numbers. Specify 'latest' to use the + * latest version of the image. + * + * @param {object} [parameters.storageProfile.osDisk] The OS disk. + * + * @param {string} [parameters.storageProfile.osDisk.osType] the Operating + * System type. Possible values include: 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] the + * disk encryption settings. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * the disk encryption key which is a KeyVault 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] the + * key encryption key which is KeyVault Key. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * the URL referencing a key in a 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] 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 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.storageProfile.osDisk.image.uri] the virtual + * hard disk's uri. It should be a valid Uri to a virtual hard disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] the caching + * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * + * @param {string} parameters.storageProfile.osDisk.createOption the create + * option. Possible values include: 'fromImage', 'empty', 'attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] the initial + * disk size in GB for blank data disks, and the new desired size for + * existing OS and Data disks. + * + * @param {array} [parameters.storageProfile.dataDisks] The data disks. + * + * @param {object} [parameters.osProfile] The OS profile. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine. + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account. + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account. + * + * @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 + * + * @param {object} [parameters.osProfile.windowsConfiguration] the Windows + * Configuration of the OS profile. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether the virtual machine agent should be provisioned on the Virtual + * Machine. If not specified, then the default behavior is to set it to true. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether Windows updates are automatically installed on the VM. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] The + * Time Zone of the VM + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] The + * Windows Remote Management configuration of the VM + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] the Linux + * Configuration of the OS profile. + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] The SSH + * configuration for linux VMs. + * + * @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] the List of certificates for + * addition to the VM. + * + * @param {object} [parameters.networkProfile] The network profile. + * + * @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 {string} vmName The name of the virtual machine. + * @param {object} [parameters.diagnosticsProfile] The diagnostics profile. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows the user to view console + * output and/or a screenshot of the virtual machine from the hypervisor. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] + * Whether boot diagnostics should be enabled on the Virtual Machine. * - * @param {ServiceCallback} [callback] callback function; see ServiceCallback - * doc in ms-rest index.d.ts for details - */ - listAvailableSizes(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - listAvailableSizes(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - - /** - * The operation to power off (stop) a 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] The reference Id of the + * availability set to which the virtual machine belongs. * - * @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. * - * @param {ServiceCallback} [callback] callback function; see ServiceCallback - * doc in ms-rest index.d.ts for details - */ - powerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - powerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; - - /** - * The operation to power off (stop) a virtual machine. - * - * @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} [options] Optional Parameters. * @@ -1289,11 +1307,11 @@ export interface VirtualMachines { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginPowerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginPowerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, callback: ServiceCallback): void; /** - * The operation to restart a virtual machine. + * The operation to delete a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -1307,11 +1325,12 @@ export interface VirtualMachines { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - restart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - restart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; /** - * The operation to restart a virtual machine. + * 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. * @@ -1325,11 +1344,11 @@ export interface VirtualMachines { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginRestart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginRestart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; /** - * The operation to start a virtual machine. + * The operation to power off (stop) a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -1343,11 +1362,11 @@ export interface VirtualMachines { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - start(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - start(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; /** - * The operation to start a virtual machine. + * The operation to restart a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -1361,11 +1380,11 @@ export interface VirtualMachines { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginStart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginStart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; /** - * The operation to redeploy a virtual machine. + * The operation to start a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -1379,8 +1398,8 @@ export interface VirtualMachines { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - redeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - redeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void; /** * The operation to redeploy a virtual machine. @@ -1423,198 +1442,7 @@ export interface VirtualMachines { * till nextLink is not null to fetch all the 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} [callback] callback function; see ServiceCallback - * doc in ms-rest index.d.ts for details - */ - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualMachineScaleSets - * __NOTE__: An instance of this class is automatically created for an - * instance of the ComputeManagementClient. - */ -export interface VirtualMachineScaleSets { - - /** - * Allows you to create or update a virtual machine scale set by providing - * parameters or a path to pre-configured parameter file. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} name Parameters supplied to the Create Virtual Machine - * Scale Set operation. - * - * @param {object} parameters Parameters supplied to the Create Virtual - * Machine Scale Set operation. - * - * @param {object} [parameters.sku] the virtual machine scale set sku. - * - * @param {string} [parameters.sku.name] the sku name. - * - * @param {string} [parameters.sku.tier] the sku tier. - * - * @param {number} [parameters.sku.capacity] the sku capacity. - * - * @param {object} [parameters.upgradePolicy] the upgrade policy. - * - * @param {string} [parameters.upgradePolicy.mode] the upgrade mode. Possible - * values include: 'Automatic', 'Manual' - * - * @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.computerNamePrefix] the - * computer name prefix. - * - * @param {string} [parameters.virtualMachineProfile.osProfile.adminUsername] - * the admin user name. - * - * @param {string} [parameters.virtualMachineProfile.osProfile.adminPassword] - * the admin user password. - * - * @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] - * whether VM Agent should be provisioned on the Virtual Machine. - * - * @param {boolean} - * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] - * whether Windows updates are automatically installed on the VM - * - * @param {string} - * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] - * the Time Zone of the VM - * - * @param {array} - * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] - * the additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file. - * - * @param {object} - * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] - * the Windows Remote Management configuration of the VM - * - * @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] - * whether Authentication using user name and password is allowed or not - * - * @param {object} - * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] the - * SSH configuration for linux VMs - * - * @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] the - * image offer. - * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] the - * image sku. - * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.imageReference.version] - * the image version. The allowed formats are Major.Minor.Build or 'latest'. - * Major, Minor and Build being decimal numbers. Specify 'latest' to use the - * latest version of image. - * - * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] - * the OS disk. - * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.osDisk.name] the disk - * name. - * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] the - * caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.osDisk.createOption] the - * create option. Possible values include: 'fromImage', 'empty', 'attach' - * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] the - * Operating System type. Possible values include: 'Windows', 'Linux' - * - * @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] the - * virtual hard disk's uri. It should be a valid Uri to a virtual hard disk. - * - * @param {array} - * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] the - * list of virtual hard disk container uris. - * - * @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.extensionProfile] the - * virtual machine scale set extension profile. - * - * @param {array} - * [parameters.virtualMachineProfile.extensionProfile.extensions] the virtual - * machine scale set child extension resources. - * - * @param {boolean} [parameters.overProvision] Specifies whether the Virtual - * Machine Scale Set should be overprovisioned. - * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -1624,26 +1452,32 @@ export interface VirtualMachineScaleSets { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - createOrUpdate(resourceGroupName: string, name: string, parameters: models.VirtualMachineScaleSet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, name: string, parameters: models.VirtualMachineScaleSet, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAllNext(nextPageLink: string, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualMachineScaleSets + * __NOTE__: An instance of this class is automatically created for an + * instance of the ComputeManagementClient. + */ +export interface VirtualMachineScaleSets { /** - * Allows you to create or update a virtual machine scale set by providing - * parameters or a path to pre-configured parameter file. + * Create or update a VM scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name Parameters supplied to the Create Virtual Machine - * Scale Set operation. + * @param {string} name The name of the VM scale set to create or update. * - * @param {object} parameters Parameters supplied to the Create Virtual - * Machine Scale Set operation. + * @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.name] The sku name. * - * @param {string} [parameters.sku.tier] the sku tier. + * @param {string} [parameters.sku.tier] The sku tier. * * @param {number} [parameters.sku.capacity] the sku capacity. * @@ -1677,28 +1511,30 @@ export interface VirtualMachineScaleSets { * * @param {boolean} * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] - * whether VM Agent should be provisioned on the Virtual Machine. + * Indicates whether the virtual machine agent should be provisioned on the + * Virtual Machine. If not specified, then the default behavior is to set it + * to true. * * @param {boolean} * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] - * whether Windows updates are automatically installed on the VM + * Indicates whether Windows updates are automatically installed on the VM. * * @param {string} * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] - * the Time Zone of the VM + * The Time Zone of the VM * * @param {array} * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] - * the additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file. + * Additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file. * * @param {object} * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] - * the Windows Remote Management configuration of the VM + * The Windows Remote Management configuration of the VM * * @param {array} * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] - * the list of Windows Remote Management listeners + * The list of Windows Remote Management listeners * * @param {object} * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] the Linux @@ -1706,15 +1542,15 @@ export interface VirtualMachineScaleSets { * * @param {boolean} * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] - * whether Authentication using user name and password is allowed or not + * Specifies whether password authentication should be disabled. * * @param {object} - * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] the - * SSH configuration for linux VMs + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] The + * SSH configuration for linux VMs. * * @param {array} * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] - * the list of SSH public keys used to authenticate with linux based VMs + * 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. @@ -1728,35 +1564,34 @@ export interface VirtualMachineScaleSets { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] - * the image publisher. + * The image publisher. * * @param {string} - * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] the + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] The * image offer. * * @param {string} - * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] the - * image sku. + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. * * @param {string} * [parameters.virtualMachineProfile.storageProfile.imageReference.version] - * the image version. The allowed formats are Major.Minor.Build or 'latest'. + * The image version. The allowed formats are Major.Minor.Build or 'latest'. * Major, Minor and Build being decimal numbers. Specify 'latest' to use the - * latest version of image. + * latest version of the image. * * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] * the OS disk. * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.osDisk.name] the disk - * name. + * @param {string} parameters.virtualMachineProfile.storageProfile.osDisk.name + * the disk name. * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] the * caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' * * @param {string} - * [parameters.virtualMachineProfile.storageProfile.osDisk.createOption] the + * parameters.virtualMachineProfile.storageProfile.osDisk.createOption the * create option. Possible values include: 'fromImage', 'empty', 'attach' * * @param {string} @@ -1766,7 +1601,7 @@ export interface VirtualMachineScaleSets { * @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 + * using it to attach to the Virtual Machine. If SourceImage is provided, the * destination VirtualHardDisk should not exist. * * @param {string} @@ -1791,12 +1626,12 @@ export interface VirtualMachineScaleSets { * [parameters.virtualMachineProfile.extensionProfile.extensions] the virtual * machine scale set child extension resources. * - * @param {boolean} [parameters.overProvision] Specifies whether the Virtual + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * - * @param {string} [parameters.location] Resource location + * @param {string} parameters.location Resource location. * - * @param {object} [parameters.tags] Resource tags + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1806,18 +1641,17 @@ export interface VirtualMachineScaleSets { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginCreateOrUpdate(resourceGroupName: string, name: string, parameters: models.VirtualMachineScaleSet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, name: string, parameters: models.VirtualMachineScaleSet, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, name: string, parameters: models.VirtualMachineScaleSet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, name: string, parameters: models.VirtualMachineScaleSet, callback: ServiceCallback): void; /** - * Allows you to deallocate virtual machines in a virtual machine 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 uses. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {object} [options] Optional Parameters. * @@ -1834,35 +1668,29 @@ export interface VirtualMachineScaleSets { deallocate(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; /** - * Allows you to deallocate virtual machines in a virtual machine 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 uses. + * Deletes a VM scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the virtual machine scale set. + * @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. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginDeallocate(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginDeallocate(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; /** - * Allows you to delete a virtual machine scale set. + * Display information about a virtual machine scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {object} [options] Optional Parameters. * @@ -1872,15 +1700,17 @@ export interface VirtualMachineScaleSets { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - deleteMethod(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; /** - * Allows you to delete a virtual machine scale set. + * Deletes virtual machines in a VM scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the virtual machine scale set. + * @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. * @@ -1890,15 +1720,15 @@ export interface VirtualMachineScaleSets { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + deleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; /** - * Display information about a virtual machine scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {object} [options] Optional Parameters. * @@ -1908,18 +1738,31 @@ export interface VirtualMachineScaleSets { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - get(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - get(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + getInstanceView(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getInstanceView(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; /** - * Allows you to delete virtual machines in a virtual machine scale set. + * Gets a list of all VM scale sets under a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the virtual machine scale set. + * @param {object} [options] Optional Parameters. * - * @param {array} instanceIds the virtual machine scale set instance ids. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: 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 not null to fetch + * all the VM Scale Sets. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1928,87 +1771,301 @@ export interface VirtualMachineScaleSets { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - deleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - deleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; + listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listAll(callback: ServiceCallback): void; /** - * Allows you to delete virtual machines in a virtual machine scale set. + * 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 virtual machine scale set. + * @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} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + listSkus(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listSkus(resourceGroupName: string, vmScaleSetName: 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. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginDeleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginDeleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; /** - * Displays status of a virtual machine scale set instance. + * 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 virtual machine scale set. + * @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. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - getInstanceView(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - getInstanceView(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; /** - * Lists all virtual machine scale sets under a resource group. + * 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. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - list(resourceGroupName: string, callback: ServiceCallback): void; + start(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + start(resourceGroupName: string, vmScaleSetName: 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 + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + updateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; /** - * Lists all Virtual Machine Scale Sets in the subscription. Use nextLink - * property in the response to get the next page of Virtual Machine Scale - * Sets. Do this till nextLink is not null to fetch all the Virtual Machine - * Scale Sets. + * 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 {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + reimage(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + reimage(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + + /** + * Create or update a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} name 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] The sku tier. + * + * @param {number} [parameters.sku.capacity] the sku capacity. + * + * @param {object} [parameters.upgradePolicy] the upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] the upgrade mode. Possible + * values include: 'Automatic', 'Manual' + * + * @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.computerNamePrefix] the + * computer name prefix. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminUsername] + * the admin user name. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminPassword] + * the admin user password. + * + * @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 the virtual machine agent should be provisioned on the + * Virtual Machine. If not specified, then the default behavior is to set it + * to true. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether Windows updates are automatically installed on the VM. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * The Time Zone of the VM + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * The Windows Remote Management configuration of the VM + * + * @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] The + * SSH configuration for linux VMs. + * + * @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] The + * image offer. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * The image version. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor and Build being decimal numbers. Specify 'latest' to use the + * latest version of the image. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] + * the OS disk. + * + * @param {string} parameters.virtualMachineProfile.storageProfile.osDisk.name + * the disk name. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] the + * caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * + * @param {string} + * parameters.virtualMachineProfile.storageProfile.osDisk.createOption the + * create option. Possible values include: 'fromImage', 'empty', 'attach' + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] the + * Operating System type. Possible values include: 'Windows', 'Linux' + * + * @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] the + * virtual hard disk's uri. It should be a valid Uri to a virtual hard disk. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] the + * list of virtual hard disk container uris. + * + * @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.extensionProfile] the + * virtual machine scale set extension profile. * - * @param {ServiceCallback} [callback] callback function; see ServiceCallback - * doc in ms-rest index.d.ts for details - */ - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - listAll(callback: ServiceCallback): void; - - /** - * Displays available skus for your virtual machine scale set including the - * minimum and maximum vm instances allowed for a particular sku. - * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] the virtual + * machine scale set child extension resources. * - * @param {string} vmScaleSetName The name of the virtual machine scale set. + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -2018,17 +2075,17 @@ export interface VirtualMachineScaleSets { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - listSkus(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - listSkus(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, name: string, parameters: models.VirtualMachineScaleSet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, name: string, parameters: models.VirtualMachineScaleSet, callback: ServiceCallback): void; /** - * Allows you to power off (stop) virtual machines in a virtual machine scale - * set. Note that resources are still attached and you are getting charged - * for the resources. Use deallocate to release resources. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {object} [options] Optional Parameters. * @@ -2041,43 +2098,37 @@ export interface VirtualMachineScaleSets { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - powerOff(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - powerOff(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; /** - * Allows you to power off (stop) virtual machines in a virtual machine scale - * set. Note that resources are still attached and you are getting charged - * for the resources. Use deallocate to release resources. + * Deletes a VM scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the virtual machine scale set. + * @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. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginPowerOff(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginPowerOff(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; /** - * Allows you to restart virtual machines in a virtual machine scale set. + * Deletes virtual machines in a VM scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {object} [options] Optional Parameters. + * @param {array} instanceIds the virtual machine scale set instance ids. * - * @param {array} [options.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 @@ -2085,15 +2136,17 @@ export interface VirtualMachineScaleSets { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - restart(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - restart(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginDeleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; /** - * Allows you to restart virtual machines in a virtual machine scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {object} [options] Optional Parameters. * @@ -2106,15 +2159,15 @@ export interface VirtualMachineScaleSets { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginRestart(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginRestart(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; /** - * Allows you to start virtual machines in a virtual machine scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {object} [options] Optional Parameters. * @@ -2127,15 +2180,15 @@ export interface VirtualMachineScaleSets { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - start(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - start(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmScaleSetName: string, options: { instanceIds? : string[], customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; /** - * Allows you to start virtual machines in a virtual machine scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {object} [options] Optional Parameters. * @@ -2152,33 +2205,12 @@ export interface VirtualMachineScaleSets { beginStart(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; /** - * Allows you to manually upgrade virtual machines in a virtual machine scale - * set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmScaleSetName The name of the virtual machine 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} [callback] callback function; see ServiceCallback - * doc in ms-rest index.d.ts for details - */ - updateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - updateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; - - /** - * Allows you to manually upgrade virtual machines in a virtual machine scale - * set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {array} instanceIds the virtual machine scale set instance ids. * @@ -2194,31 +2226,12 @@ export interface VirtualMachineScaleSets { beginUpdateInstances(resourceGroupName: string, vmScaleSetName: string, instanceIds: string[], callback: ServiceCallback): void; /** - * Allows you to re-image(update the version of the installed operating - * system) virtual machines in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmScaleSetName The name of the virtual machine scale set. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [callback] callback function; see ServiceCallback - * doc in ms-rest index.d.ts for details - */ - reimage(resourceGroupName: string, vmScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - reimage(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; - - /** - * Allows you to re-image(update the version of the installed operating - * system) virtual machines in a virtual machine scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {object} [options] Optional Parameters. * @@ -2232,7 +2245,7 @@ export interface VirtualMachineScaleSets { beginReimage(resourceGroupName: string, vmScaleSetName: string, callback: ServiceCallback): void; /** - * Lists all virtual machine scale sets under a resource group. + * 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. @@ -2249,10 +2262,10 @@ export interface VirtualMachineScaleSets { listNext(nextPageLink: string, callback: ServiceCallback): void; /** - * Lists all Virtual Machine Scale Sets in the subscription. Use nextLink - * property in the response to get the next page of Virtual Machine Scale - * Sets. Do this till nextLink is not null to fetch all the Virtual Machine - * Scale Sets. + * 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 not null to fetch + * all the VM Scale Sets. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2269,8 +2282,8 @@ export interface VirtualMachineScaleSets { listAllNext(nextPageLink: string, callback: ServiceCallback): void; /** - * Displays available skus for your virtual machine scale set including the - * minimum and maximum vm instances allowed for a particular sku. + * 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. @@ -2296,14 +2309,14 @@ export interface VirtualMachineScaleSets { export interface VirtualMachineScaleSetVMs { /** - * Allows you to re-image(update the version of the installed operating - * system) a virtual machine scale set instance. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2317,14 +2330,16 @@ export interface VirtualMachineScaleSetVMs { reimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; /** - * Allows you to re-image(update the version of the installed operating - * system) a virtual machine scale set instance. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2334,19 +2349,17 @@ export interface VirtualMachineScaleSetVMs { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginReimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginReimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + deallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; /** - * Allows you to deallocate a virtual machine scale set virtual machine. Shuts - * down the virtual machine and releases the compute resources. You are not - * billed for the compute resources that this virtual machine uses. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2356,19 +2369,17 @@ export interface VirtualMachineScaleSetVMs { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - deallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - deallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; /** - * Allows you to deallocate a virtual machine scale set virtual machine. Shuts - * down the virtual machine and releases the compute resources. You are not - * billed for the compute resources that this virtual machine uses. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2378,17 +2389,17 @@ export interface VirtualMachineScaleSetVMs { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginDeallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginDeallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + get(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; /** - * Allows you to delete a virtual machine scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2398,37 +2409,44 @@ export interface VirtualMachineScaleSetVMs { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - deleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + getInstanceView(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getInstanceView(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; /** - * Allows you to delete a virtual machine scale set. + * Gets a list of all virtual machines in a VM scale sets. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the virtual machine scale set. - * - * @param {string} instanceId The instance id of the virtual machine. + * @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} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + list(resourceGroupName: string, virtualMachineScaleSetName: string, options: { filter? : string, select? : string, expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, virtualMachineScaleSetName: string, callback: ServiceCallback): void; /** - * Displays information about a virtual machine scale set virtual machine. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2438,17 +2456,17 @@ export interface VirtualMachineScaleSetVMs { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - get(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - get(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + powerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; /** - * Displays the status of a virtual machine scale set virtual machine. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2458,25 +2476,19 @@ export interface VirtualMachineScaleSetVMs { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - getInstanceView(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - getInstanceView(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + restart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; /** - * Lists all virtual machines in a VM scale sets. + * Starts a virtual machine in a VM scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} [options.select] The list parameters. + * @param {string} instanceId The instance ID of the virtual machine. * - * @param {string} [options.expand] The expand expression to apply on the - * operation. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2484,17 +2496,18 @@ export interface VirtualMachineScaleSetVMs { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - list(resourceGroupName: string, virtualMachineScaleSetName: string, options: { filter? : string, select? : string, expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - list(resourceGroupName: string, virtualMachineScaleSetName: string, callback: ServiceCallback): void; + start(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + start(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; /** - * Allows you to power off (stop) a virtual machine in a VM scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2504,17 +2517,20 @@ export interface VirtualMachineScaleSetVMs { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - powerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - powerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginReimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginReimage(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; /** - * Allows you to power off (stop) a virtual machine in a VM scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2524,17 +2540,17 @@ export interface VirtualMachineScaleSetVMs { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginPowerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginPowerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeallocate(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; /** - * Allows you to restart a virtual machine in a VM scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2544,17 +2560,19 @@ export interface VirtualMachineScaleSetVMs { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - restart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - restart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; /** - * Allows you to restart a virtual machine in a VM scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2564,17 +2582,17 @@ export interface VirtualMachineScaleSetVMs { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginRestart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginRestart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginPowerOff(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; /** - * Allows you to start a virtual machine in a VM scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2584,17 +2602,17 @@ export interface VirtualMachineScaleSetVMs { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - start(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - start(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; /** - * Allows you to start a virtual machine in a VM scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -2608,7 +2626,7 @@ export interface VirtualMachineScaleSetVMs { beginStart(resourceGroupName: string, vmScaleSetName: string, instanceId: string, callback: ServiceCallback): void; /** - * Lists all virtual machines in a VM scale sets. + * 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. @@ -2627,70 +2645,109 @@ export interface VirtualMachineScaleSetVMs { /** * @class - * ContainerServiceOperations + * ContainerServices * __NOTE__: An instance of this class is automatically created for an * instance of the ComputeManagementClient. */ -export interface ContainerServiceOperations { +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 + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(callback: ServiceCallback): void; /** - * The operation to create or update a container service. + * @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 - * within the given subscription and 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 Parameters supplied to the Create Container - * Service operation. + * @param {object} [parameters.orchestratorProfile] Properties of the + * orchestrator. * - * @param {object} [parameters.orchestratorProfile] Properties of 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' * - * @param {string} [parameters.orchestratorProfile.orchestratorType] Specifies - * what orchestrator will be used to manage container cluster resources. - * Possible values include: 'Swarm', 'DCOS' + * @param {object} [parameters.customProfile] Properties for custom clusters. * - * @param {object} [parameters.masterProfile] Properties of master agents + * @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 cluster + * 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 FQDN for master + * @param {string} parameters.masterProfile.dnsPrefix DNS prefix to be used to + * create the FQDN for master. * - * @param {array} [parameters.agentPoolProfiles] Properties of agent pools + * @param {array} parameters.agentPoolProfiles Properties of the agent pool. * - * @param {object} [parameters.windowsProfile] Properties of Windows VMs + * @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.adminUsername The administrator + * user name to use for Windows VMs. * - * @param {string} [parameters.windowsProfile.adminPassword] The administrator - * password to use for Windows VMs + * @param {string} parameters.windowsProfile.adminPassword The administrator + * password to use for Windows VMs. * - * @param {object} [parameters.linuxProfile] Properties for Linux VMs + * @param {object} parameters.linuxProfile Properties of Linux VMs. * - * @param {string} [parameters.linuxProfile.adminUsername] The administrator - * username to use for all Linux VMs + * @param {string} parameters.linuxProfile.adminUsername The administrator + * user name to use for Linux VMs. * - * @param {object} [parameters.linuxProfile.ssh] Specifies the ssh key - * configuration 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 {array} parameters.linuxProfile.ssh.publicKeys The list of SSH + * public keys used to authenticate with Linux-based VMs. * - * @param {object} [parameters.diagnosticsProfile] Properties for Diagnostic - * Agent + * @param {object} [parameters.diagnosticsProfile] Properties of the + * diagnostic agent. * - * @param {object} [parameters.diagnosticsProfile.vmDiagnostics] Profile for - * container service VM diagnostic agent + * @param {object} parameters.diagnosticsProfile.vmDiagnostics Profile for the + * container service VM diagnostic agent. * - * @param {boolean} [parameters.diagnosticsProfile.vmDiagnostics.enabled] - * whether VM Diagnostic Agent should be provisioned on the Virtual Machine. + * @param {boolean} parameters.diagnosticsProfile.vmDiagnostics.enabled + * Whether the VM diagnostic agent is provisioned on the VM. * - * @param {string} [parameters.location] Resource location + * @param {string} parameters.location Resource location. * - * @param {object} [parameters.tags] Resource tags + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -2704,82 +2761,154 @@ export interface ContainerServiceOperations { createOrUpdate(resourceGroupName: string, containerServiceName: string, parameters: models.ContainerService, callback: ServiceCallback): void; /** - * The operation to create or update a container service. + * @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 - * within the given subscription and 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 {object} parameters Parameters supplied to the Create Container - * Service operation. + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + get(resourceGroupName: string, containerServiceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, containerServiceName: 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 {object} [parameters.orchestratorProfile] Properties of orchestrator + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. * - * @param {string} [parameters.orchestratorProfile.orchestratorType] Specifies - * what orchestrator will be used to manage container cluster resources. - * Possible values include: 'Swarm', 'DCOS' + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.masterProfile] Properties of master agents + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [parameters.masterProfile.count] Number of masters (VMs) in - * the container cluster + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + deleteMethod(resourceGroupName: string, containerServiceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, containerServiceName: 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 {string} [parameters.masterProfile.dnsPrefix] DNS prefix to be used - * to create FQDN for master + * @param {object} [options] Optional Parameters. * - * @param {array} [parameters.agentPoolProfiles] Properties of agent pools + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.windowsProfile] Properties of Windows VMs + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: 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} [parameters.windowsProfile.adminUsername] The administrator - * username to use for Windows VMs + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. * - * @param {string} [parameters.windowsProfile.adminPassword] The administrator - * password to use for Windows VMs + * @param {object} parameters Parameters supplied to the Create or Update a + * Container Service operation. * - * @param {object} [parameters.linuxProfile] Properties for Linux VMs + * @param {object} [parameters.orchestratorProfile] Properties of the + * orchestrator. * - * @param {string} [parameters.linuxProfile.adminUsername] The administrator - * username to use for all Linux VMs + * @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' * - * @param {object} [parameters.linuxProfile.ssh] Specifies the ssh key - * configuration for Linux VMs + * @param {object} [parameters.customProfile] Properties for custom clusters. * - * @param {array} [parameters.linuxProfile.ssh.publicKeys] the list of SSH - * public keys used to authenticate with Linux based VMs + * @param {string} parameters.customProfile.orchestrator The name of the + * custom orchestrator to use. * - * @param {object} [parameters.diagnosticsProfile] Properties for Diagnostic - * Agent + * @param {object} [parameters.servicePrincipalProfile] Properties for cluster + * service principals. * - * @param {object} [parameters.diagnosticsProfile.vmDiagnostics] Profile for - * container service VM diagnostic agent + * @param {string} parameters.servicePrincipalProfile.clientId The ID for the + * service principal. * - * @param {boolean} [parameters.diagnosticsProfile.vmDiagnostics.enabled] - * whether VM Diagnostic Agent should be provisioned on the Virtual Machine. + * @param {string} parameters.servicePrincipalProfile.secret The secret + * password associated with the service principal. * - * @param {string} [parameters.location] Resource location + * @param {object} parameters.masterProfile Properties of master agents. * - * @param {object} [parameters.tags] Resource tags + * @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 {object} [options] Optional Parameters. + * @param {string} parameters.masterProfile.dnsPrefix DNS prefix to be used to + * create the FQDN for master. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} parameters.agentPoolProfiles Properties of the agent pool. * - * @param {ServiceCallback} [callback] callback function; see ServiceCallback - * doc in ms-rest index.d.ts for details - */ - beginCreateOrUpdate(resourceGroupName: string, containerServiceName: string, parameters: models.ContainerService, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, containerServiceName: string, parameters: models.ContainerService, callback: ServiceCallback): void; - - /** - * The operation to get a container service. - * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} [parameters.windowsProfile] Properties of Windows VMs. + * + * @param {string} parameters.windowsProfile.adminUsername The administrator + * user name 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 + * user name 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 {string} containerServiceName The name of the container service - * within the given subscription and resource group. + * @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. * @@ -2789,16 +2918,23 @@ export interface ContainerServiceOperations { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - get(resourceGroupName: string, containerServiceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - get(resourceGroupName: string, containerServiceName: string, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, containerServiceName: string, parameters: models.ContainerService, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, containerServiceName: string, parameters: models.ContainerService, callback: ServiceCallback): void; /** - * The operation to delete a container service. + * @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 - * within the given subscription and resource group. + * @param {string} containerServiceName The name of the container service in + * the specified subscription and resource group. * * @param {object} [options] Optional Parameters. * @@ -2808,16 +2944,19 @@ export interface ContainerServiceOperations { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - deleteMethod(resourceGroupName: string, containerServiceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, containerServiceName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, containerServiceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, containerServiceName: string, callback: ServiceCallback): void; /** - * The operation to delete a container service. + * @summary Gets a list of container services in the specified subscription. * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} containerServiceName The name of the container service - * within the given subscription and resource group. + * 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. * @@ -2827,13 +2966,19 @@ export interface ContainerServiceOperations { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - beginDeleteMethod(resourceGroupName: string, containerServiceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, containerServiceName: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, callback: ServiceCallback): void; /** - * The operation to list container services. + * @summary Gets a list of container services in the specified resource group. * - * @param {string} resourceGroupName The name of the 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. * @@ -2843,6 +2988,6 @@ export interface ContainerServiceOperations { * @param {ServiceCallback} [callback] callback function; see ServiceCallback * doc in ms-rest index.d.ts for details */ - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - list(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; } diff --git a/lib/services/computeManagement2/lib/operations/index.js b/lib/services/computeManagement2/lib/operations/index.js index 1727c02ef6..cff9452022 100644 --- a/lib/services/computeManagement2/lib/operations/index.js +++ b/lib/services/computeManagement2/lib/operations/index.js @@ -23,4 +23,4 @@ exports.VirtualMachineSizes = require('./virtualMachineSizes'); exports.VirtualMachines = require('./virtualMachines'); exports.VirtualMachineScaleSets = require('./virtualMachineScaleSets'); exports.VirtualMachineScaleSetVMs = require('./virtualMachineScaleSetVMs'); -exports.ContainerServiceOperations = require('./containerServiceOperations'); +exports.ContainerServices = require('./containerServices'); diff --git a/lib/services/computeManagement2/lib/operations/usageOperations.js b/lib/services/computeManagement2/lib/operations/usageOperations.js index 6e9379a3f7..aeac06f657 100644 --- a/lib/services/computeManagement2/lib/operations/usageOperations.js +++ b/lib/services/computeManagement2/lib/operations/usageOperations.js @@ -30,7 +30,8 @@ function UsageOperations(client) { } /** - * Lists compute usages for a subscription. + * Gets, for the specified location, the current compute usage information as + * well as the limits for compute resources under the subscription. * * @param {string} location The location upon which resource usage is queried. * @@ -84,8 +85,8 @@ UsageOperations.prototype.list = function (location, options, callback) { } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages'; + var baseUrl = this.client.baseUri; + var 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)); var queryParameters = []; @@ -93,9 +94,6 @@ UsageOperations.prototype.list = function (location, options, callback) { if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -175,7 +173,8 @@ UsageOperations.prototype.list = function (location, options, callback) { }; /** - * Lists compute usages for a subscription. + * Gets, for the specified location, the current compute 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. @@ -222,9 +221,6 @@ UsageOperations.prototype.listNext = function (nextPageLink, options, callback) // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineExtensionImages.js b/lib/services/computeManagement2/lib/operations/virtualMachineExtensionImages.js index 59a7aa9344..3c2c2a252a 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineExtensionImages.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineExtensionImages.js @@ -94,8 +94,8 @@ VirtualMachineExtensionImages.prototype.get = function (location, publisherName, } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}'; + var baseUrl = this.client.baseUri; + var 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)); @@ -106,9 +106,6 @@ VirtualMachineExtensionImages.prototype.get = function (location, publisherName, if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -240,8 +237,8 @@ VirtualMachineExtensionImages.prototype.listTypes = function (location, publishe } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types'; + var baseUrl = this.client.baseUri; + var 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)); @@ -250,9 +247,6 @@ VirtualMachineExtensionImages.prototype.listTypes = function (location, publishe if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -421,8 +415,8 @@ VirtualMachineExtensionImages.prototype.listVersions = function (location, publi } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions'; + var baseUrl = this.client.baseUri; + var 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)); @@ -441,9 +435,6 @@ VirtualMachineExtensionImages.prototype.listVersions = function (location, publi if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineExtensions.js b/lib/services/computeManagement2/lib/operations/virtualMachineExtensions.js index 8a618f5d9b..f3b653dc4c 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineExtensions.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineExtensions.js @@ -83,9 +83,9 @@ function VirtualMachineExtensions(client) { * @param {array} [extensionParameters.instanceView.statuses] the resource * status information. * - * @param {string} [extensionParameters.location] Resource location + * @param {string} extensionParameters.location Resource location. * - * @param {object} [extensionParameters.tags] Resource tags + * @param {object} [extensionParameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -157,64 +157,84 @@ VirtualMachineExtensions.prototype.createOrUpdate = function (resourceGroupName, }; /** - * The operation to create or update the extension. + * + * 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 create or updated. + * should be deleted. * * @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] the type - * of the extension handler. - * - * @param {string} [extensionParameters.typeHandlerVersion] the type version - * of the extension handler. - * - * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] whether the - * extension handler should be automatically upgraded across minor versions. - * - * @param {object} [extensionParameters.settings] Json formatted public - * settings for the extension. - * - * @param {object} [extensionParameters.protectedSettings] Json formatted - * protected settings for the extension. - * - * @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] the full type of - * the extension handler which includes both publisher and type. - * - * @param {string} [extensionParameters.instanceView.typeHandlerVersion] the - * type version of the extension handler. + * @param {object} [options] Optional Parameters. * - * @param {array} [extensionParameters.instanceView.substatuses] the resource - * status information. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [extensionParameters.instanceView.statuses] the resource - * status information. + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachineExtensions.prototype.deleteMethod = function (resourceGroupName, vmName, vmExtensionName, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +}; + +/** + * The operation to get the extension. + * + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [extensionParameters.location] Resource location + * @param {string} vmName The name of the virtual machine containing the + * extension. * - * @param {object} [extensionParameters.tags] Resource tags + * @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 * @@ -232,7 +252,7 @@ VirtualMachineExtensions.prototype.createOrUpdate = function (resourceGroupName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachineExtensions.prototype.beginCreateOrUpdate = function (resourceGroupName, vmName, vmExtensionName, extensionParameters, options, callback) { +VirtualMachineExtensions.prototype.get = function (resourceGroupName, vmName, vmExtensionName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -241,6 +261,7 @@ VirtualMachineExtensions.prototype.beginCreateOrUpdate = function (resourceGroup if (!callback) { throw new Error('callback cannot be null.'); } + var expand = (options && options.expand !== undefined) ? options.expand : undefined; var apiVersion = '2016-03-30'; // Validate try { @@ -253,8 +274,8 @@ VirtualMachineExtensions.prototype.beginCreateOrUpdate = function (resourceGroup 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 (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.'); @@ -267,24 +288,24 @@ VirtualMachineExtensions.prototype.beginCreateOrUpdate = function (resourceGroup } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'; + var baseUrl = this.client.baseUri; + var 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)); var queryParameters = []; + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -302,28 +323,14 @@ VirtualMachineExtensions.prototype.beginCreateOrUpdate = function (resourceGroup } } httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - // Serialize Request - var requestContent = null; - var requestModel = null; - try { - if (extensionParameters !== null && extensionParameters !== undefined) { - var requestModelMapper = new client.models['VirtualMachineExtension']().mapper(); - requestModel = client.serialize(requestModelMapper, extensionParameters, 'extensionParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + - 'payload - "%s"', error.message, util.inspect(extensionParameters, {depth: null}))); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, function (err, response, responseBody) { if (err) { return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 200) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -368,101 +375,67 @@ VirtualMachineExtensions.prototype.beginCreateOrUpdate = function (resourceGroup return callback(deserializationError); } } - // Deserialize Response - if (statusCode === 201) { - var parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineExtension']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - var deserializationError1 = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, 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. + * 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 deleted. + * should be create or updated. * * @param {string} vmExtensionName The name of the virtual machine extension. * - * @param {object} [options] Optional Parameters. + * @param {object} extensionParameters Parameters supplied to the Create + * Virtual Machine Extension operation. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [extensionParameters.forceUpdateTag] how the extension + * handler should be forced to update even if the extension configuration has + * not changed. * - * @param {function} callback - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachineExtensions.prototype.deleteMethod = function (resourceGroupName, vmName, vmExtensionName, options, callback) { - var 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, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - -/** - * The operation to delete the extension. - * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [extensionParameters.publisher] the name of the extension + * handler publisher. * - * @param {string} vmName The name of the virtual machine where the extension - * should be deleted. + * @param {string} [extensionParameters.virtualMachineExtensionType] the type + * of the extension handler. * - * @param {string} vmExtensionName The name of the virtual machine extension. + * @param {string} [extensionParameters.typeHandlerVersion] the type version + * of the extension handler. + * + * @param {boolean} [extensionParameters.autoUpgradeMinorVersion] whether the + * extension handler should be automatically upgraded across minor versions. + * + * @param {object} [extensionParameters.settings] Json formatted public + * settings for the extension. + * + * @param {object} [extensionParameters.protectedSettings] Json formatted + * protected settings for the extension. + * + * @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] the full type of + * the extension handler which includes both publisher and type. + * + * @param {string} [extensionParameters.instanceView.typeHandlerVersion] the + * type version of the extension 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. * @@ -475,13 +448,15 @@ VirtualMachineExtensions.prototype.deleteMethod = function (resourceGroupName, v * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object. + * {object} [result] - The deserialized result object. + * 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. */ -VirtualMachineExtensions.prototype.beginDeleteMethod = function (resourceGroupName, vmName, vmExtensionName, options, callback) { +VirtualMachineExtensions.prototype.beginCreateOrUpdate = function (resourceGroupName, vmName, vmExtensionName, extensionParameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -502,6 +477,9 @@ VirtualMachineExtensions.prototype.beginDeleteMethod = function (resourceGroupNa 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.'); } @@ -513,8 +491,8 @@ VirtualMachineExtensions.prototype.beginDeleteMethod = function (resourceGroupNa } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'; + var baseUrl = this.client.baseUri; + var 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)); @@ -524,13 +502,10 @@ VirtualMachineExtensions.prototype.beginDeleteMethod = function (resourceGroupNa if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'PUT'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -548,14 +523,28 @@ VirtualMachineExtensions.prototype.beginDeleteMethod = function (resourceGroupNa } } httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - httpRequest.body = null; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (extensionParameters !== null && extensionParameters !== undefined) { + var requestModelMapper = new client.models['VirtualMachineExtension']().mapper(); + requestModel = client.serialize(requestModelMapper, extensionParameters, 'extensionParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(extensionParameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, function (err, response, responseBody) { if (err) { return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 201) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -569,6 +558,10 @@ VirtualMachineExtensions.prototype.beginDeleteMethod = function (resourceGroupNa if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -579,26 +572,57 @@ VirtualMachineExtensions.prototype.beginDeleteMethod = function (resourceGroupNa // Create Result var result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['VirtualMachineExtension']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['VirtualMachineExtension']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError1 = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } return callback(null, result, httpRequest, response); }); }; /** - * The operation to get the extension. + * The operation to delete 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} 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 {string} [options.expand] The expand expression to apply on the - * operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -608,15 +632,13 @@ VirtualMachineExtensions.prototype.beginDeleteMethod = function (resourceGroupNa * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object. - * See {@link VirtualMachineExtension} for more - * information. + * {null} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachineExtensions.prototype.get = function (resourceGroupName, vmName, vmExtensionName, options, callback) { +VirtualMachineExtensions.prototype.beginDeleteMethod = function (resourceGroupName, vmName, vmExtensionName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -625,7 +647,6 @@ VirtualMachineExtensions.prototype.get = function (resourceGroupName, vmName, vm if (!callback) { throw new Error('callback cannot be null.'); } - var expand = (options && options.expand !== undefined) ? options.expand : undefined; var apiVersion = '2016-03-30'; // Validate try { @@ -638,9 +659,6 @@ VirtualMachineExtensions.prototype.get = function (resourceGroupName, vmName, vm 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.'); } @@ -652,27 +670,21 @@ VirtualMachineExtensions.prototype.get = function (resourceGroupName, vmName, vm } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}'; + var baseUrl = this.client.baseUri; + var 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)); var queryParameters = []; - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -697,7 +709,7 @@ VirtualMachineExtensions.prototype.get = function (resourceGroupName, vmName, vm return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 202 && statusCode !== 204) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -711,10 +723,6 @@ VirtualMachineExtensions.prototype.get = function (resourceGroupName, vmName, vm if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - var resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -725,23 +733,6 @@ VirtualMachineExtensions.prototype.get = function (resourceGroupName, vmName, vm // Create Result var result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - var parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineExtension']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineImages.js b/lib/services/computeManagement2/lib/operations/virtualMachineImages.js index e21eb01eb9..a47f99a309 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineImages.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineImages.js @@ -32,15 +32,15 @@ function VirtualMachineImages(client) { /** * Gets a virtual machine image. * - * @param {string} location + * @param {string} location The name of a supported Azure region. * - * @param {string} publisherName + * @param {string} publisherName A valid image publisher. * - * @param {string} offer + * @param {string} offer A valid image publisher offer. * - * @param {string} skus + * @param {string} skus A valid image SKU. * - * @param {string} version + * @param {string} version A valid image SKU version. * * @param {object} [options] Optional Parameters. * @@ -98,8 +98,8 @@ VirtualMachineImages.prototype.get = function (location, publisherName, offer, s } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}'; + var baseUrl = this.client.baseUri; + var 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)); @@ -111,9 +111,6 @@ VirtualMachineImages.prototype.get = function (location, publisherName, offer, s if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -193,15 +190,16 @@ VirtualMachineImages.prototype.get = function (location, publisherName, offer, s }; /** - * Gets a list of virtual machine images. + * Gets a list of all virtual machine image versions for the specified + * location, publisher, offer, and SKU. * - * @param {string} location + * @param {string} location The name of a supported Azure region. * - * @param {string} publisherName + * @param {string} publisherName A valid image publisher. * - * @param {string} offer + * @param {string} offer A valid image publisher offer. * - * @param {string} skus + * @param {string} skus A valid image SKU. * * @param {object} [options] Optional Parameters. * @@ -273,8 +271,8 @@ VirtualMachineImages.prototype.list = function (location, publisherName, offer, } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions'; + var baseUrl = this.client.baseUri; + var 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)); @@ -294,9 +292,6 @@ VirtualMachineImages.prototype.list = function (location, publisherName, offer, if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -390,11 +385,12 @@ VirtualMachineImages.prototype.list = function (location, publisherName, offer, }; /** - * Gets a list of virtual machine image offers. + * Gets a list of virtual machine image offers for the specified location and + * publisher. * - * @param {string} location + * @param {string} location The name of a supported Azure region. * - * @param {string} publisherName + * @param {string} publisherName A valid image publisher. * * @param {object} [options] Optional Parameters. * @@ -442,8 +438,8 @@ VirtualMachineImages.prototype.listOffers = function (location, publisherName, o } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers'; + var baseUrl = this.client.baseUri; + var 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)); @@ -452,9 +448,6 @@ VirtualMachineImages.prototype.listOffers = function (location, publisherName, o if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -548,9 +541,10 @@ VirtualMachineImages.prototype.listOffers = function (location, publisherName, o }; /** - * Gets a list of virtual machine image publishers. + * Gets a list of virtual machine image publishers for the specified Azure + * location. * - * @param {string} location + * @param {string} location The name of a supported Azure region. * * @param {object} [options] Optional Parameters. * @@ -595,8 +589,8 @@ VirtualMachineImages.prototype.listPublishers = function (location, options, cal } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers'; + var baseUrl = this.client.baseUri; + var 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)); var queryParameters = []; @@ -604,9 +598,6 @@ VirtualMachineImages.prototype.listPublishers = function (location, options, cal if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -700,13 +691,14 @@ VirtualMachineImages.prototype.listPublishers = function (location, options, cal }; /** - * Gets a list of virtual machine image skus. + * Gets a list of virtual machine image SKUs for the specified location, + * publisher, and offer. * - * @param {string} location + * @param {string} location The name of a supported Azure region. * - * @param {string} publisherName + * @param {string} publisherName A valid image publisher. * - * @param {string} offer + * @param {string} offer A valid image publisher offer. * * @param {object} [options] Optional Parameters. * @@ -757,8 +749,8 @@ VirtualMachineImages.prototype.listSkus = function (location, publisherName, off } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus'; + var baseUrl = this.client.baseUri; + var 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)); @@ -768,9 +760,6 @@ VirtualMachineImages.prototype.listSkus = function (location, publisherName, off if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetVMs.js b/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetVMs.js index fa12b38142..c739b3ae0c 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetVMs.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineScaleSetVMs.js @@ -31,14 +31,14 @@ function VirtualMachineScaleSetVMs(client) { /** * - * Allows you to re-image(update the version of the installed operating - * system) a virtual machine scale set instance. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -94,14 +94,17 @@ VirtualMachineScaleSetVMs.prototype.reimage = function (resourceGroupName, vmSca }; /** - * Allows you to re-image(update the version of the installed operating - * system) a virtual machine scale set instance. + * + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -120,120 +123,51 @@ VirtualMachineScaleSetVMs.prototype.reimage = function (resourceGroupName, vmSca * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachineScaleSetVMs.prototype.beginReimage = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { +VirtualMachineScaleSetVMs.prototype.deallocate = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - var apiVersion = '2016-03-30'; - // 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 - var requestUrl = this.client.baseUri + - '//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)); - var queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); + // Send request + this.beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.headers = {}; - httpRequest.url = requestUrl; - // Set Headers - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(var headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, function (err, response, responseBody) { - if (err) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode !== 202) { - var error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - var parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + - '- "%s" for the default response.', defaultError.message, responseBody); - return callback(error); - } - return callback(error); - } - // Create Result - var result = null; - if (responseBody === '') responseBody = null; - return callback(null, result, httpRequest, response); + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); }); }; /** * - * Allows you to deallocate a virtual machine scale set virtual machine. Shuts - * down the virtual machine and releases the compute resources. You are not - * billed for the compute resources that this virtual machine uses. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -252,7 +186,7 @@ VirtualMachineScaleSetVMs.prototype.beginReimage = function (resourceGroupName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachineScaleSetVMs.prototype.deallocate = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { +VirtualMachineScaleSetVMs.prototype.deleteMethod = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -264,7 +198,7 @@ VirtualMachineScaleSetVMs.prototype.deallocate = function (resourceGroupName, vm } // Send request - this.beginDeallocate(resourceGroupName, vmScaleSetName, instanceId, options, function (err, parsedResult, httpRequest, response){ + this.beginDeleteMethod(resourceGroupName, vmScaleSetName, instanceId, options, function (err, parsedResult, httpRequest, response){ if (err) return callback(err); var initialResult = new msRest.HttpOperationResponse(); @@ -289,15 +223,13 @@ VirtualMachineScaleSetVMs.prototype.deallocate = function (resourceGroupName, vm }; /** - * Allows you to deallocate a virtual machine scale set virtual machine. Shuts - * down the virtual machine and releases the compute resources. You are not - * billed for the compute resources that this virtual machine uses. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -310,13 +242,15 @@ VirtualMachineScaleSetVMs.prototype.deallocate = function (resourceGroupName, vm * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object. + * {object} [result] - The deserialized result object. + * 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. */ -VirtualMachineScaleSetVMs.prototype.beginDeallocate = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { +VirtualMachineScaleSetVMs.prototype.get = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -348,8 +282,8 @@ VirtualMachineScaleSetVMs.prototype.beginDeallocate = function (resourceGroupNam } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'; + var baseUrl = this.client.baseUri; + var 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)); @@ -359,13 +293,10 @@ VirtualMachineScaleSetVMs.prototype.beginDeallocate = function (resourceGroupNam if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -390,7 +321,7 @@ VirtualMachineScaleSetVMs.prototype.beginDeallocate = function (resourceGroupNam return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 202) { + if (statusCode !== 200) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -404,6 +335,10 @@ VirtualMachineScaleSetVMs.prototype.beginDeallocate = function (resourceGroupNam if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -414,82 +349,36 @@ VirtualMachineScaleSetVMs.prototype.beginDeallocate = function (resourceGroupNam // Create Result var result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['VirtualMachineScaleSetVM']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); }; /** - * - * Allows you to delete a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmScaleSetName The name of the virtual machine 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 - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachineScaleSetVMs.prototype.deleteMethod = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { - var 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, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - -/** - * Allows you to delete a virtual machine scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -502,13 +391,15 @@ VirtualMachineScaleSetVMs.prototype.deleteMethod = function (resourceGroupName, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object. + * {object} [result] - The deserialized result object. + * 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. */ -VirtualMachineScaleSetVMs.prototype.beginDeleteMethod = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { +VirtualMachineScaleSetVMs.prototype.getInstanceView = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -540,8 +431,8 @@ VirtualMachineScaleSetVMs.prototype.beginDeleteMethod = function (resourceGroupN } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'; + var baseUrl = this.client.baseUri; + var 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)); @@ -551,13 +442,10 @@ VirtualMachineScaleSetVMs.prototype.beginDeleteMethod = function (resourceGroupN if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -582,7 +470,7 @@ VirtualMachineScaleSetVMs.prototype.beginDeleteMethod = function (resourceGroupN return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + if (statusCode !== 200) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -596,6 +484,10 @@ VirtualMachineScaleSetVMs.prototype.beginDeleteMethod = function (resourceGroupN if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -606,22 +498,44 @@ VirtualMachineScaleSetVMs.prototype.beginDeleteMethod = function (resourceGroupN // Create Result var result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['VirtualMachineScaleSetVMInstanceView']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); }; /** - * Displays information about a virtual machine scale set virtual machine. + * Gets a list of all virtual machines in a VM scale sets. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the virtual machine scale set. - * - * @param {string} instanceId The instance id of the virtual machine. + * @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 * @@ -632,14 +546,14 @@ VirtualMachineScaleSetVMs.prototype.beginDeleteMethod = function (resourceGroupN * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object. - * See {@link VirtualMachineScaleSetVM} for more - * information. + * 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. */ -VirtualMachineScaleSetVMs.prototype.get = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { +VirtualMachineScaleSetVMs.prototype.list = function (resourceGroupName, virtualMachineScaleSetName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -648,19 +562,28 @@ VirtualMachineScaleSetVMs.prototype.get = function (resourceGroupName, vmScaleSe if (!callback) { throw new Error('callback cannot be null.'); } + var filter = (options && options.filter !== undefined) ? options.filter : undefined; + var select = (options && options.select !== undefined) ? options.select : undefined; + var expand = (options && options.expand !== undefined) ? options.expand : undefined; var apiVersion = '2016-03-30'; // 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 (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 (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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== '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') { @@ -671,20 +594,25 @@ VirtualMachineScaleSetVMs.prototype.get = function (resourceGroupName, vmScaleSe } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); - requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); var 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('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -748,7 +676,7 @@ VirtualMachineScaleSetVMs.prototype.get = function (resourceGroupName, vmScaleSe parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineScaleSetVM']().mapper(); + var resultMapper = new client.models['VirtualMachineScaleSetVMListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -764,13 +692,16 @@ VirtualMachineScaleSetVMs.prototype.get = function (resourceGroupName, vmScaleSe }; /** - * Displays the status of a virtual machine scale set virtual machine. + * + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -783,15 +714,202 @@ VirtualMachineScaleSetVMs.prototype.get = function (resourceGroupName, vmScaleSe * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object. - * See {@link VirtualMachineScaleSetVMInstanceView} for - * more information. + * {null} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachineScaleSetVMs.prototype.getInstanceView = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { +VirtualMachineScaleSetVMs.prototype.powerOff = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + 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 + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachineScaleSetVMs.prototype.restart = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + 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 + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachineScaleSetVMs.prototype.start = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + 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 + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachineScaleSetVMs.prototype.beginReimage = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -823,8 +941,8 @@ VirtualMachineScaleSetVMs.prototype.getInstanceView = function (resourceGroupNam } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView'; + var baseUrl = this.client.baseUri; + var 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)); @@ -834,13 +952,10 @@ VirtualMachineScaleSetVMs.prototype.getInstanceView = function (resourceGroupNam if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -865,7 +980,7 @@ VirtualMachineScaleSetVMs.prototype.getInstanceView = function (resourceGroupNam return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 202) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -879,10 +994,6 @@ VirtualMachineScaleSetVMs.prototype.getInstanceView = function (resourceGroupNam if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - var resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -893,44 +1004,150 @@ VirtualMachineScaleSetVMs.prototype.getInstanceView = function (resourceGroupNam // Create Result var result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - var parsedResponse = null; + + 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 + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachineScaleSetVMs.prototype.beginDeallocate = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var apiVersion = '2016-03-30'; + // 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 + var baseUrl = this.client.baseUri; + var 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)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 202) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineScaleSetVMInstanceView']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); + 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; + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); } + return callback(error); } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; return callback(null, result, httpRequest, response); }); }; /** - * Lists all virtual machines in a VM scale sets. + * Deletes a virtual machine from a VM scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} [options.select] The list parameters. + * @param {string} instanceId The instance ID of the virtual machine. * - * @param {string} [options.expand] The expand expression to apply on the - * operation. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -941,15 +1158,13 @@ VirtualMachineScaleSetVMs.prototype.getInstanceView = function (resourceGroupNam * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object. - * See {@link VirtualMachineScaleSetVMListResult} for - * more information. + * {null} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachineScaleSetVMs.prototype.list = function (resourceGroupName, virtualMachineScaleSetName, options, callback) { +VirtualMachineScaleSetVMs.prototype.beginDeleteMethod = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -958,26 +1173,17 @@ VirtualMachineScaleSetVMs.prototype.list = function (resourceGroupName, virtualM if (!callback) { throw new Error('callback cannot be null.'); } - var filter = (options && options.filter !== undefined) ? options.filter : undefined; - var select = (options && options.select !== undefined) ? options.select : undefined; - var expand = (options && options.expand !== undefined) ? options.expand : undefined; var apiVersion = '2016-03-30'; // 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 (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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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.'); @@ -990,32 +1196,21 @@ VirtualMachineScaleSetVMs.prototype.list = function (resourceGroupName, virtualM } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); var 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('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -1040,7 +1235,7 @@ VirtualMachineScaleSetVMs.prototype.list = function (resourceGroupName, virtualM return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1054,10 +1249,6 @@ VirtualMachineScaleSetVMs.prototype.list = function (resourceGroupName, virtualM if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - var resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -1068,99 +1259,21 @@ VirtualMachineScaleSetVMs.prototype.list = function (resourceGroupName, virtualM // Create Result var result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - var parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineScaleSetVMListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); }; /** - * - * Allows you to power off (stop) a virtual machine in a VM scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmScaleSetName The name of the virtual machine 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 - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachineScaleSetVMs.prototype.powerOff = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { - var 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, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - -/** - * Allows you to power off (stop) a virtual machine in a VM scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -1211,8 +1324,8 @@ VirtualMachineScaleSetVMs.prototype.beginPowerOff = function (resourceGroupName, } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff'; + var baseUrl = this.client.baseUri; + var 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)); @@ -1222,9 +1335,6 @@ VirtualMachineScaleSetVMs.prototype.beginPowerOff = function (resourceGroupName, if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -1283,76 +1393,13 @@ VirtualMachineScaleSetVMs.prototype.beginPowerOff = function (resourceGroupName, }; /** - * - * Allows you to restart a virtual machine in a VM scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmScaleSetName The name of the virtual machine 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 - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachineScaleSetVMs.prototype.restart = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { - var 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, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - -/** - * Allows you to restart a virtual machine in a VM scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -1403,8 +1450,8 @@ VirtualMachineScaleSetVMs.prototype.beginRestart = function (resourceGroupName, } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart'; + var baseUrl = this.client.baseUri; + var 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)); @@ -1414,9 +1461,6 @@ VirtualMachineScaleSetVMs.prototype.beginRestart = function (resourceGroupName, if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -1475,76 +1519,13 @@ VirtualMachineScaleSetVMs.prototype.beginRestart = function (resourceGroupName, }; /** - * - * Allows you to start a virtual machine in a VM scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmScaleSetName The name of the virtual machine 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 - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachineScaleSetVMs.prototype.start = function (resourceGroupName, vmScaleSetName, instanceId, options, callback) { - var 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, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - -/** - * Allows you to start a virtual machine in a VM scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {string} instanceId The instance id of the virtual machine. + * @param {string} instanceId The instance ID of the virtual machine. * * @param {object} [options] Optional Parameters. * @@ -1595,8 +1576,8 @@ VirtualMachineScaleSetVMs.prototype.beginStart = function (resourceGroupName, vm } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start'; + var baseUrl = this.client.baseUri; + var 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)); @@ -1606,9 +1587,6 @@ VirtualMachineScaleSetVMs.prototype.beginStart = function (resourceGroupName, vm if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -1667,7 +1645,7 @@ VirtualMachineScaleSetVMs.prototype.beginStart = function (resourceGroupName, vm }; /** - * Lists all virtual machines in a VM scale sets. + * 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. @@ -1715,9 +1693,6 @@ VirtualMachineScaleSetVMs.prototype.listNext = function (nextPageLink, options, // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineScaleSets.js b/lib/services/computeManagement2/lib/operations/virtualMachineScaleSets.js index 917d40ac33..730132d1ad 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineScaleSets.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineScaleSets.js @@ -31,22 +31,19 @@ function VirtualMachineScaleSets(client) { /** * - * Allows you to create or update a virtual machine scale set by providing - * parameters or a path to pre-configured parameter file. + * Create or update a VM scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} name Parameters supplied to the Create Virtual Machine - * Scale Set operation. + * @param {string} name The name of the VM scale set to create or update. * - * @param {object} parameters Parameters supplied to the Create Virtual - * Machine Scale Set operation. + * @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.name] The sku name. * - * @param {string} [parameters.sku.tier] the sku tier. + * @param {string} [parameters.sku.tier] The sku tier. * * @param {number} [parameters.sku.capacity] the sku capacity. * @@ -80,28 +77,30 @@ function VirtualMachineScaleSets(client) { * * @param {boolean} * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.provisionVMAgent] - * whether VM Agent should be provisioned on the Virtual Machine. + * Indicates whether the virtual machine agent should be provisioned on the + * Virtual Machine. If not specified, then the default behavior is to set it + * to true. * * @param {boolean} * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] - * whether Windows updates are automatically installed on the VM + * Indicates whether Windows updates are automatically installed on the VM. * * @param {string} * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] - * the Time Zone of the VM + * The Time Zone of the VM * * @param {array} * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] - * the additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file. + * Additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file. * * @param {object} * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] - * the Windows Remote Management configuration of the VM + * The Windows Remote Management configuration of the VM * * @param {array} * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] - * the list of Windows Remote Management listeners + * The list of Windows Remote Management listeners * * @param {object} * [parameters.virtualMachineProfile.osProfile.linuxConfiguration] the Linux @@ -109,15 +108,15 @@ function VirtualMachineScaleSets(client) { * * @param {boolean} * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.disablePasswordAuthentication] - * whether Authentication using user name and password is allowed or not + * Specifies whether password authentication should be disabled. * * @param {object} - * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] the - * SSH configuration for linux VMs + * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] The + * SSH configuration for linux VMs. * * @param {array} * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] - * the list of SSH public keys used to authenticate with linux based VMs + * 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. @@ -131,35 +130,34 @@ function VirtualMachineScaleSets(client) { * * @param {string} * [parameters.virtualMachineProfile.storageProfile.imageReference.publisher] - * the image publisher. + * The image publisher. * * @param {string} - * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] the + * [parameters.virtualMachineProfile.storageProfile.imageReference.offer] The * image offer. * * @param {string} - * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] the - * image sku. + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. * * @param {string} * [parameters.virtualMachineProfile.storageProfile.imageReference.version] - * the image version. The allowed formats are Major.Minor.Build or 'latest'. + * The image version. The allowed formats are Major.Minor.Build or 'latest'. * Major, Minor and Build being decimal numbers. Specify 'latest' to use the - * latest version of image. + * latest version of the image. * * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] * the OS disk. * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.osDisk.name] the disk - * name. + * @param {string} parameters.virtualMachineProfile.storageProfile.osDisk.name + * the disk name. * * @param {string} * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] the * caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' * * @param {string} - * [parameters.virtualMachineProfile.storageProfile.osDisk.createOption] the + * parameters.virtualMachineProfile.storageProfile.osDisk.createOption the * create option. Possible values include: 'fromImage', 'empty', 'attach' * * @param {string} @@ -169,7 +167,7 @@ function VirtualMachineScaleSets(client) { * @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 + * using it to attach to the Virtual Machine. If SourceImage is provided, the * destination VirtualHardDisk should not exist. * * @param {string} @@ -194,12 +192,12 @@ function VirtualMachineScaleSets(client) { * [parameters.virtualMachineProfile.extensionProfile.extensions] the virtual * machine scale set child extension resources. * - * @param {boolean} [parameters.overProvision] Specifies whether the Virtual + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual * Machine Scale Set should be overprovisioned. * - * @param {string} [parameters.location] Resource location + * @param {string} parameters.location Resource location. * - * @param {object} [parameters.tags] Resource tags + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -271,175 +269,138 @@ VirtualMachineScaleSets.prototype.createOrUpdate = function (resourceGroupName, }; /** - * Allows you to create or update a virtual machine scale set by providing - * parameters or a path to pre-configured parameter file. + * + * 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} name Parameters supplied to the Create Virtual Machine - * Scale Set operation. - * - * @param {object} parameters Parameters supplied to the Create Virtual - * Machine Scale Set operation. - * - * @param {object} [parameters.sku] the virtual machine scale set sku. - * - * @param {string} [parameters.sku.name] the sku name. - * - * @param {string} [parameters.sku.tier] the sku tier. - * - * @param {number} [parameters.sku.capacity] the sku capacity. - * - * @param {object} [parameters.upgradePolicy] the upgrade policy. - * - * @param {string} [parameters.upgradePolicy.mode] the upgrade mode. Possible - * values include: 'Automatic', 'Manual' - * - * @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.computerNamePrefix] the - * computer name prefix. - * - * @param {string} [parameters.virtualMachineProfile.osProfile.adminUsername] - * the admin user name. - * - * @param {string} [parameters.virtualMachineProfile.osProfile.adminPassword] - * the admin user password. - * - * @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] - * whether VM Agent should be provisioned on the Virtual Machine. - * - * @param {boolean} - * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] - * whether Windows updates are automatically installed on the VM - * - * @param {string} - * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] - * the Time Zone of the VM - * - * @param {array} - * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] - * the additional base-64 encoded XML formatted information that can be - * included in the Unattend.xml file. - * - * @param {object} - * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] - * the Windows Remote Management configuration of the VM - * - * @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] - * whether Authentication using user name and password is allowed or not - * - * @param {object} - * [parameters.virtualMachineProfile.osProfile.linuxConfiguration.ssh] the - * SSH configuration for linux VMs - * - * @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] the - * image offer. - * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] the - * image sku. - * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.imageReference.version] - * the image version. The allowed formats are Major.Minor.Build or 'latest'. - * Major, Minor and Build being decimal numbers. Specify 'latest' to use the - * latest version of image. - * - * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] - * the OS disk. - * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.osDisk.name] the disk - * name. - * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] the - * caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.osDisk.createOption] the - * create option. Possible values include: 'fromImage', 'empty', 'attach' - * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] the - * Operating System type. Possible values include: 'Windows', 'Linux' - * - * @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} vmScaleSetName The name of the VM scale set. * - * @param {string} - * [parameters.virtualMachineProfile.storageProfile.osDisk.image.uri] the - * virtual hard disk's uri. It should be a valid Uri to a virtual hard disk. + * @param {object} [options] Optional Parameters. * - * @param {array} - * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] the - * list of virtual hard disk container uris. + * @param {array} [options.instanceIds] the virtual machine scale set instance + * ids. * - * @param {object} [parameters.virtualMachineProfile.networkProfile] the - * virtual machine scale set network profile. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} - * [parameters.virtualMachineProfile.networkProfile.networkInterfaceConfigurations] - * the list of network configurations. + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachineScaleSets.prototype.deallocate = function (resourceGroupName, vmScaleSetName, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +}; + +/** + * + * Deletes a VM scale set. + * + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.virtualMachineProfile.extensionProfile] the - * virtual machine scale set extension profile. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {array} - * [parameters.virtualMachineProfile.extensionProfile.extensions] the virtual - * machine scale set child extension resources. + * @param {object} [options] Optional Parameters. * - * @param {boolean} [parameters.overProvision] Specifies whether the Virtual - * Machine Scale Set should be overprovisioned. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.location] Resource location + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachineScaleSets.prototype.deleteMethod = function (resourceGroupName, vmScaleSetName, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +}; + +/** + * Display information about a virtual machine scale set. + * + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.tags] Resource tags + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {object} [options] Optional Parameters. * @@ -460,7 +421,7 @@ VirtualMachineScaleSets.prototype.createOrUpdate = function (resourceGroupName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachineScaleSets.prototype.beginCreateOrUpdate = function (resourceGroupName, name, parameters, options, callback) { +VirtualMachineScaleSets.prototype.get = function (resourceGroupName, vmScaleSetName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -475,11 +436,8 @@ VirtualMachineScaleSets.prototype.beginCreateOrUpdate = function (resourceGroupN 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 (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name 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 (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.'); @@ -492,23 +450,20 @@ VirtualMachineScaleSets.prototype.beginCreateOrUpdate = function (resourceGroupN } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{name}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -526,28 +481,14 @@ VirtualMachineScaleSets.prototype.beginCreateOrUpdate = function (resourceGroupN } } httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - // Serialize Request - var requestContent = null; - var requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - var requestModelMapper = new client.models['VirtualMachineScaleSet']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + - 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, function (err, response, responseBody) { if (err) { return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 200) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -592,23 +533,6 @@ VirtualMachineScaleSets.prototype.beginCreateOrUpdate = function (resourceGroupN return callback(deserializationError); } } - // Deserialize Response - if (statusCode === 201) { - var parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineScaleSet']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - var deserializationError1 = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } return callback(null, result, httpRequest, response); }); @@ -616,19 +540,15 @@ VirtualMachineScaleSets.prototype.beginCreateOrUpdate = function (resourceGroupN /** * - * Allows you to deallocate virtual machines in a virtual machine 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 uses. + * Deletes virtual machines in a VM scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * - * @param {object} [options] Optional Parameters. + * @param {array} instanceIds the virtual machine scale set instance ids. * - * @param {array} [options.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 @@ -645,7 +565,7 @@ VirtualMachineScaleSets.prototype.beginCreateOrUpdate = function (resourceGroupN * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachineScaleSets.prototype.deallocate = function (resourceGroupName, vmScaleSetName, options, callback) { +VirtualMachineScaleSets.prototype.deleteInstances = function (resourceGroupName, vmScaleSetName, instanceIds, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -657,7 +577,7 @@ VirtualMachineScaleSets.prototype.deallocate = function (resourceGroupName, vmSc } // Send request - this.beginDeallocate(resourceGroupName, vmScaleSetName, options, function (err, parsedResult, httpRequest, response){ + this.beginDeleteInstances(resourceGroupName, vmScaleSetName, instanceIds, options, function (err, parsedResult, httpRequest, response){ if (err) return callback(err); var initialResult = new msRest.HttpOperationResponse(); @@ -682,20 +602,14 @@ VirtualMachineScaleSets.prototype.deallocate = function (resourceGroupName, vmSc }; /** - * Allows you to deallocate virtual machines in a virtual machine 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 uses. + * 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 virtual machine scale set. + * @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. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -705,13 +619,15 @@ VirtualMachineScaleSets.prototype.deallocate = function (resourceGroupName, vmSc * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object. + * {object} [result] - The deserialized result object. + * 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. */ -VirtualMachineScaleSets.prototype.beginDeallocate = function (resourceGroupName, vmScaleSetName, options, callback) { +VirtualMachineScaleSets.prototype.getInstanceView = function (resourceGroupName, vmScaleSetName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -720,7 +636,6 @@ VirtualMachineScaleSets.prototype.beginDeallocate = function (resourceGroupName, if (!callback) { throw new Error('callback cannot be null.'); } - var instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; var apiVersion = '2016-03-30'; // Validate try { @@ -733,28 +648,16 @@ VirtualMachineScaleSets.prototype.beginDeallocate = function (resourceGroupName, 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 (util.isArray(instanceIds)) { - for (var 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); } - var vmInstanceIDs; - if (instanceIds !== null && instanceIds !== undefined) { - vmInstanceIDs = new client.models['VirtualMachineScaleSetVMInstanceIDs'](); - vmInstanceIDs.instanceIds = instanceIds; - } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate'; + var baseUrl = this.client.baseUri; + var 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)); @@ -763,13 +666,10 @@ VirtualMachineScaleSets.prototype.beginDeallocate = function (resourceGroupName, if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -787,28 +687,14 @@ VirtualMachineScaleSets.prototype.beginDeallocate = function (resourceGroupName, } } httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - // Serialize Request - var requestContent = null; - var requestModel = null; - try { - if (vmInstanceIDs !== null && vmInstanceIDs !== undefined) { - var requestModelMapper = new client.models['VirtualMachineScaleSetVMInstanceIDs']().mapper(); - requestModel = client.serialize(requestModelMapper, vmInstanceIDs, 'vmInstanceIDs'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + - 'payload - "%s"', error.message, util.inspect(vmInstanceIDs, {depth: null}))); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, function (err, response, responseBody) { if (err) { return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 202) { + if (statusCode !== 200) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -822,6 +708,10 @@ VirtualMachineScaleSets.prototype.beginDeallocate = function (resourceGroupName, if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -832,79 +722,33 @@ VirtualMachineScaleSets.prototype.beginDeallocate = function (resourceGroupName, // Create Result var result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['VirtualMachineScaleSetInstanceView']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); }; /** - * - * Allows you to delete a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmScaleSetName The name of the virtual machine scale set. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachineScaleSets.prototype.deleteMethod = function (resourceGroupName, vmScaleSetName, options, callback) { - var 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, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - -/** - * Allows you to delete a virtual machine scale set. + * Gets a list of all VM scale sets under a resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the virtual machine scale set. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -916,13 +760,15 @@ VirtualMachineScaleSets.prototype.deleteMethod = function (resourceGroupName, vm * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object. + * {object} [result] - The deserialized result object. + * 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. */ -VirtualMachineScaleSets.prototype.beginDeleteMethod = function (resourceGroupName, vmScaleSetName, options, callback) { +VirtualMachineScaleSets.prototype.list = function (resourceGroupName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -937,9 +783,6 @@ VirtualMachineScaleSets.prototype.beginDeleteMethod = function (resourceGroupNam 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.'); } @@ -951,23 +794,19 @@ VirtualMachineScaleSets.prototype.beginDeleteMethod = function (resourceGroupNam } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -992,7 +831,7 @@ VirtualMachineScaleSets.prototype.beginDeleteMethod = function (resourceGroupNam return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + if (statusCode !== 200) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1006,6 +845,10 @@ VirtualMachineScaleSets.prototype.beginDeleteMethod = function (resourceGroupNam if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -1016,18 +859,34 @@ VirtualMachineScaleSets.prototype.beginDeleteMethod = function (resourceGroupNam // Create Result var result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['VirtualMachineScaleSetListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); }; /** - * Display information about a virtual machine scale set. + * 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 not null to fetch + * all the VM Scale Sets. * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmScaleSetName The name of the virtual machine scale set. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1040,14 +899,14 @@ VirtualMachineScaleSets.prototype.beginDeleteMethod = function (resourceGroupNam * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object. - * See {@link VirtualMachineScaleSet} for more - * information. + * 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. */ -VirtualMachineScaleSets.prototype.get = function (resourceGroupName, vmScaleSetName, options, callback) { +VirtualMachineScaleSets.prototype.listAll = function (options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1059,12 +918,6 @@ VirtualMachineScaleSets.prototype.get = function (resourceGroupName, vmScaleSetN var apiVersion = '2016-03-30'; // 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.'); } @@ -1076,19 +929,14 @@ VirtualMachineScaleSets.prototype.get = function (resourceGroupName, vmScaleSetN } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -1152,7 +1000,7 @@ VirtualMachineScaleSets.prototype.get = function (resourceGroupName, vmScaleSetN parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineScaleSet']().mapper(); + var resultMapper = new client.models['VirtualMachineScaleSetListWithLinkResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1168,14 +1016,12 @@ VirtualMachineScaleSets.prototype.get = function (resourceGroupName, vmScaleSetN }; /** - * - * Allows you to delete virtual machines in a virtual machine scale set. + * 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 virtual machine scale set. - * - * @param {array} instanceIds the virtual machine scale set instance ids. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {object} [options] Optional Parameters. * @@ -1188,33 +1034,436 @@ VirtualMachineScaleSets.prototype.get = function (resourceGroupName, vmScaleSetN * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object. + * {object} [result] - The deserialized result object. + * 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. */ -VirtualMachineScaleSets.prototype.deleteInstances = function (resourceGroupName, vmScaleSetName, instanceIds, options, callback) { +VirtualMachineScaleSets.prototype.listSkus = function (resourceGroupName, vmScaleSetName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } - if (!callback) { throw new Error('callback cannot be null.'); } + var apiVersion = '2016-03-30'; + // 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); + } - // Send request - this.beginDeleteInstances(resourceGroupName, vmScaleSetName, instanceIds, options, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); + // Construct URL + var baseUrl = this.client.baseUri; + var 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)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['VirtualMachineScaleSetListSkusResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * + * 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. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachineScaleSets.prototype.powerOff = function (resourceGroupName, vmScaleSetName, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + 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. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachineScaleSets.prototype.restart = function (resourceGroupName, vmScaleSetName, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + 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. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachineScaleSets.prototype.start = function (resourceGroupName, vmScaleSetName, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + 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 + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachineScaleSets.prototype.updateInstances = function (resourceGroupName, vmScaleSetName, instanceIds, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + 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 {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachineScaleSets.prototype.reimage = function (resourceGroupName, vmScaleSetName, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); // Create Result var result = null; @@ -1231,13 +1480,173 @@ VirtualMachineScaleSets.prototype.deleteInstances = function (resourceGroupName, }; /** - * Allows you to delete virtual machines in a virtual machine scale set. + * Create or update a VM scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the virtual machine scale set. + * @param {string} name 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] The sku tier. + * + * @param {number} [parameters.sku.capacity] the sku capacity. + * + * @param {object} [parameters.upgradePolicy] the upgrade policy. + * + * @param {string} [parameters.upgradePolicy.mode] the upgrade mode. Possible + * values include: 'Automatic', 'Manual' + * + * @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.computerNamePrefix] the + * computer name prefix. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminUsername] + * the admin user name. + * + * @param {string} [parameters.virtualMachineProfile.osProfile.adminPassword] + * the admin user password. + * + * @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 the virtual machine agent should be provisioned on the + * Virtual Machine. If not specified, then the default behavior is to set it + * to true. + * + * @param {boolean} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether Windows updates are automatically installed on the VM. + * + * @param {string} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.timeZone] + * The Time Zone of the VM + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.additionalUnattendContent] + * Additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file. + * + * @param {object} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM] + * The Windows Remote Management configuration of the VM + * + * @param {array} + * [parameters.virtualMachineProfile.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners * - * @param {array} instanceIds the virtual machine scale set instance ids. + * @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] The + * SSH configuration for linux VMs. + * + * @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] The + * image offer. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.sku] The + * image SKU. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.imageReference.version] + * The image version. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor and Build being decimal numbers. Specify 'latest' to use the + * latest version of the image. + * + * @param {object} [parameters.virtualMachineProfile.storageProfile.osDisk] + * the OS disk. + * + * @param {string} parameters.virtualMachineProfile.storageProfile.osDisk.name + * the disk name. + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.caching] the + * caching type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * + * @param {string} + * parameters.virtualMachineProfile.storageProfile.osDisk.createOption the + * create option. Possible values include: 'fromImage', 'empty', 'attach' + * + * @param {string} + * [parameters.virtualMachineProfile.storageProfile.osDisk.osType] the + * Operating System type. Possible values include: 'Windows', 'Linux' + * + * @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] the + * virtual hard disk's uri. It should be a valid Uri to a virtual hard disk. + * + * @param {array} + * [parameters.virtualMachineProfile.storageProfile.osDisk.vhdContainers] the + * list of virtual hard disk container uris. + * + * @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.extensionProfile] the + * virtual machine scale set extension profile. + * + * @param {array} + * [parameters.virtualMachineProfile.extensionProfile.extensions] the virtual + * machine scale set child extension resources. + * + * @param {boolean} [parameters.overprovision] Specifies whether the Virtual + * Machine Scale Set should be overprovisioned. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1250,13 +1659,15 @@ VirtualMachineScaleSets.prototype.deleteInstances = function (resourceGroupName, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object. + * {object} [result] - The deserialized result object. + * 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. */ -VirtualMachineScaleSets.prototype.beginDeleteInstances = function (resourceGroupName, vmScaleSetName, instanceIds, options, callback) { +VirtualMachineScaleSets.prototype.beginCreateOrUpdate = function (resourceGroupName, name, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1271,50 +1682,37 @@ VirtualMachineScaleSets.prototype.beginDeleteInstances = function (resourceGroup 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 (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name 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 (!util.isArray(instanceIds)) { - throw new Error('instanceIds cannot be null or undefined and it must be of type array.'); - } - for (var 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); } - var vmInstanceIDs; - if (instanceIds !== null && instanceIds !== undefined) { - vmInstanceIDs = new client.models['VirtualMachineScaleSetVMInstanceRequiredIDs'](); - vmInstanceIDs.instanceIds = instanceIds; - } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{name}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{vmScaleSetName}', encodeURIComponent(vmScaleSetName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -1336,14 +1734,14 @@ VirtualMachineScaleSets.prototype.beginDeleteInstances = function (resourceGroup var requestContent = null; var requestModel = null; try { - if (vmInstanceIDs !== null && vmInstanceIDs !== undefined) { - var requestModelMapper = new client.models['VirtualMachineScaleSetVMInstanceRequiredIDs']().mapper(); - requestModel = client.serialize(requestModelMapper, vmInstanceIDs, 'vmInstanceIDs'); + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['VirtualMachineScaleSet']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } } catch (error) { var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + - 'payload - "%s"', error.message, util.inspect(vmInstanceIDs, {depth: null}))); + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); return callback(serializationError); } httpRequest.body = requestContent; @@ -1353,132 +1751,7 @@ VirtualMachineScaleSets.prototype.beginDeleteInstances = function (resourceGroup return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 202) { - var error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - var parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + - '- "%s" for the default response.', defaultError.message, responseBody); - return callback(error); - } - return callback(error); - } - // Create Result - var result = null; - if (responseBody === '') responseBody = null; - - return callback(null, result, httpRequest, response); - }); -}; - -/** - * Displays status of a virtual machine scale set instance. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmScaleSetName The name of the virtual machine scale set. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object. - * See {@link 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. - */ -VirtualMachineScaleSets.prototype.getInstanceView = function (resourceGroupName, vmScaleSetName, options, callback) { - var client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - var apiVersion = '2016-03-30'; - // 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 - var requestUrl = this.client.baseUri + - '//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)); - var queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.headers = {}; - httpRequest.url = requestUrl; - // Set Headers - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(var headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, function (err, response, responseBody) { - if (err) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1507,20 +1780,37 @@ VirtualMachineScaleSets.prototype.getInstanceView = function (resourceGroupName, var result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 200) { + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['VirtualMachineScaleSet']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { var parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineScaleSetInstanceView']().mapper(); + var resultMapper = new client.models['VirtualMachineScaleSet']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { - var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); + var deserializationError1 = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); } } @@ -1529,12 +1819,19 @@ VirtualMachineScaleSets.prototype.getInstanceView = function (resourceGroupName, }; /** - * Lists all virtual machine scale sets under a resource group. + * 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. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1544,15 +1841,13 @@ VirtualMachineScaleSets.prototype.getInstanceView = function (resourceGroupName, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object. - * See {@link VirtualMachineScaleSetListResult} for more - * information. + * {null} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachineScaleSets.prototype.list = function (resourceGroupName, options, callback) { +VirtualMachineScaleSets.prototype.beginDeallocate = function (resourceGroupName, vmScaleSetName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1561,39 +1856,53 @@ VirtualMachineScaleSets.prototype.list = function (resourceGroupName, options, c if (!callback) { throw new Error('callback cannot be null.'); } + var instanceIds = (options && options.instanceIds !== undefined) ? options.instanceIds : undefined; var apiVersion = '2016-03-30'; // 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 (util.isArray(instanceIds)) { + for (var 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); } + var vmInstanceIDs; + if (instanceIds !== null && instanceIds !== undefined) { + vmInstanceIDs = new client.models['VirtualMachineScaleSetVMInstanceIDs'](); + vmInstanceIDs.instanceIds = instanceIds; + } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets'; + var baseUrl = this.client.baseUri; + var 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)); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -1611,14 +1920,28 @@ VirtualMachineScaleSets.prototype.list = function (resourceGroupName, options, c } } httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - httpRequest.body = null; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (vmInstanceIDs !== null && vmInstanceIDs !== undefined) { + var requestModelMapper = new client.models['VirtualMachineScaleSetVMInstanceIDs']().mapper(); + requestModel = client.serialize(requestModelMapper, vmInstanceIDs, 'vmInstanceIDs'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(vmInstanceIDs, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, function (err, response, responseBody) { if (err) { return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 202) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1632,10 +1955,6 @@ VirtualMachineScaleSets.prototype.list = function (resourceGroupName, options, c if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - var resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -1646,34 +1965,18 @@ VirtualMachineScaleSets.prototype.list = function (resourceGroupName, options, c // Create Result var result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - var parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineScaleSetListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); }; /** - * Lists all Virtual Machine Scale Sets in the subscription. Use nextLink - * property in the response to get the next page of Virtual Machine Scale - * Sets. Do this till nextLink is not null to fetch all the Virtual Machine - * Scale Sets. + * 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 @@ -1685,15 +1988,13 @@ VirtualMachineScaleSets.prototype.list = function (resourceGroupName, options, c * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object. - * See {@link VirtualMachineScaleSetListWithLinkResult} - * for more information. + * {null} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachineScaleSets.prototype.listAll = function (options, callback) { +VirtualMachineScaleSets.prototype.beginDeleteMethod = function (resourceGroupName, vmScaleSetName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1705,6 +2006,12 @@ VirtualMachineScaleSets.prototype.listAll = function (options, callback) { var apiVersion = '2016-03-30'; // 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.'); } @@ -1716,21 +2023,20 @@ VirtualMachineScaleSets.prototype.listAll = function (options, callback) { } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets'; + var baseUrl = this.client.baseUri; + var 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)); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -1755,7 +2061,7 @@ VirtualMachineScaleSets.prototype.listAll = function (options, callback) { return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1769,10 +2075,6 @@ VirtualMachineScaleSets.prototype.listAll = function (options, callback) { if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - var resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -1783,35 +2085,19 @@ VirtualMachineScaleSets.prototype.listAll = function (options, callback) { // Create Result var result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - var parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineScaleSetListWithLinkResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); }; /** - * Displays available skus for your virtual machine scale set including the - * minimum and maximum vm instances allowed for a particular sku. + * Deletes virtual machines in a VM scale set. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} vmScaleSetName The name of the virtual machine scale set. + * @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. * @@ -1824,15 +2110,13 @@ VirtualMachineScaleSets.prototype.listAll = function (options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object. - * See {@link VirtualMachineScaleSetListSkusResult} for - * more information. + * {null} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachineScaleSets.prototype.listSkus = function (resourceGroupName, vmScaleSetName, options, callback) { +VirtualMachineScaleSets.prototype.beginDeleteInstances = function (resourceGroupName, vmScaleSetName, instanceIds, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1853,16 +2137,29 @@ VirtualMachineScaleSets.prototype.listSkus = function (resourceGroupName, vmScal 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 (!util.isArray(instanceIds)) { + throw new Error('instanceIds cannot be null or undefined and it must be of type array.'); + } + for (var 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); } + var vmInstanceIDs; + if (instanceIds !== null && instanceIds !== undefined) { + vmInstanceIDs = new client.models['VirtualMachineScaleSetVMInstanceRequiredIDs'](); + vmInstanceIDs.instanceIds = instanceIds; + } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus'; + var baseUrl = this.client.baseUri; + var 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)); @@ -1871,13 +2168,10 @@ VirtualMachineScaleSets.prototype.listSkus = function (resourceGroupName, vmScal if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -1895,14 +2189,28 @@ VirtualMachineScaleSets.prototype.listSkus = function (resourceGroupName, vmScal } } httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - httpRequest.body = null; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (vmInstanceIDs !== null && vmInstanceIDs !== undefined) { + var requestModelMapper = new client.models['VirtualMachineScaleSetVMInstanceRequiredIDs']().mapper(); + requestModel = client.serialize(requestModelMapper, vmInstanceIDs, 'vmInstanceIDs'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(vmInstanceIDs, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, function (err, response, responseBody) { if (err) { return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 202) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1916,116 +2224,29 @@ VirtualMachineScaleSets.prototype.listSkus = function (resourceGroupName, vmScal if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - var resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + - '- "%s" for the default response.', defaultError.message, responseBody); - return callback(error); - } - return callback(error); - } - // Create Result - var result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - var parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineScaleSetListSkusResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -}; - -/** - * - * Allows you to power off (stop) virtual machines in a virtual machine scale - * set. Note that resources are still attached and you are getting charged - * for the resources. Use deallocate to release resources. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmScaleSetName The name of the virtual machine scale set. - * - * @param {object} [options] Optional Parameters. - * - * @param {array} [options.instanceIds] the virtual machine scale set instance - * ids. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachineScaleSets.prototype.powerOff = function (resourceGroupName, vmScaleSetName, options, callback) { - var 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, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); }; /** - * Allows you to power off (stop) virtual machines in a virtual machine scale - * set. Note that resources are still attached and you are getting charged - * for the resources. Use deallocate to release resources. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {object} [options] Optional Parameters. * @@ -2089,8 +2310,8 @@ VirtualMachineScaleSets.prototype.beginPowerOff = function (resourceGroupName, v } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff'; + var baseUrl = this.client.baseUri; + var 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)); @@ -2099,9 +2320,6 @@ VirtualMachineScaleSets.prototype.beginPowerOff = function (resourceGroupName, v if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -2174,75 +2392,11 @@ VirtualMachineScaleSets.prototype.beginPowerOff = function (resourceGroupName, v }; /** - * - * Allows you to restart virtual machines in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmScaleSetName The name of the virtual machine scale set. - * - * @param {object} [options] Optional Parameters. - * - * @param {array} [options.instanceIds] the virtual machine scale set instance - * ids. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachineScaleSets.prototype.restart = function (resourceGroupName, vmScaleSetName, options, callback) { - var 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, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - -/** - * Allows you to restart virtual machines in a virtual machine scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {object} [options] Optional Parameters. * @@ -2306,8 +2460,8 @@ VirtualMachineScaleSets.prototype.beginRestart = function (resourceGroupName, vm } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart'; + var baseUrl = this.client.baseUri; + var 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)); @@ -2316,9 +2470,6 @@ VirtualMachineScaleSets.prototype.beginRestart = function (resourceGroupName, vm if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -2391,75 +2542,11 @@ VirtualMachineScaleSets.prototype.beginRestart = function (resourceGroupName, vm }; /** - * - * Allows you to start virtual machines in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmScaleSetName The name of the virtual machine scale set. - * - * @param {object} [options] Optional Parameters. - * - * @param {array} [options.instanceIds] the virtual machine scale set instance - * ids. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachineScaleSets.prototype.start = function (resourceGroupName, vmScaleSetName, options, callback) { - var 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, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - -/** - * Allows you to start virtual machines in a virtual machine scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {object} [options] Optional Parameters. * @@ -2523,8 +2610,8 @@ VirtualMachineScaleSets.prototype.beginStart = function (resourceGroupName, vmSc } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'; + var baseUrl = this.client.baseUri; + var 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)); @@ -2533,9 +2620,6 @@ VirtualMachineScaleSets.prototype.beginStart = function (resourceGroupName, vmSc if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -2608,76 +2692,12 @@ VirtualMachineScaleSets.prototype.beginStart = function (resourceGroupName, vmSc }; /** - * - * Allows you to manually upgrade virtual machines in a virtual machine scale - * set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmScaleSetName The name of the virtual machine 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 - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachineScaleSets.prototype.updateInstances = function (resourceGroupName, vmScaleSetName, instanceIds, options, callback) { - var 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, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - -/** - * Allows you to manually upgrade virtual machines in a virtual machine scale - * set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {array} instanceIds the virtual machine scale set instance ids. * @@ -2740,8 +2760,8 @@ VirtualMachineScaleSets.prototype.beginUpdateInstances = function (resourceGroup } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade'; + var baseUrl = this.client.baseUri; + var 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)); @@ -2750,9 +2770,6 @@ VirtualMachineScaleSets.prototype.beginUpdateInstances = function (resourceGroup if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -2825,74 +2842,12 @@ VirtualMachineScaleSets.prototype.beginUpdateInstances = function (resourceGroup }; /** - * - * Allows you to re-image(update the version of the installed operating - * system) virtual machines in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} vmScaleSetName The name of the virtual machine scale set. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachineScaleSets.prototype.reimage = function (resourceGroupName, vmScaleSetName, options, callback) { - var 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, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - -/** - * Allows you to re-image(update the version of the installed operating - * system) virtual machines in a virtual machine scale set. + * 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 virtual machine scale set. + * @param {string} vmScaleSetName The name of the VM scale set. * * @param {object} [options] Optional Parameters. * @@ -2940,8 +2895,8 @@ VirtualMachineScaleSets.prototype.beginReimage = function (resourceGroupName, vm } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage'; + var baseUrl = this.client.baseUri; + var 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)); @@ -2950,9 +2905,6 @@ VirtualMachineScaleSets.prototype.beginReimage = function (resourceGroupName, vm if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -3011,7 +2963,7 @@ VirtualMachineScaleSets.prototype.beginReimage = function (resourceGroupName, vm }; /** - * Lists all virtual machine scale sets under a resource group. + * 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. @@ -3059,9 +3011,6 @@ VirtualMachineScaleSets.prototype.listNext = function (nextPageLink, options, ca // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -3141,10 +3090,10 @@ VirtualMachineScaleSets.prototype.listNext = function (nextPageLink, options, ca }; /** - * Lists all Virtual Machine Scale Sets in the subscription. Use nextLink - * property in the response to get the next page of Virtual Machine Scale - * Sets. Do this till nextLink is not null to fetch all the Virtual Machine - * Scale Sets. + * 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 not null to fetch + * all the VM Scale Sets. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -3192,9 +3141,6 @@ VirtualMachineScaleSets.prototype.listAllNext = function (nextPageLink, options, // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -3274,8 +3220,8 @@ VirtualMachineScaleSets.prototype.listAllNext = function (nextPageLink, options, }; /** - * Displays available skus for your virtual machine scale set including the - * minimum and maximum vm instances allowed for a particular sku. + * 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. @@ -3323,9 +3269,6 @@ VirtualMachineScaleSets.prototype.listSkusNext = function (nextPageLink, options // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); diff --git a/lib/services/computeManagement2/lib/operations/virtualMachineSizes.js b/lib/services/computeManagement2/lib/operations/virtualMachineSizes.js index 72d773bf96..f62854c6d2 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachineSizes.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachineSizes.js @@ -86,8 +86,8 @@ VirtualMachineSizes.prototype.list = function (location, options, callback) { } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes'; + var baseUrl = this.client.baseUri; + var 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)); var queryParameters = []; @@ -95,9 +95,6 @@ VirtualMachineSizes.prototype.list = function (location, options, callback) { if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); diff --git a/lib/services/computeManagement2/lib/operations/virtualMachines.js b/lib/services/computeManagement2/lib/operations/virtualMachines.js index 5cfe814c0e..dc440083c9 100644 --- a/lib/services/computeManagement2/lib/operations/virtualMachines.js +++ b/lib/services/computeManagement2/lib/operations/virtualMachines.js @@ -41,14 +41,14 @@ function VirtualMachines(client) { * @param {object} parameters Parameters supplied to the Capture Virtual * Machine operation. * - * @param {string} [parameters.vhdPrefix] the captured VirtualHardDisk's name + * @param {string} parameters.vhdPrefix the captured VirtualHardDisk's name * prefix. * - * @param {string} [parameters.destinationContainerName] the destination + * @param {string} parameters.destinationContainerName the destination * container name. * - * @param {boolean} [parameters.overwriteVhds] whether it overwrites - * destination VirtualHardDisk if true, in case of conflict. + * @param {boolean} parameters.overwriteVhds whether it overwrites destination + * VirtualHardDisk if true, in case of conflict. * * @param {object} [options] Optional Parameters. * @@ -119,182 +119,6 @@ VirtualMachines.prototype.capture = function (resourceGroupName, vmName, paramet }); }; -/** - * 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 VirtualHardDisk's name - * prefix. - * - * @param {string} [parameters.destinationContainerName] the destination - * container name. - * - * @param {boolean} [parameters.overwriteVhds] whether it overwrites - * destination VirtualHardDisk if true, in case of conflict. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object. - * See {@link 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. - */ -VirtualMachines.prototype.beginCapture = function (resourceGroupName, vmName, parameters, options, callback) { - var client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - var apiVersion = '2016-03-30'; - // 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 - var requestUrl = this.client.baseUri + - '//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)); - var queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.headers = {}; - httpRequest.url = requestUrl; - // Set Headers - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(var headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - // Serialize Request - var requestContent = null; - var requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - var requestModelMapper = new client.models['VirtualMachineCaptureParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + - 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, function (err, response, responseBody) { - if (err) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - var error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - var parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - var resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + - '- "%s" for the default response.', defaultError.message, responseBody); - return callback(error); - } - return callback(error); - } - // Create Result - var result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - var parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineCaptureResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -}; - /** * * The operation to create or update a virtual machine. @@ -306,7 +130,7 @@ VirtualMachines.prototype.beginCapture = function (resourceGroupName, vmName, pa * @param {object} parameters Parameters supplied to the Create Virtual * Machine operation. * - * @param {object} [parameters.plan] the purchase plan when deploying virtual + * @param {object} [parameters.plan] The purchase plan when deploying virtual * machine from VM Marketplace images. * * @param {string} [parameters.plan.name] the plan ID. @@ -317,7 +141,7 @@ VirtualMachines.prototype.beginCapture = function (resourceGroupName, vmName, pa * * @param {string} [parameters.plan.promotionCode] the promotion code. * - * @param {object} [parameters.hardwareProfile] the hardware profile. + * @param {object} [parameters.hardwareProfile] The hardware profile. * * @param {string} [parameters.hardwareProfile.vmSize] The virtual machine * size name. Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', @@ -337,26 +161,26 @@ VirtualMachines.prototype.beginCapture = function (resourceGroupName, vmName, pa * 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5' * - * @param {object} [parameters.storageProfile] the storage profile. + * @param {object} [parameters.storageProfile] The storage profile. * - * @param {object} [parameters.storageProfile.imageReference] the image + * @param {object} [parameters.storageProfile.imageReference] The image * reference. * - * @param {string} [parameters.storageProfile.imageReference.publisher] the + * @param {string} [parameters.storageProfile.imageReference.publisher] The * image publisher. * - * @param {string} [parameters.storageProfile.imageReference.offer] the image + * @param {string} [parameters.storageProfile.imageReference.offer] The image * offer. * - * @param {string} [parameters.storageProfile.imageReference.sku] the image - * sku. + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. * - * @param {string} [parameters.storageProfile.imageReference.version] the + * @param {string} [parameters.storageProfile.imageReference.version] The * image version. The allowed formats are Major.Minor.Build or 'latest'. * Major, Minor and Build being decimal numbers. Specify 'latest' to use the - * latest version of image. + * latest version of the image. * - * @param {object} [parameters.storageProfile.osDisk] the OS disk. + * @param {object} [parameters.storageProfile.osDisk] The OS disk. * * @param {string} [parameters.storageProfile.osDisk.osType] the Operating * System type. Possible values include: 'Windows', 'Linux' @@ -369,11 +193,11 @@ VirtualMachines.prototype.beginCapture = function (resourceGroupName, vmName, pa * the disk encryption key which is a KeyVault Secret. * * @param {string} - * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl] + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl * the URL referencing a secret in a Key Vault. * * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault] + * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault * the Relative URL of the Key Vault containing the secret. * * @param {object} @@ -381,25 +205,24 @@ VirtualMachines.prototype.beginCapture = function (resourceGroupName, vmName, pa * key encryption key which is KeyVault Key. * * @param {string} - * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl] + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl * the URL referencing a key in a Key Vault. * * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault] + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault * the Relative URL of the Key Vault containing the key * * @param {boolean} * [parameters.storageProfile.osDisk.encryptionSettings.enabled] whether disk * encryption should be enabled on the Virtual Machine. * - * @param {string} [parameters.storageProfile.osDisk.name] the disk name. + * @param {string} parameters.storageProfile.osDisk.name the disk name. * - * @param {object} [parameters.storageProfile.osDisk.vhd] the Virtual Hard - * Disk. + * @param {object} parameters.storageProfile.osDisk.vhd the Virtual Hard Disk. * * @param {object} [parameters.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 + * to attach to the Virtual Machine. If SourceImage is provided, the * destination VirtualHardDisk should not exist. * * @param {string} [parameters.storageProfile.osDisk.image.uri] the virtual @@ -408,95 +231,104 @@ VirtualMachines.prototype.beginCapture = function (resourceGroupName, vmName, pa * @param {string} [parameters.storageProfile.osDisk.caching] the caching * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' * - * @param {string} [parameters.storageProfile.osDisk.createOption] the create + * @param {string} parameters.storageProfile.osDisk.createOption the create * option. Possible values include: 'fromImage', 'empty', 'attach' * * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] the initial * disk size in GB for blank data disks, and the new desired size for * existing OS and Data disks. * - * @param {array} [parameters.storageProfile.dataDisks] the data disks. + * @param {array} [parameters.storageProfile.dataDisks] The data disks. * - * @param {object} [parameters.osProfile] the OS profile. + * @param {object} [parameters.osProfile] The OS profile. * - * @param {string} [parameters.osProfile.computerName] the computer name. + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine. * - * @param {string} [parameters.osProfile.adminUsername] the admin user name. + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account. * - * @param {string} [parameters.osProfile.adminPassword] the admin user - * password. + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account. * - * @param {string} [parameters.osProfile.customData] a base-64 encoded string - * of custom data. + * @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 * * @param {object} [parameters.osProfile.windowsConfiguration] the Windows * Configuration of the OS profile. * * @param {boolean} - * [parameters.osProfile.windowsConfiguration.provisionVMAgent] whether VM - * Agent should be provisioned on the Virtual Machine. + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether the virtual machine agent should be provisioned on the Virtual + * Machine. If not specified, then the default behavior is to set it to true. * * @param {boolean} - * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] whether - * Windows updates are automatically installed on the VM + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether Windows updates are automatically installed on the VM. * - * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] the + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] The * Time Zone of the VM * * @param {array} - * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] the - * additional base-64 encoded XML formatted information that can be included + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Additional base-64 encoded XML formatted information that can be included * in the Unattend.xml file. * - * @param {object} [parameters.osProfile.windowsConfiguration.winRM] the + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] The * Windows Remote Management configuration of the VM * * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] - * the list of Windows Remote Management listeners + * The list of Windows Remote Management listeners * * @param {object} [parameters.osProfile.linuxConfiguration] the Linux * Configuration of the OS profile. * * @param {boolean} * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] - * whether Authentication using user name and password is allowed or not + * Specifies whether password authentication should be disabled. * - * @param {object} [parameters.osProfile.linuxConfiguration.ssh] the SSH - * configuration for linux VMs + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] The SSH + * configuration for linux VMs. * - * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] the - * list of SSH public keys used to authenticate with linux based VMs + * @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] the List of certificates for * addition to the VM. * - * @param {object} [parameters.networkProfile] the network profile. + * @param {object} [parameters.networkProfile] The network profile. * - * @param {array} [parameters.networkProfile.networkInterfaces] the network - * interfaces. + * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the + * list of resource Ids for the network interfaces associated with the + * virtual machine. * - * @param {object} [parameters.diagnosticsProfile] the diagnostics profile. + * @param {object} [parameters.diagnosticsProfile] The diagnostics profile. * - * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] the boot - * diagnostics. + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows the user to view console + * output and/or a screenshot of the virtual machine from the hypervisor. * * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] - * whether boot diagnostics should be enabled on the Virtual Machine. + * Whether boot diagnostics should be enabled on the Virtual Machine. * * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] - * the boot diagnostics storage Uri. It should be a valid Uri + * URI of the storage account to use for placing the console output and + * screenshot. * - * @param {object} [parameters.availabilitySet] the reference Id of the - * availability set to which this virtual machine belongs. + * @param {object} [parameters.availabilitySet] The reference Id of the + * availability set to which the virtual machine belongs. * * @param {string} [parameters.availabilitySet.id] Resource Id * - * @param {string} [parameters.licenseType] the license type, which is for - * bring your own license scenario. + * @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. * - * @param {string} [parameters.location] Resource location + * @param {string} parameters.location Resource location. * - * @param {object} [parameters.tags] Resource tags + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -567,211 +399,80 @@ VirtualMachines.prototype.createOrUpdate = function (resourceGroupName, vmName, }; /** - * The operation to create or update a virtual machine. + * + * 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} parameters Parameters supplied to the Create Virtual - * Machine operation. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.plan] the purchase plan when deploying virtual - * machine from VM Marketplace images. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.plan.name] the plan ID. + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachines.prototype.deleteMethod = function (resourceGroupName, vmName, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +}; + +/** + * The operation to get a virtual machine. + * + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.plan.publisher] the publisher ID. + * @param {string} vmName The name of the virtual machine. * - * @param {string} [parameters.plan.product] the offer ID. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.plan.promotionCode] the promotion code. + * @param {string} [options.expand] The expand expression to apply on the + * operation. Possible values include: 'instanceView' * - * @param {object} [parameters.hardwareProfile] the hardware profile. - * - * @param {string} [parameters.hardwareProfile.vmSize] The virtual machine - * size name. 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_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', - * 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', - * 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', - * 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', - * 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', - * 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', - * 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', - * 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', - * 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', - * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_G1', 'Standard_G2', - * 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', - * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5' - * - * @param {object} [parameters.storageProfile] the storage profile. - * - * @param {object} [parameters.storageProfile.imageReference] the image - * reference. - * - * @param {string} [parameters.storageProfile.imageReference.publisher] the - * image publisher. - * - * @param {string} [parameters.storageProfile.imageReference.offer] the image - * offer. - * - * @param {string} [parameters.storageProfile.imageReference.sku] the image - * sku. - * - * @param {string} [parameters.storageProfile.imageReference.version] the - * image version. The allowed formats are Major.Minor.Build or 'latest'. - * Major, Minor and Build being decimal numbers. Specify 'latest' to use the - * latest version of image. - * - * @param {object} [parameters.storageProfile.osDisk] the OS disk. - * - * @param {string} [parameters.storageProfile.osDisk.osType] the Operating - * System type. Possible values include: 'Windows', 'Linux' - * - * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] the - * disk encryption settings. - * - * @param {object} - * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] - * the disk encryption key which is a KeyVault 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] the - * key encryption key which is KeyVault Key. - * - * @param {string} - * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl] - * the URL referencing a key in a 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] 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 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.storageProfile.osDisk.image.uri] the virtual - * hard disk's uri. It should be a valid Uri to a virtual hard disk. - * - * @param {string} [parameters.storageProfile.osDisk.caching] the caching - * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' - * - * @param {string} [parameters.storageProfile.osDisk.createOption] the create - * option. Possible values include: 'fromImage', 'empty', 'attach' - * - * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] the initial - * disk size in GB for blank data disks, and the new desired size for - * existing OS and Data disks. - * - * @param {array} [parameters.storageProfile.dataDisks] the data disks. - * - * @param {object} [parameters.osProfile] the OS profile. - * - * @param {string} [parameters.osProfile.computerName] the computer name. - * - * @param {string} [parameters.osProfile.adminUsername] the admin user name. - * - * @param {string} [parameters.osProfile.adminPassword] the admin user - * password. - * - * @param {string} [parameters.osProfile.customData] a base-64 encoded string - * of custom data. - * - * @param {object} [parameters.osProfile.windowsConfiguration] the Windows - * Configuration of the OS profile. - * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.provisionVMAgent] whether VM - * Agent should be provisioned on the Virtual Machine. - * - * @param {boolean} - * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] whether - * Windows updates are automatically installed on the VM - * - * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] the - * Time Zone of the VM - * - * @param {array} - * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] the - * additional base-64 encoded XML formatted information that can be included - * in the Unattend.xml file. - * - * @param {object} [parameters.osProfile.windowsConfiguration.winRM] the - * Windows Remote Management configuration of the VM - * - * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] - * the list of Windows Remote Management listeners - * - * @param {object} [parameters.osProfile.linuxConfiguration] the Linux - * Configuration of the OS profile. - * - * @param {boolean} - * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] - * whether Authentication using user name and password is allowed or not - * - * @param {object} [parameters.osProfile.linuxConfiguration.ssh] the SSH - * configuration for linux VMs - * - * @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] the List of certificates for - * addition to the VM. - * - * @param {object} [parameters.networkProfile] the network profile. - * - * @param {array} [parameters.networkProfile.networkInterfaces] the network - * interfaces. - * - * @param {object} [parameters.diagnosticsProfile] the diagnostics profile. - * - * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] the boot - * diagnostics. - * - * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled] - * whether boot diagnostics should be enabled on the Virtual Machine. - * - * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri] - * the boot diagnostics storage Uri. It should be a valid Uri - * - * @param {object} [parameters.availabilitySet] the reference Id of the - * availability set to which this virtual machine belongs. - * - * @param {string} [parameters.availabilitySet.id] Resource Id - * - * @param {string} [parameters.licenseType] the license type, which is for - * bring your own license scenario. - * - * @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 {object} [options.customHeaders] Headers that will be added to the + * request * * @param {function} callback * @@ -786,7 +487,7 @@ VirtualMachines.prototype.createOrUpdate = function (resourceGroupName, vmName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachines.prototype.beginCreateOrUpdate = function (resourceGroupName, vmName, parameters, options, callback) { +VirtualMachines.prototype.get = function (resourceGroupName, vmName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -795,6 +496,7 @@ VirtualMachines.prototype.beginCreateOrUpdate = function (resourceGroupName, vmN if (!callback) { throw new Error('callback cannot be null.'); } + var expand = (options && options.expand !== undefined) ? options.expand : undefined; var apiVersion = '2016-03-30'; // Validate try { @@ -804,8 +506,11 @@ VirtualMachines.prototype.beginCreateOrUpdate = function (resourceGroupName, vmN 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 (expand) { + var 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.'); @@ -818,23 +523,23 @@ VirtualMachines.prototype.beginCreateOrUpdate = function (resourceGroupName, vmN } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'; + var baseUrl = this.client.baseUri; + var 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)); var queryParameters = []; + if (expand !== null && expand !== undefined) { + queryParameters.push('$expand=' + encodeURIComponent(expand)); + } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -852,28 +557,14 @@ VirtualMachines.prototype.beginCreateOrUpdate = function (resourceGroupName, vmN } } httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - // Serialize Request - var requestContent = null; - var requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - var requestModelMapper = new client.models['VirtualMachine']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + - 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, function (err, response, responseBody) { if (err) { return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 200) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -918,23 +609,6 @@ VirtualMachines.prototype.beginCreateOrUpdate = function (resourceGroupName, vmN return callback(deserializationError); } } - // Deserialize Response - if (statusCode === 201) { - var parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachine']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - var deserializationError1 = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } return callback(null, result, httpRequest, response); }); @@ -942,7 +616,8 @@ VirtualMachines.prototype.beginCreateOrUpdate = function (resourceGroupName, vmN /** * - * The operation to delete a virtual machine. + * 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. * @@ -965,7 +640,7 @@ VirtualMachines.prototype.beginCreateOrUpdate = function (resourceGroupName, vmN * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachines.prototype.deleteMethod = function (resourceGroupName, vmName, options, callback) { +VirtualMachines.prototype.deallocate = function (resourceGroupName, vmName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -977,7 +652,7 @@ VirtualMachines.prototype.deleteMethod = function (resourceGroupName, vmName, op } // Send request - this.beginDeleteMethod(resourceGroupName, vmName, options, function (err, parsedResult, httpRequest, response){ + this.beginDeallocate(resourceGroupName, vmName, options, function (err, parsedResult, httpRequest, response){ if (err) return callback(err); var initialResult = new msRest.HttpOperationResponse(); @@ -1002,7 +677,7 @@ VirtualMachines.prototype.deleteMethod = function (resourceGroupName, vmName, op }; /** - * The operation to delete a virtual machine. + * Sets the state of the VM as Generalized. * * @param {string} resourceGroupName The name of the resource group. * @@ -1025,7 +700,7 @@ VirtualMachines.prototype.deleteMethod = function (resourceGroupName, vmName, op * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachines.prototype.beginDeleteMethod = function (resourceGroupName, vmName, options, callback) { +VirtualMachines.prototype.generalize = function (resourceGroupName, vmName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1054,8 +729,8 @@ VirtualMachines.prototype.beginDeleteMethod = function (resourceGroupName, vmNam } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'; + var baseUrl = this.client.baseUri; + var 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)); @@ -1064,13 +739,10 @@ VirtualMachines.prototype.beginDeleteMethod = function (resourceGroupName, vmNam if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -1095,7 +767,7 @@ VirtualMachines.prototype.beginDeleteMethod = function (resourceGroupName, vmNam return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 204) { + if (statusCode !== 200) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1125,17 +797,12 @@ VirtualMachines.prototype.beginDeleteMethod = function (resourceGroupName, vmNam }; /** - * The operation to get a virtual machine. + * The operation to list virtual machines 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 {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 * @@ -1146,13 +813,14 @@ VirtualMachines.prototype.beginDeleteMethod = function (resourceGroupName, vmNam * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object. - * See {@link VirtualMachine} for more information. + * 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. */ -VirtualMachines.prototype.get = function (resourceGroupName, vmName, options, callback) { +VirtualMachines.prototype.list = function (resourceGroupName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1161,22 +829,12 @@ VirtualMachines.prototype.get = function (resourceGroupName, vmName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - var expand = (options && options.expand !== undefined) ? options.expand : undefined; var apiVersion = '2016-03-30'; // 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) { - var 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.'); } @@ -1188,22 +846,15 @@ VirtualMachines.prototype.get = function (resourceGroupName, vmName, options, ca } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'; + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{vmName}', encodeURIComponent(vmName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); var queryParameters = []; - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -1267,7 +918,7 @@ VirtualMachines.prototype.get = function (resourceGroupName, vmName, options, ca parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachine']().mapper(); + var resultMapper = new client.models['VirtualMachineListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1283,14 +934,10 @@ VirtualMachines.prototype.get = function (resourceGroupName, vmName, options, ca }; /** + * Gets the list of Virtual Machines in the subscription. Use nextLink + * property in the response to get the next page of Virtual Machines. Do this + * till nextLink is not null to fetch all the Virtual Machines. * - * 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 @@ -1302,119 +949,49 @@ VirtualMachines.prototype.get = function (resourceGroupName, vmName, options, ca * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object. + * {object} [result] - The deserialized result object. + * 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. */ -VirtualMachines.prototype.deallocate = function (resourceGroupName, vmName, options, callback) { +VirtualMachines.prototype.listAll = function (options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } - if (!callback) { throw new Error('callback cannot be null.'); } + var apiVersion = '2016-03-30'; + // 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); + } - // Send request - this.beginDeallocate(resourceGroupName, vmName, options, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - 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 - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachines.prototype.beginDeallocate = function (resourceGroupName, vmName, options, callback) { - var client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - var apiVersion = '2016-03-30'; - // 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 - var requestUrl = this.client.baseUri + - '//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)); - var queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); + // Construct URL + var baseUrl = this.client.baseUri; + var requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -1439,7 +1016,7 @@ VirtualMachines.prototype.beginDeallocate = function (resourceGroupName, vmName, return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 202) { + if (statusCode !== 200) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1453,6 +1030,10 @@ VirtualMachines.prototype.beginDeallocate = function (resourceGroupName, vmName, if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } } catch (defaultError) { error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + '- "%s" for the default response.', defaultError.message, responseBody); @@ -1463,139 +1044,36 @@ VirtualMachines.prototype.beginDeallocate = function (resourceGroupName, vmName, // Create Result var result = null; if (responseBody === '') responseBody = null; - - return callback(null, result, httpRequest, response); - }); -}; - -/** - * Sets the state of the VM as 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 - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachines.prototype.generalize = function (resourceGroupName, vmName, options, callback) { - var client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - var apiVersion = '2016-03-30'; - // 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 - var requestUrl = this.client.baseUri + - '//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)); - var queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.headers = {}; - httpRequest.url = requestUrl; - // Set Headers - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(var headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, function (err, response, responseBody) { - if (err) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode !== 200) { - var error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - var parsedErrorResponse; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; 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; + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['VirtualMachineListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); } - } catch (defaultError) { - error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + - '- "%s" for the default response.', defaultError.message, responseBody); - return callback(error); + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); } - return callback(error); } - // Create Result - var result = null; - if (responseBody === '') responseBody = null; return callback(null, result, httpRequest, response); }); }; /** - * The operation to list virtual machines under a resource group. + * 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 @@ -1608,14 +1086,14 @@ VirtualMachines.prototype.generalize = function (resourceGroupName, vmName, opti * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object. - * See {@link VirtualMachineListResult} for more + * 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. */ -VirtualMachines.prototype.list = function (resourceGroupName, options, callback) { +VirtualMachines.prototype.listAvailableSizes = function (resourceGroupName, vmName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1630,6 +1108,9 @@ VirtualMachines.prototype.list = function (resourceGroupName, options, callback) 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.'); } @@ -1641,18 +1122,16 @@ VirtualMachines.prototype.list = function (resourceGroupName, options, callback) } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines'; + var baseUrl = this.client.baseUri; + var 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)); var queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -1716,7 +1195,7 @@ VirtualMachines.prototype.list = function (resourceGroupName, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineListResult']().mapper(); + var resultMapper = new client.models['VirtualMachineSizeListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1732,10 +1211,13 @@ VirtualMachines.prototype.list = function (resourceGroupName, options, callback) }; /** - * Gets the list of Virtual Machines in the subscription. Use nextLink - * property in the response to get the next page of Virtual Machines. Do this - * till nextLink is not null to fetch all the Virtual Machines. * + * The operation to power off (stop) 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 @@ -1747,52 +1229,316 @@ VirtualMachines.prototype.list = function (resourceGroupName, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object. - * See {@link VirtualMachineListResult} for more - * information. + * {null} [result] - The deserialized result object. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachines.prototype.listAll = function (options, callback) { +VirtualMachines.prototype.powerOff = function (resourceGroupName, vmName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - var apiVersion = '2016-03-30'; - // 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 - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - var queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); + // Send request + this.beginPowerOff(resourceGroupName, vmName, options, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + 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 + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachines.prototype.restart = function (resourceGroupName, vmName, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + 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 + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachines.prototype.start = function (resourceGroupName, vmName, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + 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 + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +VirtualMachines.prototype.redeploy = function (resourceGroupName, vmName, options, callback) { + var 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, function (err, parsedResult, httpRequest, response){ + if (err) return callback(err); + + var initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { + if (err) return callback(err); + + // Create Result + var result = null; + httpRequest = pollingResult.request; + response = pollingResult.response; + var responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + 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 VirtualHardDisk's name + * prefix. + * + * @param {string} parameters.destinationContainerName the destination + * container name. + * + * @param {boolean} parameters.overwriteVhds whether it overwrites destination + * VirtualHardDisk if true, in case of conflict. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link 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. + */ +VirtualMachines.prototype.beginCapture = function (resourceGroupName, vmName, parameters, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var apiVersion = '2016-03-30'; + // 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 + var baseUrl = this.client.baseUri; + var 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)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -1810,14 +1556,28 @@ VirtualMachines.prototype.listAll = function (options, callback) { } } httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - httpRequest.body = null; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['VirtualMachineCaptureParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, function (err, response, responseBody) { if (err) { return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1852,7 +1612,7 @@ VirtualMachines.prototype.listAll = function (options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineListResult']().mapper(); + var resultMapper = new client.models['VirtualMachineCaptureResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1868,12 +1628,214 @@ VirtualMachines.prototype.listAll = function (options, callback) { }; /** - * Lists all available virtual machine sizes it can be resized to for a + * 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] The purchase plan when deploying virtual + * machine 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] the offer ID. + * + * @param {string} [parameters.plan.promotionCode] the promotion code. + * + * @param {object} [parameters.hardwareProfile] The hardware profile. + * + * @param {string} [parameters.hardwareProfile.vmSize] The virtual machine + * size name. 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_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', + * 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', + * 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', + * 'Standard_D5_v2', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', + * 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', + * 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', + * 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', + * 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', + * 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_G1', 'Standard_G2', + * 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5' + * + * @param {object} [parameters.storageProfile] The storage profile. + * + * @param {object} [parameters.storageProfile.imageReference] The image + * reference. + * + * @param {string} [parameters.storageProfile.imageReference.publisher] The + * image publisher. + * + * @param {string} [parameters.storageProfile.imageReference.offer] The image + * offer. + * + * @param {string} [parameters.storageProfile.imageReference.sku] The image + * SKU. + * + * @param {string} [parameters.storageProfile.imageReference.version] The + * image version. The allowed formats are Major.Minor.Build or 'latest'. + * Major, Minor and Build being decimal numbers. Specify 'latest' to use the + * latest version of the image. + * + * @param {object} [parameters.storageProfile.osDisk] The OS disk. + * + * @param {string} [parameters.storageProfile.osDisk.osType] the Operating + * System type. Possible values include: 'Windows', 'Linux' + * + * @param {object} [parameters.storageProfile.osDisk.encryptionSettings] the + * disk encryption settings. + * + * @param {object} + * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey] + * the disk encryption key which is a KeyVault 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] the + * key encryption key which is KeyVault Key. + * + * @param {string} + * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl + * the URL referencing a key in a 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] 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 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.storageProfile.osDisk.image.uri] the virtual + * hard disk's uri. It should be a valid Uri to a virtual hard disk. + * + * @param {string} [parameters.storageProfile.osDisk.caching] the caching + * type. Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * + * @param {string} parameters.storageProfile.osDisk.createOption the create + * option. Possible values include: 'fromImage', 'empty', 'attach' + * + * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] the initial + * disk size in GB for blank data disks, and the new desired size for + * existing OS and Data disks. + * + * @param {array} [parameters.storageProfile.dataDisks] The data disks. + * + * @param {object} [parameters.osProfile] The OS profile. + * + * @param {string} [parameters.osProfile.computerName] Specifies the host OS + * name of the virtual machine. + * + * @param {string} [parameters.osProfile.adminUsername] Specifies the name of + * the administrator account. + * + * @param {string} [parameters.osProfile.adminPassword] Specifies the password + * of the administrator account. + * + * @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 + * + * @param {object} [parameters.osProfile.windowsConfiguration] the Windows + * Configuration of the OS profile. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates + * whether the virtual machine agent should be provisioned on the Virtual + * Machine. If not specified, then the default behavior is to set it to true. + * + * @param {boolean} + * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] + * Indicates whether Windows updates are automatically installed on the VM. + * + * @param {string} [parameters.osProfile.windowsConfiguration.timeZone] The + * Time Zone of the VM + * + * @param {array} + * [parameters.osProfile.windowsConfiguration.additionalUnattendContent] + * Additional base-64 encoded XML formatted information that can be included + * in the Unattend.xml file. + * + * @param {object} [parameters.osProfile.windowsConfiguration.winRM] The + * Windows Remote Management configuration of the VM + * + * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners] + * The list of Windows Remote Management listeners + * + * @param {object} [parameters.osProfile.linuxConfiguration] the Linux + * Configuration of the OS profile. + * + * @param {boolean} + * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication] + * Specifies whether password authentication should be disabled. + * + * @param {object} [parameters.osProfile.linuxConfiguration.ssh] The SSH + * configuration for linux VMs. + * + * @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] the List of certificates for + * addition to the VM. + * + * @param {object} [parameters.networkProfile] The network profile. + * + * @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 {string} vmName The name of the virtual machine. + * @param {object} [parameters.diagnosticsProfile] The diagnostics profile. + * + * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot + * Diagnostics is a debugging feature which allows the user to view console + * output and/or a screenshot of the virtual machine 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] The reference Id of the + * availability set to which the virtual machine belongs. + * + * @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. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1887,14 +1849,13 @@ VirtualMachines.prototype.listAll = function (options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object. - * See {@link VirtualMachineSizeListResult} for more - * information. + * 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. */ -VirtualMachines.prototype.listAvailableSizes = function (resourceGroupName, vmName, options, callback) { +VirtualMachines.prototype.beginCreateOrUpdate = function (resourceGroupName, vmName, parameters, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -1912,6 +1873,9 @@ VirtualMachines.prototype.listAvailableSizes = function (resourceGroupName, vmNa 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.'); } @@ -1923,8 +1887,8 @@ VirtualMachines.prototype.listAvailableSizes = function (resourceGroupName, vmNa } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes'; + var baseUrl = this.client.baseUri; + var 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)); @@ -1933,13 +1897,10 @@ VirtualMachines.prototype.listAvailableSizes = function (resourceGroupName, vmNa if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.headers = {}; httpRequest.url = requestUrl; // Set Headers @@ -1957,14 +1918,28 @@ VirtualMachines.prototype.listAvailableSizes = function (resourceGroupName, vmNa } } httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - httpRequest.body = null; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['VirtualMachine']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, function (err, response, responseBody) { if (err) { return callback(err); } var statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { var error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1999,7 +1974,7 @@ VirtualMachines.prototype.listAvailableSizes = function (resourceGroupName, vmNa parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - var resultMapper = new client.models['VirtualMachineSizeListResult']().mapper(); + var resultMapper = new client.models['VirtualMachine']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2009,14 +1984,30 @@ VirtualMachines.prototype.listAvailableSizes = function (resourceGroupName, vmNa return callback(deserializationError); } } + // Deserialize Response + if (statusCode === 201) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['VirtualMachine']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError1 = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } return callback(null, result, httpRequest, response); }); }; /** - * - * The operation to power off (stop) a virtual machine. + * The operation to delete a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -2039,44 +2030,105 @@ VirtualMachines.prototype.listAvailableSizes = function (resourceGroupName, vmNa * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachines.prototype.powerOff = function (resourceGroupName, vmName, options, callback) { +VirtualMachines.prototype.beginDeleteMethod = function (resourceGroupName, vmName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } - if (!callback) { throw new Error('callback cannot be null.'); } + var apiVersion = '2016-03-30'; + // 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); + } - // Send request - this.beginPowerOff(resourceGroupName, vmName, options, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); + // Construct URL + var baseUrl = this.client.baseUri; + var 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)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 202 && statusCode !== 204) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); }; /** - * The operation to power off (stop) a virtual machine. + * 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. * @@ -2099,7 +2151,7 @@ VirtualMachines.prototype.powerOff = function (resourceGroupName, vmName, option * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachines.prototype.beginPowerOff = function (resourceGroupName, vmName, options, callback) { +VirtualMachines.prototype.beginDeallocate = function (resourceGroupName, vmName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; @@ -2128,8 +2180,8 @@ VirtualMachines.prototype.beginPowerOff = function (resourceGroupName, vmName, o } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff'; + var baseUrl = this.client.baseUri; + var 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)); @@ -2138,9 +2190,6 @@ VirtualMachines.prototype.beginPowerOff = function (resourceGroupName, vmName, o if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -2199,8 +2248,7 @@ VirtualMachines.prototype.beginPowerOff = function (resourceGroupName, vmName, o }; /** - * - * The operation to restart a virtual machine. + * The operation to power off (stop) a virtual machine. * * @param {string} resourceGroupName The name of the resource group. * @@ -2223,39 +2271,99 @@ VirtualMachines.prototype.beginPowerOff = function (resourceGroupName, vmName, o * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -VirtualMachines.prototype.restart = function (resourceGroupName, vmName, options, callback) { +VirtualMachines.prototype.beginPowerOff = function (resourceGroupName, vmName, options, callback) { var client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } - if (!callback) { throw new Error('callback cannot be null.'); } + var apiVersion = '2016-03-30'; + // 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); + } - // Send request - this.beginRestart(resourceGroupName, vmName, options, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); + // Construct URL + var baseUrl = this.client.baseUri; + var 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)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 202) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); }; @@ -2312,8 +2420,8 @@ VirtualMachines.prototype.beginRestart = function (resourceGroupName, vmName, op } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart'; + var baseUrl = this.client.baseUri; + var 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)); @@ -2322,9 +2430,6 @@ VirtualMachines.prototype.beginRestart = function (resourceGroupName, vmName, op if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -2382,67 +2487,6 @@ VirtualMachines.prototype.beginRestart = function (resourceGroupName, vmName, op }); }; -/** - * - * 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 - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachines.prototype.start = function (resourceGroupName, vmName, options, callback) { - var 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, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - /** * The operation to start a virtual machine. * @@ -2496,8 +2540,8 @@ VirtualMachines.prototype.beginStart = function (resourceGroupName, vmName, opti } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start'; + var baseUrl = this.client.baseUri; + var 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)); @@ -2506,9 +2550,6 @@ VirtualMachines.prototype.beginStart = function (resourceGroupName, vmName, opti if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -2566,67 +2607,6 @@ VirtualMachines.prototype.beginStart = function (resourceGroupName, vmName, opti }); }; -/** - * - * 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 - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -VirtualMachines.prototype.redeploy = function (resourceGroupName, vmName, options, callback) { - var 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, function (err, parsedResult, httpRequest, response){ - if (err) return callback(err); - - var initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, function (err, pollingResult) { - if (err) return callback(err); - - // Create Result - var result = null; - httpRequest = pollingResult.request; - response = pollingResult.response; - var responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -}; - /** * The operation to redeploy a virtual machine. * @@ -2680,8 +2660,8 @@ VirtualMachines.prototype.beginRedeploy = function (resourceGroupName, vmName, o } // Construct URL - var requestUrl = this.client.baseUri + - '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy'; + var baseUrl = this.client.baseUri; + var 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)); @@ -2690,9 +2670,6 @@ VirtualMachines.prototype.beginRedeploy = function (resourceGroupName, vmName, o if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -2799,9 +2776,6 @@ VirtualMachines.prototype.listNext = function (nextPageLink, options, callback) // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource(); @@ -2931,9 +2905,6 @@ VirtualMachines.prototype.listAllNext = function (nextPageLink, options, callbac // Construct URL var requestUrl = '{nextLink}'; requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - // trim all duplicate forward slashes in the url - var regex = /([^:]\/)\/+/gi; - requestUrl = requestUrl.replace(regex, '$1'); // Create HTTP transport objects var httpRequest = new WebResource();