diff --git a/lib/services/computeManagement2/LICENSE.txt b/lib/services/computeManagement2/LICENSE.txt
index a70e8cf660..5431ba98b9 100644
--- a/lib/services/computeManagement2/LICENSE.txt
+++ b/lib/services/computeManagement2/LICENSE.txt
@@ -1,21 +1,21 @@
-The MIT License (MIT)
-
-Copyright (c) 2018 Microsoft
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+The MIT License (MIT)
+
+Copyright (c) 2018 Microsoft
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/lib/services/computeManagement2/lib/computeManagementClient.d.ts b/lib/services/computeManagement2/lib/computeManagementClient.d.ts
index 4894e75f99..11efa212ea 100644
--- a/lib/services/computeManagement2/lib/computeManagementClient.d.ts
+++ b/lib/services/computeManagement2/lib/computeManagementClient.d.ts
@@ -34,11 +34,11 @@ export default class ComputeManagementClient extends AzureServiceClient {
*
* @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy
*
- * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response.
+ * @param {string} [options.acceptLanguage] - The preferred language for the response.
*
- * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
+ * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30.
*
- * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
+ * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
*
*/
constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions);
@@ -58,11 +58,11 @@ export default class ComputeManagementClient extends AzureServiceClient {
availabilitySets: operations.AvailabilitySets;
virtualMachineExtensionImages: operations.VirtualMachineExtensionImages;
virtualMachineExtensions: operations.VirtualMachineExtensions;
- virtualMachines: operations.VirtualMachines;
virtualMachineImages: operations.VirtualMachineImages;
usageOperations: operations.UsageOperations;
virtualMachineSizes: operations.VirtualMachineSizes;
images: operations.Images;
+ virtualMachines: operations.VirtualMachines;
virtualMachineScaleSets: operations.VirtualMachineScaleSets;
virtualMachineScaleSetExtensions: operations.VirtualMachineScaleSetExtensions;
virtualMachineScaleSetRollingUpgrades: operations.VirtualMachineScaleSetRollingUpgrades;
diff --git a/lib/services/computeManagement2/lib/computeManagementClient.js b/lib/services/computeManagement2/lib/computeManagementClient.js
index 15a0e2a7d3..b0d346e06d 100644
--- a/lib/services/computeManagement2/lib/computeManagementClient.js
+++ b/lib/services/computeManagement2/lib/computeManagementClient.js
@@ -34,9 +34,9 @@ class ComputeManagementClient extends ServiceClient {
* @param {object} [options.requestOptions] - Options for the underlying request object
* {@link https://github.com/request/request#requestoptions-callback Options doc}
* @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy
- * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response.
- * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
- * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
+ * @param {string} [options.acceptLanguage] - The preferred language for the response.
+ * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30.
+ * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
*/
constructor(credentials, subscriptionId, baseUri, options) {
if (credentials === null || credentials === undefined) {
@@ -75,11 +75,11 @@ class ComputeManagementClient extends ServiceClient {
this.availabilitySets = new operations.AvailabilitySets(this);
this.virtualMachineExtensionImages = new operations.VirtualMachineExtensionImages(this);
this.virtualMachineExtensions = new operations.VirtualMachineExtensions(this);
- this.virtualMachines = new operations.VirtualMachines(this);
this.virtualMachineImages = new operations.VirtualMachineImages(this);
this.usageOperations = new operations.UsageOperations(this);
this.virtualMachineSizes = new operations.VirtualMachineSizes(this);
this.images = new operations.Images(this);
+ this.virtualMachines = new operations.VirtualMachines(this);
this.virtualMachineScaleSets = new operations.VirtualMachineScaleSets(this);
this.virtualMachineScaleSetExtensions = new operations.VirtualMachineScaleSetExtensions(this);
this.virtualMachineScaleSetRollingUpgrades = new operations.VirtualMachineScaleSetRollingUpgrades(this);
diff --git a/lib/services/computeManagement2/lib/models/accessUri.js b/lib/services/computeManagement2/lib/models/accessUri.js
index 2f3d401a97..3fa859d644 100644
--- a/lib/services/computeManagement2/lib/models/accessUri.js
+++ b/lib/services/computeManagement2/lib/models/accessUri.js
@@ -39,7 +39,7 @@ class AccessUri {
accessSAS: {
required: false,
readOnly: true,
- serializedName: 'properties.output.accessSAS',
+ serializedName: 'accessSAS',
type: {
name: 'String'
}
diff --git a/lib/services/computeManagement2/lib/models/apiError.js b/lib/services/computeManagement2/lib/models/apiError.js
index 858ddc2ea9..9fd78c1fab 100644
--- a/lib/services/computeManagement2/lib/models/apiError.js
+++ b/lib/services/computeManagement2/lib/models/apiError.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Api error.
*
diff --git a/lib/services/computeManagement2/lib/models/autoOSUpgradePolicy.js b/lib/services/computeManagement2/lib/models/autoOSUpgradePolicy.js
new file mode 100644
index 0000000000..e2aeb119c6
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/autoOSUpgradePolicy.js
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * The configuration parameters used for performing automatic OS upgrade.
+ *
+ */
+class AutoOSUpgradePolicy {
+ /**
+ * Create a AutoOSUpgradePolicy.
+ * @member {boolean} [disableAutoRollback] Whether OS image rollback feature
+ * should be disabled. Default value is false.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of AutoOSUpgradePolicy
+ *
+ * @returns {object} metadata of AutoOSUpgradePolicy
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'AutoOSUpgradePolicy',
+ type: {
+ name: 'Composite',
+ className: 'AutoOSUpgradePolicy',
+ modelProperties: {
+ disableAutoRollback: {
+ required: false,
+ serializedName: 'disableAutoRollback',
+ type: {
+ name: 'Boolean'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = AutoOSUpgradePolicy;
diff --git a/lib/services/computeManagement2/lib/models/availabilitySetListResult.js b/lib/services/computeManagement2/lib/models/availabilitySetListResult.js
index 62c74689b8..e09a1f8b3d 100644
--- a/lib/services/computeManagement2/lib/models/availabilitySetListResult.js
+++ b/lib/services/computeManagement2/lib/models/availabilitySetListResult.js
@@ -16,6 +16,9 @@
class AvailabilitySetListResult extends Array {
/**
* Create a AvailabilitySetListResult.
+ * @member {string} [nextLink] The URI to fetch the next page of
+ * AvailabilitySets. Call ListNext() with this URI to fetch the next page of
+ * AvailabilitySets.
*/
constructor() {
super();
@@ -36,7 +39,7 @@ class AvailabilitySetListResult extends Array {
className: 'AvailabilitySetListResult',
modelProperties: {
value: {
- required: false,
+ required: true,
serializedName: '',
type: {
name: 'Sequence',
@@ -49,6 +52,13 @@ class AvailabilitySetListResult extends Array {
}
}
}
+ },
+ nextLink: {
+ required: false,
+ serializedName: 'nextLink',
+ type: {
+ name: 'String'
+ }
}
}
}
diff --git a/lib/services/computeManagement2/lib/models/availabilitySetUpdate.js b/lib/services/computeManagement2/lib/models/availabilitySetUpdate.js
index b87f466cd2..2ce9f094d5 100644
--- a/lib/services/computeManagement2/lib/models/availabilitySetUpdate.js
+++ b/lib/services/computeManagement2/lib/models/availabilitySetUpdate.js
@@ -14,15 +14,7 @@ const models = require('./index');
/**
* Specifies information about the availability set that the virtual machine
- * should be assigned to. Virtual machines specified in the same availability
- * set are allocated to different nodes to maximize availability. For more
- * information about availability sets, see [Manage the availability of virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- *
For more information on Azure planned maintainance, see [Planned
- * maintenance for virtual machines in
- * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
- *
Currently, a VM can only be added to availability set at creation
- * time. An existing VM cannot be added to an availability set.
+ * should be assigned to. Only tags may be updated.
*
* @extends models['UpdateResource']
*/
diff --git a/lib/services/computeManagement2/lib/models/containerServiceDiagnosticsProfile.js b/lib/services/computeManagement2/lib/models/containerServiceDiagnosticsProfile.js
index 97ca03d8ab..7307cbb2d1 100644
--- a/lib/services/computeManagement2/lib/models/containerServiceDiagnosticsProfile.js
+++ b/lib/services/computeManagement2/lib/models/containerServiceDiagnosticsProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Class representing a ContainerServiceDiagnosticsProfile.
*/
diff --git a/lib/services/computeManagement2/lib/models/containerServiceLinuxProfile.js b/lib/services/computeManagement2/lib/models/containerServiceLinuxProfile.js
index f651f9ec06..a4c6e59a87 100644
--- a/lib/services/computeManagement2/lib/models/containerServiceLinuxProfile.js
+++ b/lib/services/computeManagement2/lib/models/containerServiceLinuxProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Profile for Linux VMs in the container service cluster.
*
diff --git a/lib/services/computeManagement2/lib/models/containerServiceSshConfiguration.js b/lib/services/computeManagement2/lib/models/containerServiceSshConfiguration.js
index 49c1c1cb97..f2399c73e1 100644
--- a/lib/services/computeManagement2/lib/models/containerServiceSshConfiguration.js
+++ b/lib/services/computeManagement2/lib/models/containerServiceSshConfiguration.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* SSH configuration for Linux-based VMs running on Azure.
*
diff --git a/lib/services/computeManagement2/lib/models/creationData.js b/lib/services/computeManagement2/lib/models/creationData.js
index 0bd210c44a..207f670835 100644
--- a/lib/services/computeManagement2/lib/models/creationData.js
+++ b/lib/services/computeManagement2/lib/models/creationData.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Data used when creating a disk.
*
diff --git a/lib/services/computeManagement2/lib/models/dataDisk.js b/lib/services/computeManagement2/lib/models/dataDisk.js
index 5a4e36bacb..f9fae37349 100644
--- a/lib/services/computeManagement2/lib/models/dataDisk.js
+++ b/lib/services/computeManagement2/lib/models/dataDisk.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a data disk.
*
@@ -50,8 +48,9 @@ class DataDisk {
* virtual machine image.
This value cannot be larger than 1023 GB
* @member {object} [managedDisk] The managed disk parameters.
* @member {string} [managedDisk.storageAccountType] Specifies the storage
- * account type for the managed disk. Possible values are: Standard_LRS or
- * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * account type for the managed disk. Possible values are: Standard_LRS,
+ * Premium_LRS, and StandardSSD_LRS. Possible values include: 'Standard_LRS',
+ * 'Premium_LRS', 'StandardSSD_LRS'
*/
constructor() {
}
diff --git a/lib/services/computeManagement2/lib/models/diagnosticsProfile.js b/lib/services/computeManagement2/lib/models/diagnosticsProfile.js
index 3abafdb77e..1b3c01eca7 100644
--- a/lib/services/computeManagement2/lib/models/diagnosticsProfile.js
+++ b/lib/services/computeManagement2/lib/models/diagnosticsProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Specifies the boot diagnostic settings state.
Minimum api-version:
* 2015-06-15.
diff --git a/lib/services/computeManagement2/lib/models/disallowed.js b/lib/services/computeManagement2/lib/models/disallowed.js
new file mode 100644
index 0000000000..9376c28ab0
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/disallowed.js
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * Describes the disallowed disk types.
+ *
+ */
+class Disallowed {
+ /**
+ * Create a Disallowed.
+ * @member {array} [diskTypes] A list of disk types.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of Disallowed
+ *
+ * @returns {object} metadata of Disallowed
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'Disallowed',
+ type: {
+ name: 'Composite',
+ className: 'Disallowed',
+ modelProperties: {
+ diskTypes: {
+ required: false,
+ serializedName: 'diskTypes',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'StringElementType',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = Disallowed;
diff --git a/lib/services/computeManagement2/lib/models/disk.js b/lib/services/computeManagement2/lib/models/disk.js
index 470ae2c184..23236931f5 100644
--- a/lib/services/computeManagement2/lib/models/disk.js
+++ b/lib/services/computeManagement2/lib/models/disk.js
@@ -24,7 +24,7 @@ class Disk extends models['Resource'] {
* that has the disk attached.
* @member {object} [sku]
* @member {string} [sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {string} [sku.tier] The sku tier.
* @member {array} [zones] The Logical zone list for Disk.
* @member {date} [timeCreated] The time when the disk was created.
diff --git a/lib/services/computeManagement2/lib/models/diskEncryptionSettings.js b/lib/services/computeManagement2/lib/models/diskEncryptionSettings.js
index a90094cd64..a33e93f831 100644
--- a/lib/services/computeManagement2/lib/models/diskEncryptionSettings.js
+++ b/lib/services/computeManagement2/lib/models/diskEncryptionSettings.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a Encryption Settings for a Disk
*
diff --git a/lib/services/computeManagement2/lib/models/diskInstanceView.js b/lib/services/computeManagement2/lib/models/diskInstanceView.js
index 5350cc26c3..53b49e1f71 100644
--- a/lib/services/computeManagement2/lib/models/diskInstanceView.js
+++ b/lib/services/computeManagement2/lib/models/diskInstanceView.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* The instance view of the disk.
*
diff --git a/lib/services/computeManagement2/lib/models/diskSku.js b/lib/services/computeManagement2/lib/models/diskSku.js
index f06042e1b9..d6f7c27c4c 100644
--- a/lib/services/computeManagement2/lib/models/diskSku.js
+++ b/lib/services/computeManagement2/lib/models/diskSku.js
@@ -11,14 +11,14 @@
'use strict';
/**
- * The disks sku name. Can be Standard_LRS or Premium_LRS.
+ * The disks sku name. Can be Standard_LRS, Premium_LRS, or StandardSSD_LRS.
*
*/
class DiskSku {
/**
* Create a DiskSku.
* @member {string} [name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {string} [tier] The sku tier. Default value: 'Standard' .
*/
constructor() {
diff --git a/lib/services/computeManagement2/lib/models/diskUpdate.js b/lib/services/computeManagement2/lib/models/diskUpdate.js
index a9899f37c5..68818a04b2 100644
--- a/lib/services/computeManagement2/lib/models/diskUpdate.js
+++ b/lib/services/computeManagement2/lib/models/diskUpdate.js
@@ -10,14 +10,11 @@
'use strict';
-const models = require('./index');
-
/**
* Disk update resource.
*
- * @extends models['ResourceUpdate']
*/
-class DiskUpdate extends models['ResourceUpdate'] {
+class DiskUpdate {
/**
* Create a DiskUpdate.
* @member {string} [osType] the Operating System type. Possible values
@@ -50,9 +47,13 @@ class DiskUpdate extends models['ResourceUpdate'] {
* Resource Id
* @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing
* to a key or secret in KeyVault
+ * @member {object} [tags] Resource tags
+ * @member {object} [sku]
+ * @member {string} [sku.name] The sku name. Possible values include:
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
+ * @member {string} [sku.tier] The sku tier.
*/
constructor() {
- super();
}
/**
@@ -69,28 +70,6 @@ class DiskUpdate extends models['ResourceUpdate'] {
name: 'Composite',
className: 'DiskUpdate',
modelProperties: {
- tags: {
- required: false,
- serializedName: 'tags',
- type: {
- name: 'Dictionary',
- value: {
- required: false,
- serializedName: 'StringElementType',
- type: {
- name: 'String'
- }
- }
- }
- },
- sku: {
- required: false,
- serializedName: 'sku',
- type: {
- name: 'Composite',
- className: 'DiskSku'
- }
- },
osType: {
required: false,
serializedName: 'properties.osType',
@@ -113,6 +92,28 @@ class DiskUpdate extends models['ResourceUpdate'] {
name: 'Composite',
className: 'EncryptionSettings'
}
+ },
+ tags: {
+ required: false,
+ serializedName: 'tags',
+ type: {
+ name: 'Dictionary',
+ value: {
+ required: false,
+ serializedName: 'StringElementType',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ },
+ sku: {
+ required: false,
+ serializedName: 'sku',
+ type: {
+ name: 'Composite',
+ className: 'DiskSku'
+ }
}
}
}
diff --git a/lib/services/computeManagement2/lib/models/encryptionSettings.js b/lib/services/computeManagement2/lib/models/encryptionSettings.js
index 61dd97452c..53f476b2b7 100644
--- a/lib/services/computeManagement2/lib/models/encryptionSettings.js
+++ b/lib/services/computeManagement2/lib/models/encryptionSettings.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Encryption settings for disk or snapshot
*
diff --git a/lib/services/computeManagement2/lib/models/gallery.js b/lib/services/computeManagement2/lib/models/gallery.js
new file mode 100644
index 0000000000..08b43a45d4
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/gallery.js
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const models = require('./index');
+
+/**
+ * Specifies information about the gallery that you want to create or update.
+ *
+ * @extends models['Resource']
+ */
+class Gallery extends models['Resource'] {
+ /**
+ * Create a Gallery.
+ * @member {string} [description] The description of this gallery resource.
+ * @member {object} [identifier]
+ * @member {string} [identifier.uniqueName] The unique name of the gallery
+ * @member {string} [provisioningState] The current state of the gallery. The
+ * provisioning state, which only appears in the response. Possible values
+ * include: 'Creating', 'Updating', 'Failed', 'Succeeded', 'Deleting',
+ * 'Migrating'
+ */
+ constructor() {
+ super();
+ }
+
+ /**
+ * Defines the metadata of Gallery
+ *
+ * @returns {object} metadata of Gallery
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'Gallery',
+ type: {
+ name: 'Composite',
+ className: 'Gallery',
+ modelProperties: {
+ id: {
+ required: false,
+ readOnly: true,
+ serializedName: 'id',
+ type: {
+ name: 'String'
+ }
+ },
+ name: {
+ required: false,
+ readOnly: true,
+ serializedName: 'name',
+ type: {
+ name: 'String'
+ }
+ },
+ type: {
+ required: false,
+ readOnly: true,
+ serializedName: 'type',
+ type: {
+ name: 'String'
+ }
+ },
+ location: {
+ required: true,
+ serializedName: 'location',
+ type: {
+ name: 'String'
+ }
+ },
+ tags: {
+ required: false,
+ serializedName: 'tags',
+ type: {
+ name: 'Dictionary',
+ value: {
+ required: false,
+ serializedName: 'StringElementType',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ },
+ description: {
+ required: false,
+ serializedName: 'properties.description',
+ type: {
+ name: 'String'
+ }
+ },
+ identifier: {
+ required: false,
+ serializedName: 'properties.identifier',
+ type: {
+ name: 'Composite',
+ className: 'GalleryIdentifier'
+ }
+ },
+ provisioningState: {
+ required: false,
+ readOnly: true,
+ serializedName: 'properties.provisioningState',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = Gallery;
diff --git a/lib/services/computeManagement2/lib/models/galleryArtifactPublishingProfileBase.js b/lib/services/computeManagement2/lib/models/galleryArtifactPublishingProfileBase.js
new file mode 100644
index 0000000000..c1b20e9698
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/galleryArtifactPublishingProfileBase.js
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const models = require('./index');
+
+/**
+ * Describes the basic gallery artifact publishing profile.
+ *
+ */
+class GalleryArtifactPublishingProfileBase {
+ /**
+ * Create a GalleryArtifactPublishingProfileBase.
+ * @member {array} [regions] The regions where the artifact is going to be
+ * published.
+ * @member {object} [source]
+ * @member {object} [source.managedImage]
+ * @member {string} [source.managedImage.id] The managed artifact id.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of GalleryArtifactPublishingProfileBase
+ *
+ * @returns {object} metadata of GalleryArtifactPublishingProfileBase
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'GalleryArtifactPublishingProfileBase',
+ type: {
+ name: 'Composite',
+ className: 'GalleryArtifactPublishingProfileBase',
+ modelProperties: {
+ regions: {
+ required: false,
+ serializedName: 'regions',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'StringElementType',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ },
+ source: {
+ required: false,
+ serializedName: 'source',
+ type: {
+ name: 'Composite',
+ className: 'GalleryArtifactSource'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = GalleryArtifactPublishingProfileBase;
diff --git a/lib/services/computeManagement2/lib/models/galleryArtifactSource.js b/lib/services/computeManagement2/lib/models/galleryArtifactSource.js
new file mode 100644
index 0000000000..3a7a7e3c1a
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/galleryArtifactSource.js
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const models = require('./index');
+
+/**
+ * The source of the gallery artifact.
+ *
+ */
+class GalleryArtifactSource {
+ /**
+ * Create a GalleryArtifactSource.
+ * @member {object} [managedImage]
+ * @member {string} [managedImage.id] The managed artifact id.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of GalleryArtifactSource
+ *
+ * @returns {object} metadata of GalleryArtifactSource
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'GalleryArtifactSource',
+ type: {
+ name: 'Composite',
+ className: 'GalleryArtifactSource',
+ modelProperties: {
+ managedImage: {
+ required: false,
+ serializedName: 'managedImage',
+ type: {
+ name: 'Composite',
+ className: 'ManagedArtifact'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = GalleryArtifactSource;
diff --git a/lib/services/computeManagement2/lib/models/galleryDataDiskImage.js b/lib/services/computeManagement2/lib/models/galleryDataDiskImage.js
new file mode 100644
index 0000000000..64f6b11538
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/galleryDataDiskImage.js
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const models = require('./index');
+
+/**
+ * This is the data disk image.
+ *
+ * @extends models['GalleryDiskImage']
+ */
+class GalleryDataDiskImage extends models['GalleryDiskImage'] {
+ /**
+ * Create a GalleryDataDiskImage.
+ * @member {number} [lun] Specifies the logical unit number of the data disk.
+ * This value is used to identify data disks within the VM and therefore must
+ * be unique for each data disk attached to a VM.
+ */
+ constructor() {
+ super();
+ }
+
+ /**
+ * Defines the metadata of GalleryDataDiskImage
+ *
+ * @returns {object} metadata of GalleryDataDiskImage
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'GalleryDataDiskImage',
+ type: {
+ name: 'Composite',
+ className: 'GalleryDataDiskImage',
+ modelProperties: {
+ sizedInGB: {
+ required: false,
+ serializedName: 'sizedInGB',
+ type: {
+ name: 'Number'
+ }
+ },
+ hostCaching: {
+ required: false,
+ serializedName: 'hostCaching',
+ type: {
+ name: 'Enum',
+ allowedValues: [ 'None', 'ReadOnly', 'ReadWrite' ]
+ }
+ },
+ lun: {
+ required: false,
+ serializedName: 'lun',
+ type: {
+ name: 'Number'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = GalleryDataDiskImage;
diff --git a/lib/services/computeManagement2/lib/models/galleryDiskImage.js b/lib/services/computeManagement2/lib/models/galleryDiskImage.js
new file mode 100644
index 0000000000..cec9fba41c
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/galleryDiskImage.js
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * This is the disk image base class.
+ *
+ */
+class GalleryDiskImage {
+ /**
+ * Create a GalleryDiskImage.
+ * @member {number} [sizedInGB] It indicates the size of the VHD to create.
+ * @member {string} [hostCaching] The host caching of the disk. Valid values
+ * are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'None',
+ * 'ReadOnly', 'ReadWrite'
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of GalleryDiskImage
+ *
+ * @returns {object} metadata of GalleryDiskImage
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'GalleryDiskImage',
+ type: {
+ name: 'Composite',
+ className: 'GalleryDiskImage',
+ modelProperties: {
+ sizedInGB: {
+ required: false,
+ serializedName: 'sizedInGB',
+ type: {
+ name: 'Number'
+ }
+ },
+ hostCaching: {
+ required: false,
+ serializedName: 'hostCaching',
+ type: {
+ name: 'Enum',
+ allowedValues: [ 'None', 'ReadOnly', 'ReadWrite' ]
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = GalleryDiskImage;
diff --git a/lib/services/computeManagement2/lib/models/galleryIdentifier.js b/lib/services/computeManagement2/lib/models/galleryIdentifier.js
new file mode 100644
index 0000000000..e46d6d12e0
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/galleryIdentifier.js
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * Class representing a GalleryIdentifier.
+ */
+class GalleryIdentifier {
+ /**
+ * Create a GalleryIdentifier.
+ * @member {string} [uniqueName] The unique name of the gallery
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of GalleryIdentifier
+ *
+ * @returns {object} metadata of GalleryIdentifier
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'GalleryIdentifier',
+ type: {
+ name: 'Composite',
+ className: 'GalleryIdentifier',
+ modelProperties: {
+ uniqueName: {
+ required: false,
+ readOnly: true,
+ serializedName: 'uniqueName',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = GalleryIdentifier;
diff --git a/lib/services/computeManagement2/lib/models/galleryImage.js b/lib/services/computeManagement2/lib/models/galleryImage.js
new file mode 100644
index 0000000000..74bab164a2
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/galleryImage.js
@@ -0,0 +1,222 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const models = require('./index');
+
+/**
+ * Specifies information about the gallery image that you want to create or
+ * update.
+ *
+ * @extends models['Resource']
+ */
+class GalleryImage extends models['Resource'] {
+ /**
+ * Create a GalleryImage.
+ * @member {string} [description] The description of this gallery image
+ * resource.
+ * @member {string} [eula] The Eula agreement for the gallery image.
+ * @member {string} [privacyStatementUri] The privacy statement uri.
+ * @member {string} [releaseNoteUri] The release note uri.
+ * @member {string} [osType] This property allows you to specify the type of
+ * the OS that is included in the disk if creating a VM from user-image or a
+ * specialized VHD.
Possible values are:
**Windows**
+ *
**Linux**. Possible values include: 'Windows', 'Linux'
+ * @member {string} [osState] The OS State. Possible values include:
+ * 'Generalized', 'Specialized'
+ * @member {date} [endOfLifeDate] The end of life of this gallery image.
+ * @member {object} [identifier]
+ * @member {string} [identifier.publisher] The gallery image publisher name.
+ * @member {string} [identifier.offer] The gallery image offer name.
+ * @member {string} [identifier.sku] The gallery image sku name.
+ * @member {object} [recommended]
+ * @member {object} [recommended.vCPUs]
+ * @member {number} [recommended.vCPUs.min] The minimum number of the
+ * resource.
+ * @member {number} [recommended.vCPUs.max] The maximum number of the
+ * resource.
+ * @member {object} [recommended.memory]
+ * @member {number} [recommended.memory.min] The minimum number of the
+ * resource.
+ * @member {number} [recommended.memory.max] The maximum number of the
+ * resource.
+ * @member {object} [disallowed]
+ * @member {array} [disallowed.diskTypes] A list of disk types.
+ * @member {object} [purchasePlan]
+ * @member {string} [purchasePlan.name] The plan ID.
+ * @member {string} [purchasePlan.publisher] The publisher ID.
+ * @member {string} [purchasePlan.product] The product ID.
+ * @member {string} [provisioningState] The current state of the gallery
+ * image. The provisioning state, which only appears in the response.
+ * Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded',
+ * 'Deleting', 'Migrating'
+ */
+ constructor() {
+ super();
+ }
+
+ /**
+ * Defines the metadata of GalleryImage
+ *
+ * @returns {object} metadata of GalleryImage
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'GalleryImage',
+ type: {
+ name: 'Composite',
+ className: 'GalleryImage',
+ modelProperties: {
+ id: {
+ required: false,
+ readOnly: true,
+ serializedName: 'id',
+ type: {
+ name: 'String'
+ }
+ },
+ name: {
+ required: false,
+ readOnly: true,
+ serializedName: 'name',
+ type: {
+ name: 'String'
+ }
+ },
+ type: {
+ required: false,
+ readOnly: true,
+ serializedName: 'type',
+ type: {
+ name: 'String'
+ }
+ },
+ location: {
+ required: true,
+ serializedName: 'location',
+ type: {
+ name: 'String'
+ }
+ },
+ tags: {
+ required: false,
+ serializedName: 'tags',
+ type: {
+ name: 'Dictionary',
+ value: {
+ required: false,
+ serializedName: 'StringElementType',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ },
+ description: {
+ required: false,
+ serializedName: 'properties.description',
+ type: {
+ name: 'String'
+ }
+ },
+ eula: {
+ required: false,
+ serializedName: 'properties.eula',
+ type: {
+ name: 'String'
+ }
+ },
+ privacyStatementUri: {
+ required: false,
+ serializedName: 'properties.privacyStatementUri',
+ type: {
+ name: 'String'
+ }
+ },
+ releaseNoteUri: {
+ required: false,
+ serializedName: 'properties.releaseNoteUri',
+ type: {
+ name: 'String'
+ }
+ },
+ osType: {
+ required: false,
+ serializedName: 'properties.osType',
+ type: {
+ name: 'Enum',
+ allowedValues: [ 'Windows', 'Linux' ]
+ }
+ },
+ osState: {
+ required: false,
+ serializedName: 'properties.osState',
+ type: {
+ name: 'Enum',
+ allowedValues: [ 'Generalized', 'Specialized' ]
+ }
+ },
+ endOfLifeDate: {
+ required: false,
+ serializedName: 'properties.endOfLifeDate',
+ type: {
+ name: 'Date'
+ }
+ },
+ identifier: {
+ required: false,
+ serializedName: 'properties.identifier',
+ type: {
+ name: 'Composite',
+ className: 'GalleryImageIdentifier'
+ }
+ },
+ recommended: {
+ required: false,
+ serializedName: 'properties.recommended',
+ type: {
+ name: 'Composite',
+ className: 'RecommendedMachineConfiguration'
+ }
+ },
+ disallowed: {
+ required: false,
+ serializedName: 'properties.disallowed',
+ type: {
+ name: 'Composite',
+ className: 'Disallowed'
+ }
+ },
+ purchasePlan: {
+ required: false,
+ serializedName: 'properties.purchasePlan',
+ type: {
+ name: 'Composite',
+ className: 'ImagePurchasePlan'
+ }
+ },
+ provisioningState: {
+ required: false,
+ readOnly: true,
+ serializedName: 'properties.provisioningState',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = GalleryImage;
diff --git a/lib/services/computeManagement2/lib/models/galleryImageIdentifier.js b/lib/services/computeManagement2/lib/models/galleryImageIdentifier.js
new file mode 100644
index 0000000000..6828d2276d
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/galleryImageIdentifier.js
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * This is the gallery image identifier.
+ *
+ */
+class GalleryImageIdentifier {
+ /**
+ * Create a GalleryImageIdentifier.
+ * @member {string} [publisher] The gallery image publisher name.
+ * @member {string} [offer] The gallery image offer name.
+ * @member {string} [sku] The gallery image sku name.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of GalleryImageIdentifier
+ *
+ * @returns {object} metadata of GalleryImageIdentifier
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'GalleryImageIdentifier',
+ type: {
+ name: 'Composite',
+ className: 'GalleryImageIdentifier',
+ modelProperties: {
+ publisher: {
+ required: false,
+ serializedName: 'publisher',
+ type: {
+ name: 'String'
+ }
+ },
+ offer: {
+ required: false,
+ serializedName: 'offer',
+ type: {
+ name: 'String'
+ }
+ },
+ sku: {
+ required: false,
+ serializedName: 'sku',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = GalleryImageIdentifier;
diff --git a/lib/services/computeManagement2/lib/models/galleryImageList.js b/lib/services/computeManagement2/lib/models/galleryImageList.js
new file mode 100644
index 0000000000..9c66d02ec3
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/galleryImageList.js
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * The List Gallery Images operation response.
+ */
+class GalleryImageList extends Array {
+ /**
+ * Create a GalleryImageList.
+ * @member {string} [nextLink] The uri to fetch the next page of gallery
+ * images. Call ListNext() with this to fetch the next page of gallery
+ * images.
+ */
+ constructor() {
+ super();
+ }
+
+ /**
+ * Defines the metadata of GalleryImageList
+ *
+ * @returns {object} metadata of GalleryImageList
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'GalleryImageList',
+ type: {
+ name: 'Composite',
+ className: 'GalleryImageList',
+ modelProperties: {
+ value: {
+ required: true,
+ serializedName: '',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'GalleryImageElementType',
+ type: {
+ name: 'Composite',
+ className: 'GalleryImage'
+ }
+ }
+ }
+ },
+ nextLink: {
+ required: false,
+ serializedName: 'nextLink',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = GalleryImageList;
diff --git a/lib/services/computeManagement2/lib/models/galleryImageVersion.js b/lib/services/computeManagement2/lib/models/galleryImageVersion.js
new file mode 100644
index 0000000000..286394a1f1
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/galleryImageVersion.js
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const models = require('./index');
+
+/**
+ * Specifies information about the gallery image version that you want to
+ * create or update.
+ *
+ * @extends models['Resource']
+ */
+class GalleryImageVersion extends models['Resource'] {
+ /**
+ * Create a GalleryImageVersion.
+ * @member {object} [publishingProfile]
+ * @member {boolean} [publishingProfile.excludeFromLatest] The flag means
+ * that if it is set to true, people deploying VMs with 'latest' as version
+ * will not use this version.
+ * @member {date} [publishingProfile.publishedDate] The time when the gallery
+ * image version is published.
+ * @member {date} [publishingProfile.endOfLifeDate] The end of life date of
+ * the gallery image version.
+ * @member {string} [provisioningState] The current state of the gallery
+ * image version. The provisioning state, which only appears in the response.
+ * Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded',
+ * 'Deleting', 'Migrating'
+ * @member {object} [storageProfile]
+ * @member {object} [storageProfile.osDiskImage]
+ * @member {array} [storageProfile.dataDiskImages] A list of data disk
+ * images.
+ * @member {object} [replicationStatus]
+ * @member {string} [replicationStatus.aggregatedState] This is the
+ * aggregated replication status based on the regional replication status.
+ * Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed'
+ * @member {array} [replicationStatus.summary] This is a summary of
+ * replication status for each region.
+ */
+ constructor() {
+ super();
+ }
+
+ /**
+ * Defines the metadata of GalleryImageVersion
+ *
+ * @returns {object} metadata of GalleryImageVersion
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'GalleryImageVersion',
+ type: {
+ name: 'Composite',
+ className: 'GalleryImageVersion',
+ modelProperties: {
+ id: {
+ required: false,
+ readOnly: true,
+ serializedName: 'id',
+ type: {
+ name: 'String'
+ }
+ },
+ name: {
+ required: false,
+ readOnly: true,
+ serializedName: 'name',
+ type: {
+ name: 'String'
+ }
+ },
+ type: {
+ required: false,
+ readOnly: true,
+ serializedName: 'type',
+ type: {
+ name: 'String'
+ }
+ },
+ location: {
+ required: true,
+ serializedName: 'location',
+ type: {
+ name: 'String'
+ }
+ },
+ tags: {
+ required: false,
+ serializedName: 'tags',
+ type: {
+ name: 'Dictionary',
+ value: {
+ required: false,
+ serializedName: 'StringElementType',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ },
+ publishingProfile: {
+ required: false,
+ serializedName: 'properties.publishingProfile',
+ type: {
+ name: 'Composite',
+ className: 'GalleryImageVersionPublishingProfile'
+ }
+ },
+ provisioningState: {
+ required: false,
+ readOnly: true,
+ serializedName: 'properties.provisioningState',
+ type: {
+ name: 'String'
+ }
+ },
+ storageProfile: {
+ required: false,
+ serializedName: 'properties.storageProfile',
+ type: {
+ name: 'Composite',
+ className: 'GalleryImageVersionStorageProfile'
+ }
+ },
+ replicationStatus: {
+ required: false,
+ serializedName: 'properties.replicationStatus',
+ type: {
+ name: 'Composite',
+ className: 'ReplicationStatus'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = GalleryImageVersion;
diff --git a/lib/services/computeManagement2/lib/models/galleryImageVersionList.js b/lib/services/computeManagement2/lib/models/galleryImageVersionList.js
new file mode 100644
index 0000000000..19bc6c80cf
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/galleryImageVersionList.js
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * The List Gallery Image version operation response.
+ */
+class GalleryImageVersionList extends Array {
+ /**
+ * Create a GalleryImageVersionList.
+ * @member {string} [nextLink] The uri to fetch the next page of gallery
+ * image versions. Call ListNext() with this to fetch the next page of
+ * gallery image versions.
+ */
+ constructor() {
+ super();
+ }
+
+ /**
+ * Defines the metadata of GalleryImageVersionList
+ *
+ * @returns {object} metadata of GalleryImageVersionList
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'GalleryImageVersionList',
+ type: {
+ name: 'Composite',
+ className: 'GalleryImageVersionList',
+ modelProperties: {
+ value: {
+ required: true,
+ serializedName: '',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'GalleryImageVersionElementType',
+ type: {
+ name: 'Composite',
+ className: 'GalleryImageVersion'
+ }
+ }
+ }
+ },
+ nextLink: {
+ required: false,
+ serializedName: 'nextLink',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = GalleryImageVersionList;
diff --git a/lib/services/computeManagement2/lib/models/galleryImageVersionPublishingProfile.js b/lib/services/computeManagement2/lib/models/galleryImageVersionPublishingProfile.js
new file mode 100644
index 0000000000..8e4803afdc
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/galleryImageVersionPublishingProfile.js
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const models = require('./index');
+
+/**
+ * The publishing profile of a gallery image version.
+ *
+ * @extends models['GalleryArtifactPublishingProfileBase']
+ */
+class GalleryImageVersionPublishingProfile extends models['GalleryArtifactPublishingProfileBase'] {
+ /**
+ * Create a GalleryImageVersionPublishingProfile.
+ * @member {boolean} [excludeFromLatest] The flag means that if it is set to
+ * true, people deploying VMs with 'latest' as version will not use this
+ * version.
+ * @member {date} [publishedDate] The time when the gallery image version is
+ * published.
+ * @member {date} [endOfLifeDate] The end of life date of the gallery image
+ * version.
+ */
+ constructor() {
+ super();
+ }
+
+ /**
+ * Defines the metadata of GalleryImageVersionPublishingProfile
+ *
+ * @returns {object} metadata of GalleryImageVersionPublishingProfile
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'GalleryImageVersionPublishingProfile',
+ type: {
+ name: 'Composite',
+ className: 'GalleryImageVersionPublishingProfile',
+ modelProperties: {
+ regions: {
+ required: false,
+ serializedName: 'regions',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'StringElementType',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ },
+ source: {
+ required: false,
+ serializedName: 'source',
+ type: {
+ name: 'Composite',
+ className: 'GalleryArtifactSource'
+ }
+ },
+ excludeFromLatest: {
+ required: false,
+ serializedName: 'excludeFromLatest',
+ type: {
+ name: 'Boolean'
+ }
+ },
+ publishedDate: {
+ required: false,
+ readOnly: true,
+ serializedName: 'publishedDate',
+ type: {
+ name: 'Date'
+ }
+ },
+ endOfLifeDate: {
+ required: false,
+ serializedName: 'endOfLifeDate',
+ type: {
+ name: 'Date'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = GalleryImageVersionPublishingProfile;
diff --git a/lib/services/computeManagement2/lib/models/galleryImageVersionStorageProfile.js b/lib/services/computeManagement2/lib/models/galleryImageVersionStorageProfile.js
new file mode 100644
index 0000000000..b7b2b486f7
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/galleryImageVersionStorageProfile.js
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const models = require('./index');
+
+/**
+ * This is the storage profile of a gallery image version.
+ *
+ */
+class GalleryImageVersionStorageProfile {
+ /**
+ * Create a GalleryImageVersionStorageProfile.
+ * @member {object} [osDiskImage]
+ * @member {array} [dataDiskImages] A list of data disk images.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of GalleryImageVersionStorageProfile
+ *
+ * @returns {object} metadata of GalleryImageVersionStorageProfile
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'GalleryImageVersionStorageProfile',
+ type: {
+ name: 'Composite',
+ className: 'GalleryImageVersionStorageProfile',
+ modelProperties: {
+ osDiskImage: {
+ required: false,
+ serializedName: 'osDiskImage',
+ type: {
+ name: 'Composite',
+ className: 'GalleryOSDiskImage'
+ }
+ },
+ dataDiskImages: {
+ required: false,
+ serializedName: 'dataDiskImages',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'GalleryDataDiskImageElementType',
+ type: {
+ name: 'Composite',
+ className: 'GalleryDataDiskImage'
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = GalleryImageVersionStorageProfile;
diff --git a/lib/services/computeManagement2/lib/models/galleryList.js b/lib/services/computeManagement2/lib/models/galleryList.js
new file mode 100644
index 0000000000..3d28a0c7fe
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/galleryList.js
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * The List Galleries operation response.
+ */
+class GalleryList extends Array {
+ /**
+ * Create a GalleryList.
+ * @member {string} [nextLink] The uri to fetch the next page of galleries.
+ * Call ListNext() with this to fetch the next page of galleries.
+ */
+ constructor() {
+ super();
+ }
+
+ /**
+ * Defines the metadata of GalleryList
+ *
+ * @returns {object} metadata of GalleryList
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'GalleryList',
+ type: {
+ name: 'Composite',
+ className: 'GalleryList',
+ modelProperties: {
+ value: {
+ required: true,
+ serializedName: '',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'GalleryElementType',
+ type: {
+ name: 'Composite',
+ className: 'Gallery'
+ }
+ }
+ }
+ },
+ nextLink: {
+ required: false,
+ serializedName: 'nextLink',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = GalleryList;
diff --git a/lib/services/computeManagement2/lib/models/galleryOSDiskImage.js b/lib/services/computeManagement2/lib/models/galleryOSDiskImage.js
new file mode 100644
index 0000000000..a5a0915cc6
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/galleryOSDiskImage.js
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const models = require('./index');
+
+/**
+ * This is the OS disk image.
+ *
+ * @extends models['GalleryDiskImage']
+ */
+class GalleryOSDiskImage extends models['GalleryDiskImage'] {
+ /**
+ * Create a GalleryOSDiskImage.
+ */
+ constructor() {
+ super();
+ }
+
+ /**
+ * Defines the metadata of GalleryOSDiskImage
+ *
+ * @returns {object} metadata of GalleryOSDiskImage
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'GalleryOSDiskImage',
+ type: {
+ name: 'Composite',
+ className: 'GalleryOSDiskImage',
+ modelProperties: {
+ sizedInGB: {
+ required: false,
+ serializedName: 'sizedInGB',
+ type: {
+ name: 'Number'
+ }
+ },
+ hostCaching: {
+ required: false,
+ serializedName: 'hostCaching',
+ type: {
+ name: 'Enum',
+ allowedValues: [ 'None', 'ReadOnly', 'ReadWrite' ]
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = GalleryOSDiskImage;
diff --git a/lib/services/computeManagement2/lib/models/image.js b/lib/services/computeManagement2/lib/models/image.js
index 50e1764899..db72791ed9 100644
--- a/lib/services/computeManagement2/lib/models/image.js
+++ b/lib/services/computeManagement2/lib/models/image.js
@@ -53,8 +53,8 @@ class Image extends models['Resource'] {
* larger than 1023 GB
* @member {string} [storageProfile.osDisk.storageAccountType] Specifies the
* storage account type for the managed disk. Possible values are:
- * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values include:
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [storageProfile.dataDisks] Specifies the parameters that
* are used to add a data disk to a virtual machine.
For more
* information about disks, see [About disks and VHDs for Azure virtual
diff --git a/lib/services/computeManagement2/lib/models/imageDataDisk.js b/lib/services/computeManagement2/lib/models/imageDataDisk.js
index 1c4c5e7d30..f79608afe8 100644
--- a/lib/services/computeManagement2/lib/models/imageDataDisk.js
+++ b/lib/services/computeManagement2/lib/models/imageDataDisk.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a data disk.
*
@@ -36,8 +34,9 @@ class ImageDataDisk {
* gigabytes. This element can be used to overwrite the name of the disk in a
* virtual machine image.
This value cannot be larger than 1023 GB
* @member {string} [storageAccountType] Specifies the storage account type
- * for the managed disk. Possible values are: Standard_LRS or Premium_LRS.
- * Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * for the managed disk. Possible values are: Standard_LRS, Premium_LRS, and
+ * StandardSSD_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS',
+ * 'StandardSSD_LRS'
*/
constructor() {
}
diff --git a/lib/services/computeManagement2/lib/models/imageOSDisk.js b/lib/services/computeManagement2/lib/models/imageOSDisk.js
index 2e3abc90ec..72db90564c 100644
--- a/lib/services/computeManagement2/lib/models/imageOSDisk.js
+++ b/lib/services/computeManagement2/lib/models/imageOSDisk.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes an Operating System disk.
*
@@ -39,8 +37,9 @@ class ImageOSDisk {
* gigabytes. This element can be used to overwrite the name of the disk in a
* virtual machine image.
This value cannot be larger than 1023 GB
* @member {string} [storageAccountType] Specifies the storage account type
- * for the managed disk. Possible values are: Standard_LRS or Premium_LRS.
- * Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * for the managed disk. Possible values are: Standard_LRS, Premium_LRS, and
+ * StandardSSD_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS',
+ * 'StandardSSD_LRS'
*/
constructor() {
}
diff --git a/lib/services/computeManagement2/lib/models/imagePurchasePlan.js b/lib/services/computeManagement2/lib/models/imagePurchasePlan.js
new file mode 100644
index 0000000000..4725879e5a
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/imagePurchasePlan.js
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * Describes the gallery image purchase plan. This is used by marketplace
+ * images.
+ *
+ */
+class ImagePurchasePlan {
+ /**
+ * Create a ImagePurchasePlan.
+ * @member {string} [name] The plan ID.
+ * @member {string} [publisher] The publisher ID.
+ * @member {string} [product] The product ID.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of ImagePurchasePlan
+ *
+ * @returns {object} metadata of ImagePurchasePlan
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'ImagePurchasePlan',
+ type: {
+ name: 'Composite',
+ className: 'ImagePurchasePlan',
+ modelProperties: {
+ name: {
+ required: false,
+ serializedName: 'name',
+ type: {
+ name: 'String'
+ }
+ },
+ publisher: {
+ required: false,
+ serializedName: 'publisher',
+ type: {
+ name: 'String'
+ }
+ },
+ product: {
+ required: false,
+ serializedName: 'product',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = ImagePurchasePlan;
diff --git a/lib/services/computeManagement2/lib/models/imageStorageProfile.js b/lib/services/computeManagement2/lib/models/imageStorageProfile.js
index 1d36d1e724..1c819ec4eb 100644
--- a/lib/services/computeManagement2/lib/models/imageStorageProfile.js
+++ b/lib/services/computeManagement2/lib/models/imageStorageProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a storage profile.
*
@@ -44,8 +42,9 @@ class ImageStorageProfile {
* disk in a virtual machine image.
This value cannot be larger than
* 1023 GB
* @member {string} [osDisk.storageAccountType] Specifies the storage account
- * type for the managed disk. Possible values are: Standard_LRS or
- * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * type for the managed disk. Possible values are: Standard_LRS, Premium_LRS,
+ * and StandardSSD_LRS. Possible values include: 'Standard_LRS',
+ * 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [dataDisks] Specifies the parameters that are used to add
* a data disk to a virtual machine.
For more information about
* disks, see [About disks and VHDs for Azure virtual
diff --git a/lib/services/computeManagement2/lib/models/imageUpdate.js b/lib/services/computeManagement2/lib/models/imageUpdate.js
index 16ea2a9ac7..9ddd1afd4d 100644
--- a/lib/services/computeManagement2/lib/models/imageUpdate.js
+++ b/lib/services/computeManagement2/lib/models/imageUpdate.js
@@ -13,9 +13,7 @@
const models = require('./index');
/**
- * The source user image virtual hard disk. The virtual hard disk will be
- * copied before being attached to the virtual machine. If SourceImage is
- * provided, the destination virtual hard drive must not exist.
+ * The source user image virtual hard disk. Only tags may be updated.
*
* @extends models['UpdateResource']
*/
@@ -53,8 +51,8 @@ class ImageUpdate extends models['UpdateResource'] {
* larger than 1023 GB
* @member {string} [storageProfile.osDisk.storageAccountType] Specifies the
* storage account type for the managed disk. Possible values are:
- * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values include:
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [storageProfile.dataDisks] Specifies the parameters that
* are used to add a data disk to a virtual machine.
For more
* information about disks, see [About disks and VHDs for Azure virtual
diff --git a/lib/services/computeManagement2/lib/models/index.d.ts b/lib/services/computeManagement2/lib/models/index.d.ts
index e1e00fc3f7..07d1b17439 100644
--- a/lib/services/computeManagement2/lib/models/index.d.ts
+++ b/lib/services/computeManagement2/lib/models/index.d.ts
@@ -163,15 +163,7 @@ export interface UpdateResource extends BaseResource {
* Initializes a new instance of the AvailabilitySetUpdate class.
* @constructor
* Specifies information about the availability set that the virtual machine
- * should be assigned to. Virtual machines specified in the same availability
- * set are allocated to different nodes to maximize availability. For more
- * information about availability sets, see [Manage the availability of virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- *
For more information on Azure planned maintainance, see [Planned
- * maintenance for virtual machines in
- * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
- *
Currently, a VM can only be added to availability set at creation
- * time. An existing VM cannot be added to an availability set.
+ * should be assigned to. Only tags may be updated.
*
* @member {number} [platformUpdateDomainCount] Update Domain count.
* @member {number} [platformFaultDomainCount] Fault Domain count.
@@ -501,12 +493,19 @@ export interface VirtualMachineCaptureParameters {
* @class
* Initializes a new instance of the VirtualMachineCaptureResult class.
* @constructor
- * Resource Id.
+ * Output of virtual machine capture operation.
*
- * @member {object} [output] Operation output data (raw JSON)
+ * @member {string} [schema] the schema of the captured virtual machine
+ * @member {string} [contentVersion] the version of the content
+ * @member {object} [parameters] parameters of the captured virtual machine
+ * @member {array} [resources] a list of resource items of the captured virtual
+ * machine
*/
export interface VirtualMachineCaptureResult extends SubResource {
- output?: any;
+ readonly schema?: string;
+ readonly contentVersion?: string;
+ readonly parameters?: any;
+ readonly resources?: any[];
}
/**
@@ -709,8 +708,9 @@ export interface VirtualHardDisk {
* The parameters of a managed disk.
*
* @member {string} [storageAccountType] Specifies the storage account type for
- * the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible
- * values include: 'Standard_LRS', 'Premium_LRS'
+ * the managed disk. Possible values are: Standard_LRS, Premium_LRS, and
+ * StandardSSD_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS',
+ * 'StandardSSD_LRS'
*/
export interface ManagedDiskParameters extends SubResource {
storageAccountType?: string;
@@ -776,8 +776,9 @@ export interface ManagedDiskParameters extends SubResource {
* virtual machine image.
This value cannot be larger than 1023 GB
* @member {object} [managedDisk] The managed disk parameters.
* @member {string} [managedDisk.storageAccountType] Specifies the storage
- * account type for the managed disk. Possible values are: Standard_LRS or
- * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * account type for the managed disk. Possible values are: Standard_LRS,
+ * Premium_LRS, and StandardSSD_LRS. Possible values include: 'Standard_LRS',
+ * 'Premium_LRS', 'StandardSSD_LRS'
*/
export interface OSDisk {
osType?: string;
@@ -828,8 +829,9 @@ export interface OSDisk {
* virtual machine image.
This value cannot be larger than 1023 GB
* @member {object} [managedDisk] The managed disk parameters.
* @member {string} [managedDisk.storageAccountType] Specifies the storage
- * account type for the managed disk. Possible values are: Standard_LRS or
- * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * account type for the managed disk. Possible values are: Standard_LRS,
+ * Premium_LRS, and StandardSSD_LRS. Possible values include: 'Standard_LRS',
+ * 'Premium_LRS', 'StandardSSD_LRS'
*/
export interface DataDisk {
lun: number;
@@ -922,8 +924,9 @@ export interface DataDisk {
* 1023 GB
* @member {object} [osDisk.managedDisk] The managed disk parameters.
* @member {string} [osDisk.managedDisk.storageAccountType] Specifies the
- * storage account type for the managed disk. Possible values are: Standard_LRS
- * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * storage account type for the managed disk. Possible values are:
+ * Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values include:
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [dataDisks] Specifies the parameters that are used to add a
* data disk to a virtual machine.
For more information about disks,
* see [About disks and VHDs for Azure virtual
@@ -1080,10 +1083,16 @@ export interface SshConfiguration {
* @member {object} [ssh] Specifies the ssh key configuration for a Linux OS.
* @member {array} [ssh.publicKeys] The list of SSH public keys used to
* authenticate with linux based VMs.
+ * @member {boolean} [provisionVMAgent] Indicates whether virtual machine agent
+ * should be provisioned on the virtual machine.
When this property is
+ * not specified in the request body, default behavior is to set it to true.
+ * This will ensure that VM Agent is installed on the VM so that extensions can
+ * be added to the VM later.
*/
export interface LinuxConfiguration {
disablePasswordAuthentication?: boolean;
ssh?: SshConfiguration;
+ provisionVMAgent?: boolean;
}
/**
@@ -1208,8 +1217,16 @@ export interface VaultSecretGroup {
* configuration for a Linux OS.
* @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public
* keys used to authenticate with linux based VMs.
+ * @member {boolean} [linuxConfiguration.provisionVMAgent] Indicates whether
+ * virtual machine agent should be provisioned on the virtual machine.
+ * When this property is not specified in the request body, default behavior is
+ * to set it to true. This will ensure that VM Agent is installed on the VM so
+ * that extensions can be added to the VM later.
* @member {array} [secrets] Specifies set of certificates that should be
* installed onto the virtual machine.
+ * @member {boolean} [allowExtensionOperations] Specifies whether extension
+ * operations should be allowed on the virtual machine.
This may only
+ * be set to False when no extensions are present on the virtual machine.
*/
export interface OSProfile {
computerName?: string;
@@ -1219,6 +1236,7 @@ export interface OSProfile {
windowsConfiguration?: WindowsConfiguration;
linuxConfiguration?: LinuxConfiguration;
secrets?: VaultSecretGroup[];
+ allowExtensionOperations?: boolean;
}
/**
@@ -1363,6 +1381,18 @@ export interface BootDiagnosticsInstanceView {
serialConsoleLogBlobUri?: string;
}
+/**
+ * @class
+ * Initializes a new instance of the VirtualMachineIdentityUserAssignedIdentitiesValue class.
+ * @constructor
+ * @member {string} [principalId] The principal id of user assigned identity.
+ * @member {string} [clientId] The client id of user assigned identity.
+ */
+export interface VirtualMachineIdentityUserAssignedIdentitiesValue {
+ readonly principalId?: string;
+ readonly clientId?: string;
+}
+
/**
* @class
* Initializes a new instance of the VirtualMachineIdentity class.
@@ -1378,16 +1408,16 @@ export interface BootDiagnosticsInstanceView {
* identity and a set of user assigned identities. The type 'None' will remove
* any identities from the virtual machine. Possible values include:
* 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
- * @member {array} [identityIds] The list of user identities associated with
- * the Virtual Machine. The user identity references will be ARM resource ids
- * in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
+ * @member {object} [userAssignedIdentities] The list of user identities
+ * associated with the Virtual Machine. The user identity dictionary key
+ * references will be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
*/
export interface VirtualMachineIdentity {
readonly principalId?: string;
readonly tenantId?: string;
type?: string;
- identityIds?: string[];
+ userAssignedIdentities?: { [propertyName: string]: VirtualMachineIdentityUserAssignedIdentitiesValue };
}
/**
@@ -1657,8 +1687,8 @@ export interface VirtualMachineInstanceView {
* parameters.
* @member {string} [storageProfile.osDisk.managedDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [storageProfile.dataDisks] Specifies the parameters that are
* used to add a data disk to a virtual machine.
For more information
* about disks, see [About disks and VHDs for Azure virtual
@@ -1738,8 +1768,17 @@ export interface VirtualMachineInstanceView {
* configuration for a Linux OS.
* @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of
* SSH public keys used to authenticate with linux based VMs.
+ * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] Indicates
+ * whether virtual machine agent should be provisioned on the virtual machine.
+ *
When this property is not specified in the request body, default
+ * behavior is to set it to true. This will ensure that VM Agent is installed
+ * on the VM so that extensions can be added to the VM later.
* @member {array} [osProfile.secrets] Specifies set of certificates that
* should be installed onto the virtual machine.
+ * @member {boolean} [osProfile.allowExtensionOperations] Specifies whether
+ * extension operations should be allowed on the virtual machine.
This
+ * may only be set to False when no extensions are present on the virtual
+ * machine.
* @member {object} [networkProfile] Specifies the network interfaces of the
* virtual machine.
* @member {array} [networkProfile.networkInterfaces] Specifies the list of
@@ -1854,10 +1893,10 @@ export interface VirtualMachineInstanceView {
* created identity and a set of user assigned identities. The type 'None' will
* remove any identities from the virtual machine. Possible values include:
* 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
- * @member {array} [identity.identityIds] The list of user identities
- * associated with the Virtual Machine. The user identity references will be
- * ARM resource ids in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
+ * @member {object} [identity.userAssignedIdentities] The list of user
+ * identities associated with the Virtual Machine. The user identity dictionary
+ * key references will be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
* @member {array} [zones] The virtual machine zones.
*/
export interface VirtualMachine extends Resource {
@@ -1881,7 +1920,7 @@ export interface VirtualMachine extends Resource {
* @class
* Initializes a new instance of the VirtualMachineUpdate class.
* @constructor
- * Describes a Virtual Machine.
+ * Describes a Virtual Machine Update.
*
* @member {object} [plan] Specifies information about the marketplace image
* used to create the virtual machine. This element is only used for
@@ -2044,8 +2083,8 @@ export interface VirtualMachine extends Resource {
* parameters.
* @member {string} [storageProfile.osDisk.managedDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [storageProfile.dataDisks] Specifies the parameters that are
* used to add a data disk to a virtual machine.
For more information
* about disks, see [About disks and VHDs for Azure virtual
@@ -2125,8 +2164,17 @@ export interface VirtualMachine extends Resource {
* configuration for a Linux OS.
* @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of
* SSH public keys used to authenticate with linux based VMs.
+ * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] Indicates
+ * whether virtual machine agent should be provisioned on the virtual machine.
+ *
When this property is not specified in the request body, default
+ * behavior is to set it to true. This will ensure that VM Agent is installed
+ * on the VM so that extensions can be added to the VM later.
* @member {array} [osProfile.secrets] Specifies set of certificates that
* should be installed onto the virtual machine.
+ * @member {boolean} [osProfile.allowExtensionOperations] Specifies whether
+ * extension operations should be allowed on the virtual machine.
This
+ * may only be set to False when no extensions are present on the virtual
+ * machine.
* @member {object} [networkProfile] Specifies the network interfaces of the
* virtual machine.
* @member {array} [networkProfile.networkInterfaces] Specifies the list of
@@ -2240,10 +2288,10 @@ export interface VirtualMachine extends Resource {
* created identity and a set of user assigned identities. The type 'None' will
* remove any identities from the virtual machine. Possible values include:
* 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
- * @member {array} [identity.identityIds] The list of user identities
- * associated with the Virtual Machine. The user identity references will be
- * ARM resource ids in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
+ * @member {object} [identity.userAssignedIdentities] The list of user
+ * identities associated with the Virtual Machine. The user identity dictionary
+ * key references will be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
* @member {array} [zones] The virtual machine zones.
*/
export interface VirtualMachineUpdate extends UpdateResource {
@@ -2262,6 +2310,19 @@ export interface VirtualMachineUpdate extends UpdateResource {
zones?: string[];
}
+/**
+ * @class
+ * Initializes a new instance of the AutoOSUpgradePolicy class.
+ * @constructor
+ * The configuration parameters used for performing automatic OS upgrade.
+ *
+ * @member {boolean} [disableAutoRollback] Whether OS image rollback feature
+ * should be disabled. Default value is false.
+ */
+export interface AutoOSUpgradePolicy {
+ disableAutoRollback?: boolean;
+}
+
/**
* @class
* Initializes a new instance of the RollingUpgradePolicy class.
@@ -2336,11 +2397,16 @@ export interface RollingUpgradePolicy {
* @member {boolean} [automaticOSUpgrade] Whether OS upgrades should
* automatically be applied to scale set instances in a rolling fashion when a
* newer version of the image becomes available.
+ * @member {object} [autoOSUpgradePolicy] Configuration parameters used for
+ * performing automatic OS Upgrade.
+ * @member {boolean} [autoOSUpgradePolicy.disableAutoRollback] Whether OS image
+ * rollback feature should be disabled. Default value is false.
*/
export interface UpgradePolicy {
mode?: string;
rollingUpgradePolicy?: RollingUpgradePolicy;
automaticOSUpgrade?: boolean;
+ autoOSUpgradePolicy?: AutoOSUpgradePolicy;
}
/**
@@ -2368,8 +2434,9 @@ export interface UpgradePolicy {
* gigabytes. This element can be used to overwrite the name of the disk in a
* virtual machine image.
This value cannot be larger than 1023 GB
* @member {string} [storageAccountType] Specifies the storage account type for
- * the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible
- * values include: 'Standard_LRS', 'Premium_LRS'
+ * the managed disk. Possible values are: Standard_LRS, Premium_LRS, and
+ * StandardSSD_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS',
+ * 'StandardSSD_LRS'
*/
export interface ImageOSDisk {
osType: string;
@@ -2404,8 +2471,9 @@ export interface ImageOSDisk {
* gigabytes. This element can be used to overwrite the name of the disk in a
* virtual machine image.
This value cannot be larger than 1023 GB
* @member {string} [storageAccountType] Specifies the storage account type for
- * the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible
- * values include: 'Standard_LRS', 'Premium_LRS'
+ * the managed disk. Possible values are: Standard_LRS, Premium_LRS, and
+ * StandardSSD_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS',
+ * 'StandardSSD_LRS'
*/
export interface ImageDataDisk {
lun: number;
@@ -2447,8 +2515,9 @@ export interface ImageDataDisk {
* in gigabytes. This element can be used to overwrite the name of the disk in
* a virtual machine image.
This value cannot be larger than 1023 GB
* @member {string} [osDisk.storageAccountType] Specifies the storage account
- * type for the managed disk. Possible values are: Standard_LRS or Premium_LRS.
- * Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * type for the managed disk. Possible values are: Standard_LRS, Premium_LRS,
+ * and StandardSSD_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS',
+ * 'StandardSSD_LRS'
* @member {array} [dataDisks] Specifies the parameters that are used to add a
* data disk to a virtual machine.
For more information about disks,
* see [About disks and VHDs for Azure virtual
@@ -2501,8 +2570,9 @@ export interface ImageStorageProfile {
* name of the disk in a virtual machine image.
This value cannot be
* larger than 1023 GB
* @member {string} [storageProfile.osDisk.storageAccountType] Specifies the
- * storage account type for the managed disk. Possible values are: Standard_LRS
- * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * storage account type for the managed disk. Possible values are:
+ * Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values include:
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [storageProfile.dataDisks] Specifies the parameters that are
* used to add a data disk to a virtual machine.
For more information
* about disks, see [About disks and VHDs for Azure virtual
@@ -2522,9 +2592,7 @@ export interface Image extends Resource {
* @class
* Initializes a new instance of the ImageUpdate class.
* @constructor
- * The source user image virtual hard disk. The virtual hard disk will be
- * copied before being attached to the virtual machine. If SourceImage is
- * provided, the destination virtual hard drive must not exist.
+ * The source user image virtual hard disk. Only tags may be updated.
*
* @member {object} [sourceVirtualMachine] The source virtual machine from
* which Image is created.
@@ -2556,8 +2624,9 @@ export interface Image extends Resource {
* name of the disk in a virtual machine image.
This value cannot be
* larger than 1023 GB
* @member {string} [storageProfile.osDisk.storageAccountType] Specifies the
- * storage account type for the managed disk. Possible values are: Standard_LRS
- * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * storage account type for the managed disk. Possible values are:
+ * Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values include:
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [storageProfile.dataDisks] Specifies the parameters that are
* used to add a data disk to a virtual machine.
For more information
* about disks, see [About disks and VHDs for Azure virtual
@@ -2573,6 +2642,18 @@ export interface ImageUpdate extends UpdateResource {
readonly provisioningState?: string;
}
+/**
+ * @class
+ * Initializes a new instance of the VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue class.
+ * @constructor
+ * @member {string} [principalId] The principal id of user assigned identity.
+ * @member {string} [clientId] The client id of user assigned identity.
+ */
+export interface VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue {
+ readonly principalId?: string;
+ readonly clientId?: string;
+}
+
/**
* @class
* Initializes a new instance of the VirtualMachineScaleSetIdentity class.
@@ -2591,16 +2672,16 @@ export interface ImageUpdate extends UpdateResource {
* 'None' will remove any identities from the virtual machine scale set.
* Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned,
* UserAssigned', 'None'
- * @member {array} [identityIds] The list of user identities associated with
- * the virtual machine scale set. The user identity references will be ARM
- * resource ids in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
+ * @member {object} [userAssignedIdentities] The list of user identities
+ * associated with the virtual machine scale set. The user identity dictionary
+ * key references will be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
*/
export interface VirtualMachineScaleSetIdentity {
readonly principalId?: string;
readonly tenantId?: string;
type?: string;
- identityIds?: string[];
+ userAssignedIdentities?: { [propertyName: string]: VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue };
}
/**
@@ -2678,6 +2759,11 @@ export interface VirtualMachineScaleSetIdentity {
* configuration for a Linux OS.
* @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public
* keys used to authenticate with linux based VMs.
+ * @member {boolean} [linuxConfiguration.provisionVMAgent] Indicates whether
+ * virtual machine agent should be provisioned on the virtual machine.
+ * When this property is not specified in the request body, default behavior is
+ * to set it to true. This will ensure that VM Agent is installed on the VM so
+ * that extensions can be added to the VM later.
* @member {array} [secrets] Specifies set of certificates that should be
* installed onto the virtual machines in the scale set.
*/
@@ -2724,6 +2810,11 @@ export interface VirtualMachineScaleSetOSProfile {
* configuration for a Linux OS.
* @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public
* keys used to authenticate with linux based VMs.
+ * @member {boolean} [linuxConfiguration.provisionVMAgent] Indicates whether
+ * virtual machine agent should be provisioned on the virtual machine.
+ * When this property is not specified in the request body, default behavior is
+ * to set it to true. This will ensure that VM Agent is installed on the VM so
+ * that extensions can be added to the VM later.
* @member {array} [secrets] The List of certificates for addition to the VM.
*/
export interface VirtualMachineScaleSetUpdateOSProfile {
@@ -2740,8 +2831,9 @@ export interface VirtualMachineScaleSetUpdateOSProfile {
* Describes the parameters of a ScaleSet managed disk.
*
* @member {string} [storageAccountType] Specifies the storage account type for
- * the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible
- * values include: 'Standard_LRS', 'Premium_LRS'
+ * the managed disk. Possible values are: Standard_LRS, Premium_LRS, and
+ * StandardSSD_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS',
+ * 'StandardSSD_LRS'
*/
export interface VirtualMachineScaleSetManagedDiskParameters {
storageAccountType?: string;
@@ -2767,6 +2859,10 @@ export interface VirtualMachineScaleSetManagedDiskParameters {
* the imageReference element described above. If you are using a marketplace
* image, you also use the plan element previously described. Possible values
* include: 'FromImage', 'Empty', 'Attach'
+ * @member {number} [diskSizeGB] Specifies the size of the operating system
+ * disk in gigabytes. This element can be used to overwrite the size of the
+ * disk in a virtual machine image.
This value cannot be larger than
+ * 1023 GB
* @member {string} [osType] This property allows you to specify the type of
* the OS that is included in the disk if creating a VM from user-image or a
* specialized VHD.
Possible values are:
**Windows**
@@ -2778,14 +2874,16 @@ export interface VirtualMachineScaleSetManagedDiskParameters {
* to store operating system disks for the scale set.
* @member {object} [managedDisk] The managed disk parameters.
* @member {string} [managedDisk.storageAccountType] Specifies the storage
- * account type for the managed disk. Possible values are: Standard_LRS or
- * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * account type for the managed disk. Possible values are: Standard_LRS,
+ * Premium_LRS, and StandardSSD_LRS. Possible values include: 'Standard_LRS',
+ * 'Premium_LRS', 'StandardSSD_LRS'
*/
export interface VirtualMachineScaleSetOSDisk {
name?: string;
caching?: string;
writeAcceleratorEnabled?: boolean;
createOption: string;
+ diskSizeGB?: number;
osType?: string;
image?: VirtualHardDisk;
vhdContainers?: string[];
@@ -2803,6 +2901,10 @@ export interface VirtualMachineScaleSetOSDisk {
* 'None', 'ReadOnly', 'ReadWrite'
* @member {boolean} [writeAcceleratorEnabled] Specifies whether
* writeAccelerator should be enabled or disabled on the disk.
+ * @member {number} [diskSizeGB] Specifies the size of the operating system
+ * disk in gigabytes. This element can be used to overwrite the size of the
+ * disk in a virtual machine image.
This value cannot be larger than
+ * 1023 GB
* @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
@@ -2812,12 +2914,14 @@ export interface VirtualMachineScaleSetOSDisk {
* uris.
* @member {object} [managedDisk] The managed disk parameters.
* @member {string} [managedDisk.storageAccountType] Specifies the storage
- * account type for the managed disk. Possible values are: Standard_LRS or
- * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * account type for the managed disk. Possible values are: Standard_LRS,
+ * Premium_LRS, and StandardSSD_LRS. Possible values include: 'Standard_LRS',
+ * 'Premium_LRS', 'StandardSSD_LRS'
*/
export interface VirtualMachineScaleSetUpdateOSDisk {
caching?: string;
writeAcceleratorEnabled?: boolean;
+ diskSizeGB?: number;
image?: VirtualHardDisk;
vhdContainers?: string[];
managedDisk?: VirtualMachineScaleSetManagedDiskParameters;
@@ -2842,12 +2946,13 @@ export interface VirtualMachineScaleSetUpdateOSDisk {
* @member {string} createOption The create option. Possible values include:
* 'FromImage', 'Empty', 'Attach'
* @member {number} [diskSizeGB] Specifies the size of an empty data disk in
- * gigabytes. This element can be used to overwrite the name of the disk in a
+ * gigabytes. This element can be used to overwrite the size of the disk in a
* virtual machine image.
This value cannot be larger than 1023 GB
* @member {object} [managedDisk] The managed disk parameters.
* @member {string} [managedDisk.storageAccountType] Specifies the storage
- * account type for the managed disk. Possible values are: Standard_LRS or
- * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * account type for the managed disk. Possible values are: Standard_LRS,
+ * Premium_LRS, and StandardSSD_LRS. Possible values include: 'Standard_LRS',
+ * 'Premium_LRS', 'StandardSSD_LRS'
*/
export interface VirtualMachineScaleSetDataDisk {
name?: string;
@@ -2900,6 +3005,10 @@ export interface VirtualMachineScaleSetDataDisk {
* the imageReference element described above. If you are using a marketplace
* image, you also use the plan element previously described. Possible values
* include: 'FromImage', 'Empty', 'Attach'
+ * @member {number} [osDisk.diskSizeGB] Specifies the size of the operating
+ * system disk in gigabytes. This element can be used to overwrite the size of
+ * the disk in a virtual machine image.
This value cannot be larger
+ * than 1023 GB
* @member {string} [osDisk.osType] This property allows you to specify the
* type of the OS that is included in the disk if creating a VM from user-image
* or a specialized VHD.
Possible values are:
**Windows**
@@ -2911,8 +3020,9 @@ export interface VirtualMachineScaleSetDataDisk {
* used to store operating system disks for the scale set.
* @member {object} [osDisk.managedDisk] The managed disk parameters.
* @member {string} [osDisk.managedDisk.storageAccountType] Specifies the
- * storage account type for the managed disk. Possible values are: Standard_LRS
- * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * storage account type for the managed disk. Possible values are:
+ * Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values include:
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [dataDisks] Specifies the parameters that are used to add
* data disks to the virtual machines in the scale set.
For more
* information about disks, see [About disks and VHDs for Azure virtual
@@ -2947,6 +3057,10 @@ export interface VirtualMachineScaleSetStorageProfile {
* 'None', 'ReadOnly', 'ReadWrite'
* @member {boolean} [osDisk.writeAcceleratorEnabled] Specifies whether
* writeAccelerator should be enabled or disabled on the disk.
+ * @member {number} [osDisk.diskSizeGB] Specifies the size of the operating
+ * system disk in gigabytes. This element can be used to overwrite the size of
+ * the disk in a virtual machine image.
This value cannot be larger
+ * than 1023 GB
* @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
@@ -2956,8 +3070,9 @@ export interface VirtualMachineScaleSetStorageProfile {
* container uris.
* @member {object} [osDisk.managedDisk] The managed disk parameters.
* @member {string} [osDisk.managedDisk.storageAccountType] Specifies the
- * storage account type for the managed disk. Possible values are: Standard_LRS
- * or Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * storage account type for the managed disk. Possible values are:
+ * Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values include:
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [dataDisks] The data disks.
*/
export interface VirtualMachineScaleSetUpdateStorageProfile {
@@ -2994,6 +3109,21 @@ export interface VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings {
domainNameLabel: string;
}
+/**
+ * @class
+ * Initializes a new instance of the VirtualMachineScaleSetIpTag class.
+ * @constructor
+ * Contains the IP tag associated with the public IP address.
+ *
+ * @member {string} [ipTagType] IP tag type. Example: FirstPartyUsage.
+ * @member {string} [tag] IP tag associated with the public IP. Example: SQL,
+ * Storage etc.
+ */
+export interface VirtualMachineScaleSetIpTag {
+ ipTagType?: string;
+ tag?: string;
+}
+
/**
* @class
* Initializes a new instance of the VirtualMachineScaleSetPublicIPAddressConfiguration class.
@@ -3009,11 +3139,18 @@ export interface VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings {
* @member {string} [dnsSettings.domainNameLabel] The Domain name label.The
* concatenation of the domain name label and vm index will be the domain name
* labels of the PublicIPAddress resources that will be created
+ * @member {array} [ipTags] The list of IP tags associated with the public IP
+ * address.
+ * @member {object} [publicIPPrefix] The PublicIPPrefix from which to allocate
+ * publicIP addresses.
+ * @member {string} [publicIPPrefix.id] Resource Id
*/
export interface VirtualMachineScaleSetPublicIPAddressConfiguration {
name: string;
idleTimeoutInMinutes?: number;
dnsSettings?: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings;
+ ipTags?: VirtualMachineScaleSetIpTag[];
+ publicIPPrefix?: SubResource;
}
/**
@@ -3062,6 +3199,12 @@ export interface VirtualMachineScaleSetUpdatePublicIPAddressConfiguration {
* The Domain name label.The concatenation of the domain name label and vm
* index will be the domain name labels of the PublicIPAddress resources that
* will be created
+ * @member {array} [publicIPAddressConfiguration.ipTags] The list of IP tags
+ * associated with the public IP address.
+ * @member {object} [publicIPAddressConfiguration.publicIPPrefix] The
+ * PublicIPPrefix from which to allocate publicIP addresses.
+ * @member {string} [publicIPAddressConfiguration.publicIPPrefix.id] Resource
+ * Id
* @member {string} [privateIPAddressVersion] Available from Api-Version
* 2017-03-30 onwards, it represents whether the specific ipconfiguration is
* IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and
@@ -3070,6 +3213,8 @@ export interface VirtualMachineScaleSetUpdatePublicIPAddressConfiguration {
* of references to backend address pools of application gateways. A scale set
* can reference backend address pools of multiple application gateways.
* Multiple scale sets cannot use the same application gateway.
+ * @member {array} [applicationSecurityGroups] Specifies an array of references
+ * to application security group.
* @member {array} [loadBalancerBackendAddressPools] Specifies an array of
* references to backend address pools of load balancers. A scale set can
* reference backend address pools of one public and one internal load
@@ -3086,6 +3231,7 @@ export interface VirtualMachineScaleSetIPConfiguration extends SubResource {
publicIPAddressConfiguration?: VirtualMachineScaleSetPublicIPAddressConfiguration;
privateIPAddressVersion?: string;
applicationGatewayBackendAddressPools?: SubResource[];
+ applicationSecurityGroups?: SubResource[];
loadBalancerBackendAddressPools?: SubResource[];
loadBalancerInboundNatPools?: SubResource[];
}
@@ -3120,6 +3266,8 @@ export interface VirtualMachineScaleSetIPConfiguration extends SubResource {
* 'IPv6'. Possible values include: 'IPv4', 'IPv6'
* @member {array} [applicationGatewayBackendAddressPools] The application
* gateway backend address pools.
+ * @member {array} [applicationSecurityGroups] Specifies an array of references
+ * to application security group.
* @member {array} [loadBalancerBackendAddressPools] The load balancer backend
* address pools.
* @member {array} [loadBalancerInboundNatPools] The load balancer inbound nat
@@ -3132,6 +3280,7 @@ export interface VirtualMachineScaleSetUpdateIPConfiguration extends SubResource
publicIPAddressConfiguration?: VirtualMachineScaleSetUpdatePublicIPAddressConfiguration;
privateIPAddressVersion?: string;
applicationGatewayBackendAddressPools?: SubResource[];
+ applicationSecurityGroups?: SubResource[];
loadBalancerBackendAddressPools?: SubResource[];
loadBalancerInboundNatPools?: SubResource[];
}
@@ -3387,6 +3536,11 @@ export interface VirtualMachineScaleSetExtensionProfile {
* configuration for a Linux OS.
* @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of
* SSH public keys used to authenticate with linux based VMs.
+ * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] Indicates
+ * whether virtual machine agent should be provisioned on the virtual machine.
+ *
When this property is not specified in the request body, default
+ * behavior is to set it to true. This will ensure that VM Agent is installed
+ * on the VM so that extensions can be added to the VM later.
* @member {array} [osProfile.secrets] Specifies set of certificates that
* should be installed onto the virtual machines in the scale set.
* @member {object} [storageProfile] Specifies the storage settings for the
@@ -3429,6 +3583,10 @@ export interface VirtualMachineScaleSetExtensionProfile {
* you also use the imageReference element described above. If you are using a
* marketplace image, you also use the plan element previously described.
* Possible values include: 'FromImage', 'Empty', 'Attach'
+ * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of
+ * the operating system disk in gigabytes. This element can be used to
+ * overwrite the size of the disk in a virtual machine image.
This
+ * value cannot be larger than 1023 GB
* @member {string} [storageProfile.osDisk.osType] This property allows you to
* specify the type of the OS that is included in the disk if creating a VM
* from user-image or a specialized VHD.
Possible values are:
@@ -3444,8 +3602,8 @@ export interface VirtualMachineScaleSetExtensionProfile {
* parameters.
* @member {string} [storageProfile.osDisk.managedDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [storageProfile.dataDisks] Specifies the parameters that are
* used to add data disks to the virtual machines in the scale set.
* For more information about disks, see [About disks and VHDs for Azure
@@ -3490,6 +3648,9 @@ export interface VirtualMachineScaleSetExtensionProfile {
* @member {string} [priority] Specifies the priority for the virtual machines
* in the scale set.
Minimum api-version: 2017-10-30-preview. Possible
* values include: 'Regular', 'Low'
+ * @member {string} [evictionPolicy] Specifies the eviction policy for virtual
+ * machines in a low priority scale set.
Minimum api-version:
+ * 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete'
*/
export interface VirtualMachineScaleSetVMProfile {
osProfile?: VirtualMachineScaleSetOSProfile;
@@ -3499,6 +3660,7 @@ export interface VirtualMachineScaleSetVMProfile {
extensionProfile?: VirtualMachineScaleSetExtensionProfile;
licenseType?: string;
priority?: string;
+ evictionPolicy?: string;
}
/**
@@ -3537,6 +3699,11 @@ export interface VirtualMachineScaleSetVMProfile {
* configuration for a Linux OS.
* @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of
* SSH public keys used to authenticate with linux based VMs.
+ * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] Indicates
+ * whether virtual machine agent should be provisioned on the virtual machine.
+ *
When this property is not specified in the request body, default
+ * behavior is to set it to true. This will ensure that VM Agent is installed
+ * on the VM so that extensions can be added to the VM later.
* @member {array} [osProfile.secrets] The List of certificates for addition to
* the VM.
* @member {object} [storageProfile] The virtual machine scale set storage
@@ -3560,6 +3727,10 @@ export interface VirtualMachineScaleSetVMProfile {
* values include: 'None', 'ReadOnly', 'ReadWrite'
* @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled] Specifies
* whether writeAccelerator should be enabled or disabled on the disk.
+ * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of
+ * the operating system disk in gigabytes. This element can be used to
+ * overwrite the size of the disk in a virtual machine image.
This
+ * value cannot be larger than 1023 GB
* @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
@@ -3572,8 +3743,8 @@ export interface VirtualMachineScaleSetVMProfile {
* parameters.
* @member {string} [storageProfile.osDisk.managedDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [storageProfile.dataDisks] The data disks.
* @member {object} [networkProfile] The virtual machine scale set network
* profile.
@@ -3671,6 +3842,11 @@ export interface VirtualMachineScaleSetUpdateVMProfile {
* @member {boolean} [upgradePolicy.automaticOSUpgrade] Whether OS upgrades
* should automatically be applied to scale set instances in a rolling fashion
* when a newer version of the image becomes available.
+ * @member {object} [upgradePolicy.autoOSUpgradePolicy] Configuration
+ * parameters used for performing automatic OS Upgrade.
+ * @member {boolean} [upgradePolicy.autoOSUpgradePolicy.disableAutoRollback]
+ * Whether OS image rollback feature should be disabled. Default value is
+ * false.
* @member {object} [virtualMachineProfile] The virtual machine profile.
* @member {object} [virtualMachineProfile.osProfile] Specifies the operating
* system settings for the virtual machines in the scale set.
@@ -3753,6 +3929,12 @@ export interface VirtualMachineScaleSetUpdateVMProfile {
* @member {array}
* [virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] The list
* of SSH public keys used to authenticate with linux based VMs.
+ * @member {boolean}
+ * [virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent]
+ * Indicates whether virtual machine agent should be provisioned on the virtual
+ * machine.
When this property is not specified in the request body,
+ * default behavior is to set it to true. This will ensure that VM Agent is
+ * installed on the VM so that extensions can be added to the VM later.
* @member {array} [virtualMachineProfile.osProfile.secrets] Specifies set of
* certificates that should be installed onto the virtual machines in the scale
* set.
@@ -3804,6 +3986,10 @@ export interface VirtualMachineScaleSetUpdateVMProfile {
* described above. If you are using a marketplace image, you also use the
* plan element previously described. Possible values include: 'FromImage',
* 'Empty', 'Attach'
+ * @member {number} [virtualMachineProfile.storageProfile.osDisk.diskSizeGB]
+ * Specifies the size of the operating system disk in gigabytes. This element
+ * can be used to overwrite the size of the disk in a virtual machine image.
+ *
This value cannot be larger than 1023 GB
* @member {string} [virtualMachineProfile.storageProfile.osDisk.osType] This
* property allows you to specify the type of the OS that is included in the
* disk if creating a VM from user-image or a specialized VHD.
@@ -3822,8 +4008,8 @@ export interface VirtualMachineScaleSetUpdateVMProfile {
* @member {string}
* [virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [virtualMachineProfile.storageProfile.dataDisks] Specifies
* the parameters that are used to add data disks to the virtual machines in
* the scale set.
For more information about disks, see [About disks
@@ -3874,6 +4060,10 @@ export interface VirtualMachineScaleSetUpdateVMProfile {
* @member {string} [virtualMachineProfile.priority] Specifies the priority for
* the virtual machines in the scale set.
Minimum api-version:
* 2017-10-30-preview. Possible values include: 'Regular', 'Low'
+ * @member {string} [virtualMachineProfile.evictionPolicy] Specifies the
+ * eviction policy for virtual machines in a low priority scale set.
+ *
Minimum api-version: 2017-10-30-preview. Possible values include:
+ * 'Deallocate', 'Delete'
* @member {string} [provisioningState] The provisioning state, which only
* appears in the response.
* @member {boolean} [overprovision] Specifies whether the Virtual Machine
@@ -3900,10 +4090,10 @@ export interface VirtualMachineScaleSetUpdateVMProfile {
* 'None' will remove any identities from the virtual machine scale set.
* Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned,
* UserAssigned', 'None'
- * @member {array} [identity.identityIds] The list of user identities
- * associated with the virtual machine scale set. The user identity references
- * will be ARM resource ids in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
+ * @member {object} [identity.userAssignedIdentities] The list of user
+ * identities associated with the virtual machine scale set. The user identity
+ * dictionary key references will be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
* @member {array} [zones] The virtual machine scale set zones.
*/
export interface VirtualMachineScaleSet extends Resource {
@@ -3980,6 +4170,11 @@ export interface VirtualMachineScaleSet extends Resource {
* @member {boolean} [upgradePolicy.automaticOSUpgrade] Whether OS upgrades
* should automatically be applied to scale set instances in a rolling fashion
* when a newer version of the image becomes available.
+ * @member {object} [upgradePolicy.autoOSUpgradePolicy] Configuration
+ * parameters used for performing automatic OS Upgrade.
+ * @member {boolean} [upgradePolicy.autoOSUpgradePolicy.disableAutoRollback]
+ * Whether OS image rollback feature should be disabled. Default value is
+ * false.
* @member {object} [virtualMachineProfile] The virtual machine profile.
* @member {object} [virtualMachineProfile.osProfile] The virtual machine scale
* set OS profile.
@@ -4019,6 +4214,12 @@ export interface VirtualMachineScaleSet extends Resource {
* @member {array}
* [virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] The list
* of SSH public keys used to authenticate with linux based VMs.
+ * @member {boolean}
+ * [virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent]
+ * Indicates whether virtual machine agent should be provisioned on the virtual
+ * machine.
When this property is not specified in the request body,
+ * default behavior is to set it to true. This will ensure that VM Agent is
+ * installed on the VM so that extensions can be added to the VM later.
* @member {array} [virtualMachineProfile.osProfile.secrets] The List of
* certificates for addition to the VM.
* @member {object} [virtualMachineProfile.storageProfile] The virtual machine
@@ -4048,6 +4249,10 @@ export interface VirtualMachineScaleSet extends Resource {
* [virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled]
* Specifies whether writeAccelerator should be enabled or disabled on the
* disk.
+ * @member {number} [virtualMachineProfile.storageProfile.osDisk.diskSizeGB]
+ * Specifies the size of the operating system disk in gigabytes. This element
+ * can be used to overwrite the size of the disk in a virtual machine image.
+ *
This value cannot be larger than 1023 GB
* @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
@@ -4061,8 +4266,8 @@ export interface VirtualMachineScaleSet extends Resource {
* @member {string}
* [virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [virtualMachineProfile.storageProfile.dataDisks] The data
* disks.
* @member {object} [virtualMachineProfile.networkProfile] The virtual machine
@@ -4108,10 +4313,10 @@ export interface VirtualMachineScaleSet extends Resource {
* 'None' will remove any identities from the virtual machine scale set.
* Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned,
* UserAssigned', 'None'
- * @member {array} [identity.identityIds] The list of user identities
- * associated with the virtual machine scale set. The user identity references
- * will be ARM resource ids in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
+ * @member {object} [identity.userAssignedIdentities] The list of user
+ * identities associated with the virtual machine scale set. The user identity
+ * dictionary key references will be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
*/
export interface VirtualMachineScaleSetUpdate extends UpdateResource {
sku?: Sku;
@@ -4260,47 +4465,412 @@ export interface VirtualMachineScaleSetSku {
/**
* @class
- * Initializes a new instance of the VirtualMachineScaleSetVM class.
+ * Initializes a new instance of the ApiErrorBase class.
* @constructor
- * Describes a virtual machine scale set virtual machine.
+ * Api error base.
*
- * @member {string} [instanceId] The virtual machine instance ID.
- * @member {object} [sku] The virtual machine SKU.
- * @member {string} [sku.name] The sku name.
- * @member {string} [sku.tier] Specifies the tier of virtual machines in a
- * scale set.
Possible Values:
**Standard**
- * **Basic**
- * @member {number} [sku.capacity] Specifies the number of virtual machines in
- * the scale set.
- * @member {boolean} [latestModelApplied] Specifies whether the latest model
- * has been applied to the virtual machine.
- * @member {string} [vmId] Azure VM unique ID.
- * @member {object} [instanceView] The virtual machine instance view.
- * @member {number} [instanceView.platformUpdateDomain] Specifies the update
- * domain of the virtual machine.
- * @member {number} [instanceView.platformFaultDomain] Specifies the fault
- * domain of the virtual machine.
- * @member {string} [instanceView.computerName] The computer name assigned to
- * the virtual machine.
- * @member {string} [instanceView.osName] The Operating System running on the
- * virtual machine.
- * @member {string} [instanceView.osVersion] The version of Operating System
- * running on the virtual machine.
- * @member {string} [instanceView.rdpThumbPrint] The Remote desktop certificate
- * thumbprint.
- * @member {object} [instanceView.vmAgent] The VM Agent running on the virtual
+ * @member {string} [code] The error code.
+ * @member {string} [target] The target of the particular error.
+ * @member {string} [message] The error message.
+ */
+export interface ApiErrorBase {
+ code?: string;
+ target?: string;
+ message?: string;
+}
+
+/**
+ * @class
+ * Initializes a new instance of the InnerError class.
+ * @constructor
+ * Inner error details.
+ *
+ * @member {string} [exceptiontype] The exception type.
+ * @member {string} [errordetail] The internal error message or exception dump.
+ */
+export interface InnerError {
+ exceptiontype?: string;
+ errordetail?: string;
+}
+
+/**
+ * @class
+ * Initializes a new instance of the ApiError class.
+ * @constructor
+ * Api error.
+ *
+ * @member {array} [details] The Api error details
+ * @member {object} [innererror] The Api inner error
+ * @member {string} [innererror.exceptiontype] The exception type.
+ * @member {string} [innererror.errordetail] The internal error message or
+ * exception dump.
+ * @member {string} [code] The error code.
+ * @member {string} [target] The target of the particular error.
+ * @member {string} [message] The error message.
+ */
+export interface ApiError {
+ details?: ApiErrorBase[];
+ innererror?: InnerError;
+ code?: string;
+ target?: string;
+ message?: string;
+}
+
+/**
+ * @class
+ * Initializes a new instance of the RollbackStatusInfo class.
+ * @constructor
+ * Information about rollback on failed VM instances after a OS Upgrade
+ * operation.
+ *
+ * @member {number} [successfullyRolledbackInstanceCount] The number of
+ * instances which have been successfully rolled back.
+ * @member {number} [failedRolledbackInstanceCount] The number of instances
+ * which failed to rollback.
+ * @member {object} [rollbackError] Error details if OS rollback failed.
+ * @member {array} [rollbackError.details] The Api error details
+ * @member {object} [rollbackError.innererror] The Api inner error
+ * @member {string} [rollbackError.innererror.exceptiontype] The exception
+ * type.
+ * @member {string} [rollbackError.innererror.errordetail] The internal error
+ * message or exception dump.
+ * @member {string} [rollbackError.code] The error code.
+ * @member {string} [rollbackError.target] The target of the particular error.
+ * @member {string} [rollbackError.message] The error message.
+ */
+export interface RollbackStatusInfo {
+ readonly successfullyRolledbackInstanceCount?: number;
+ readonly failedRolledbackInstanceCount?: number;
+ readonly rollbackError?: ApiError;
+}
+
+/**
+ * @class
+ * Initializes a new instance of the UpgradeOperationHistoryStatus class.
+ * @constructor
+ * Information about the current running state of the overall upgrade.
+ *
+ * @member {string} [code] Code indicating the current status of the upgrade.
+ * Possible values include: 'RollingForward', 'Cancelled', 'Completed',
+ * 'Faulted'
+ * @member {date} [startTime] Start time of the upgrade.
+ * @member {date} [endTime] End time of the upgrade.
+ */
+export interface UpgradeOperationHistoryStatus {
+ readonly code?: string;
+ readonly startTime?: Date;
+ readonly endTime?: Date;
+}
+
+/**
+ * @class
+ * Initializes a new instance of the RollingUpgradeProgressInfo class.
+ * @constructor
+ * Information about the number of virtual machine instances in each upgrade
+ * state.
+ *
+ * @member {number} [successfulInstanceCount] The number of instances that have
+ * been successfully upgraded.
+ * @member {number} [failedInstanceCount] The number of instances that have
+ * failed to be upgraded successfully.
+ * @member {number} [inProgressInstanceCount] The number of instances that are
+ * currently being upgraded.
+ * @member {number} [pendingInstanceCount] The number of instances that have
+ * not yet begun to be upgraded.
+ */
+export interface RollingUpgradeProgressInfo {
+ readonly successfulInstanceCount?: number;
+ readonly failedInstanceCount?: number;
+ readonly inProgressInstanceCount?: number;
+ readonly pendingInstanceCount?: number;
+}
+
+/**
+ * @class
+ * Initializes a new instance of the UpgradeOperationHistoricalStatusInfoProperties class.
+ * @constructor
+ * Describes each OS upgrade on the Virtual Machine Scale Set.
+ *
+ * @member {object} [runningStatus] Information about the overall status of the
+ * upgrade operation.
+ * @member {string} [runningStatus.code] Code indicating the current status of
+ * the upgrade. Possible values include: 'RollingForward', 'Cancelled',
+ * 'Completed', 'Faulted'
+ * @member {date} [runningStatus.startTime] Start time of the upgrade.
+ * @member {date} [runningStatus.endTime] End time of the upgrade.
+ * @member {object} [progress] Counts of the VM's in each state.
+ * @member {number} [progress.successfulInstanceCount] The number of instances
+ * that have been successfully upgraded.
+ * @member {number} [progress.failedInstanceCount] The number of instances that
+ * have failed to be upgraded successfully.
+ * @member {number} [progress.inProgressInstanceCount] The number of instances
+ * that are currently being upgraded.
+ * @member {number} [progress.pendingInstanceCount] The number of instances
+ * that have not yet begun to be upgraded.
+ * @member {object} [error] Error Details for this upgrade if there are any.
+ * @member {array} [error.details] The Api error details
+ * @member {object} [error.innererror] The Api inner error
+ * @member {string} [error.innererror.exceptiontype] The exception type.
+ * @member {string} [error.innererror.errordetail] The internal error message
+ * or exception dump.
+ * @member {string} [error.code] The error code.
+ * @member {string} [error.target] The target of the particular error.
+ * @member {string} [error.message] The error message.
+ * @member {string} [startedBy] Invoker of the Upgrade Operation. Possible
+ * values include: 'Unknown', 'User', 'Platform'
+ * @member {object} [targetImageReference] Image Reference details
+ * @member {string} [targetImageReference.publisher] The image publisher.
+ * @member {string} [targetImageReference.offer] Specifies the offer of the
+ * platform image or marketplace image used to create the virtual machine.
+ * @member {string} [targetImageReference.sku] The image SKU.
+ * @member {string} [targetImageReference.version] Specifies the version of the
+ * platform image or marketplace image used to create the virtual machine. The
+ * allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build
+ * are decimal numbers. Specify 'latest' to use the latest version of an image
+ * available at deploy time. Even if you use 'latest', the VM image will not
+ * automatically update after deploy time even if a new version becomes
+ * available.
+ * @member {object} [rollbackInfo] Information about OS rollback if performed
+ * @member {number} [rollbackInfo.successfullyRolledbackInstanceCount] The
+ * number of instances which have been successfully rolled back.
+ * @member {number} [rollbackInfo.failedRolledbackInstanceCount] The number of
+ * instances which failed to rollback.
+ * @member {object} [rollbackInfo.rollbackError] Error details if OS rollback
+ * failed.
+ * @member {array} [rollbackInfo.rollbackError.details] The Api error details
+ * @member {object} [rollbackInfo.rollbackError.innererror] The Api inner error
+ * @member {string} [rollbackInfo.rollbackError.innererror.exceptiontype] The
+ * exception type.
+ * @member {string} [rollbackInfo.rollbackError.innererror.errordetail] The
+ * internal error message or exception dump.
+ * @member {string} [rollbackInfo.rollbackError.code] The error code.
+ * @member {string} [rollbackInfo.rollbackError.target] The target of the
+ * particular error.
+ * @member {string} [rollbackInfo.rollbackError.message] The error message.
+ */
+export interface UpgradeOperationHistoricalStatusInfoProperties {
+ readonly runningStatus?: UpgradeOperationHistoryStatus;
+ readonly progress?: RollingUpgradeProgressInfo;
+ readonly error?: ApiError;
+ readonly startedBy?: string;
+ readonly targetImageReference?: ImageReference;
+ readonly rollbackInfo?: RollbackStatusInfo;
+}
+
+/**
+ * @class
+ * Initializes a new instance of the UpgradeOperationHistoricalStatusInfo class.
+ * @constructor
+ * Virtual Machine Scale Set OS Upgrade History operation response.
+ *
+ * @member {object} [properties] Information about the properties of the
+ * upgrade operation.
+ * @member {object} [properties.runningStatus] Information about the overall
+ * status of the upgrade operation.
+ * @member {string} [properties.runningStatus.code] Code indicating the current
+ * status of the upgrade. Possible values include: 'RollingForward',
+ * 'Cancelled', 'Completed', 'Faulted'
+ * @member {date} [properties.runningStatus.startTime] Start time of the
+ * upgrade.
+ * @member {date} [properties.runningStatus.endTime] End time of the upgrade.
+ * @member {object} [properties.progress] Counts of the VM's in each state.
+ * @member {number} [properties.progress.successfulInstanceCount] The number of
+ * instances that have been successfully upgraded.
+ * @member {number} [properties.progress.failedInstanceCount] The number of
+ * instances that have failed to be upgraded successfully.
+ * @member {number} [properties.progress.inProgressInstanceCount] The number of
+ * instances that are currently being upgraded.
+ * @member {number} [properties.progress.pendingInstanceCount] The number of
+ * instances that have not yet begun to be upgraded.
+ * @member {object} [properties.error] Error Details for this upgrade if there
+ * are any.
+ * @member {array} [properties.error.details] The Api error details
+ * @member {object} [properties.error.innererror] The Api inner error
+ * @member {string} [properties.error.innererror.exceptiontype] The exception
+ * type.
+ * @member {string} [properties.error.innererror.errordetail] The internal
+ * error message or exception dump.
+ * @member {string} [properties.error.code] The error code.
+ * @member {string} [properties.error.target] The target of the particular
+ * error.
+ * @member {string} [properties.error.message] The error message.
+ * @member {string} [properties.startedBy] Invoker of the Upgrade Operation.
+ * Possible values include: 'Unknown', 'User', 'Platform'
+ * @member {object} [properties.targetImageReference] Image Reference details
+ * @member {string} [properties.targetImageReference.publisher] The image
+ * publisher.
+ * @member {string} [properties.targetImageReference.offer] Specifies the offer
+ * of the platform image or marketplace image used to create the virtual
* machine.
- * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full
- * version.
- * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual machine
- * extension handler instance view.
- * @member {array} [instanceView.vmAgent.statuses] The resource status
- * information.
- * @member {object} [instanceView.maintenanceRedeployStatus] The Maintenance
- * Operation status on the virtual machine.
- * @member {boolean}
- * [instanceView.maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed]
- * True, if customer is allowed to perform Maintenance.
+ * @member {string} [properties.targetImageReference.sku] The image SKU.
+ * @member {string} [properties.targetImageReference.version] Specifies the
+ * version of the platform image or marketplace image used to create the
+ * virtual machine. The allowed formats are Major.Minor.Build or 'latest'.
+ * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the
+ * latest version of an image available at deploy time. Even if you use
+ * 'latest', the VM image will not automatically update after deploy time even
+ * if a new version becomes available.
+ * @member {object} [properties.rollbackInfo] Information about OS rollback if
+ * performed
+ * @member {number}
+ * [properties.rollbackInfo.successfullyRolledbackInstanceCount] The number of
+ * instances which have been successfully rolled back.
+ * @member {number} [properties.rollbackInfo.failedRolledbackInstanceCount] The
+ * number of instances which failed to rollback.
+ * @member {object} [properties.rollbackInfo.rollbackError] Error details if OS
+ * rollback failed.
+ * @member {array} [properties.rollbackInfo.rollbackError.details] The Api
+ * error details
+ * @member {object} [properties.rollbackInfo.rollbackError.innererror] The Api
+ * inner error
+ * @member {string}
+ * [properties.rollbackInfo.rollbackError.innererror.exceptiontype] The
+ * exception type.
+ * @member {string}
+ * [properties.rollbackInfo.rollbackError.innererror.errordetail] The internal
+ * error message or exception dump.
+ * @member {string} [properties.rollbackInfo.rollbackError.code] The error
+ * code.
+ * @member {string} [properties.rollbackInfo.rollbackError.target] The target
+ * of the particular error.
+ * @member {string} [properties.rollbackInfo.rollbackError.message] The error
+ * message.
+ * @member {string} [type] Resource type
+ * @member {string} [location] Resource location
+ */
+export interface UpgradeOperationHistoricalStatusInfo {
+ readonly properties?: UpgradeOperationHistoricalStatusInfoProperties;
+ readonly type?: string;
+ readonly location?: string;
+}
+
+/**
+ * @class
+ * Initializes a new instance of the VirtualMachineHealthStatus class.
+ * @constructor
+ * The health status of the VM.
+ *
+ * @member {object} [status] The health status information for the VM.
+ * @member {string} [status.code] The status code.
+ * @member {string} [status.level] The level code. Possible values include:
+ * 'Info', 'Warning', 'Error'
+ * @member {string} [status.displayStatus] The short localizable label for the
+ * status.
+ * @member {string} [status.message] The detailed status message, including for
+ * alerts and error messages.
+ * @member {date} [status.time] The time of the status.
+ */
+export interface VirtualMachineHealthStatus {
+ readonly status?: InstanceViewStatus;
+}
+
+/**
+ * @class
+ * Initializes a new instance of the VirtualMachineScaleSetVMInstanceView class.
+ * @constructor
+ * The instance view of a virtual machine scale set VM.
+ *
+ * @member {number} [platformUpdateDomain] The Update Domain count.
+ * @member {number} [platformFaultDomain] The Fault Domain count.
+ * @member {string} [rdpThumbPrint] The Remote desktop certificate thumbprint.
+ * @member {object} [vmAgent] The VM Agent running on the virtual machine.
+ * @member {string} [vmAgent.vmAgentVersion] The VM Agent full version.
+ * @member {array} [vmAgent.extensionHandlers] The virtual machine extension
+ * handler instance view.
+ * @member {array} [vmAgent.statuses] The resource status information.
+ * @member {object} [maintenanceRedeployStatus] The Maintenance Operation
+ * status on the virtual machine.
+ * @member {boolean}
+ * [maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] True, if
+ * customer is allowed to perform Maintenance.
+ * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowStartTime]
+ * Start Time for the Pre Maintenance Window.
+ * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowEndTime] End
+ * Time for the Pre Maintenance Window.
+ * @member {date} [maintenanceRedeployStatus.maintenanceWindowStartTime] Start
+ * Time for the Maintenance Window.
+ * @member {date} [maintenanceRedeployStatus.maintenanceWindowEndTime] End Time
+ * for the Maintenance Window.
+ * @member {string} [maintenanceRedeployStatus.lastOperationResultCode] The
+ * Last Maintenance Operation Result Code. Possible values include: 'None',
+ * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted'
+ * @member {string} [maintenanceRedeployStatus.lastOperationMessage] Message
+ * returned for the last Maintenance Operation.
+ * @member {array} [disks] The disks information.
+ * @member {array} [extensions] The extensions information.
+ * @member {object} [vmHealth] The health status for the VM.
+ * @member {object} [vmHealth.status] The health status information for the VM.
+ * @member {string} [vmHealth.status.code] The status code.
+ * @member {string} [vmHealth.status.level] The level code. Possible values
+ * include: 'Info', 'Warning', 'Error'
+ * @member {string} [vmHealth.status.displayStatus] The short localizable label
+ * for the status.
+ * @member {string} [vmHealth.status.message] The detailed status message,
+ * including for alerts and error messages.
+ * @member {date} [vmHealth.status.time] The time of the status.
+ * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature
+ * which allows you to view Console Output and Screenshot to diagnose VM
+ * status.
For Linux Virtual Machines, you can easily view the output
+ * of your console log.
For both Windows and Linux virtual machines,
+ * Azure also enables you to see a screenshot of the VM from the hypervisor.
+ * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console
+ * screenshot blob URI.
+ * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] The Linux serial
+ * console log blob Uri.
+ * @member {array} [statuses] The resource status information.
+ * @member {string} [placementGroupId] The placement group in which the VM is
+ * running. If the VM is deallocated it will not have a placementGroupId.
+ */
+export interface VirtualMachineScaleSetVMInstanceView {
+ platformUpdateDomain?: number;
+ platformFaultDomain?: number;
+ rdpThumbPrint?: string;
+ vmAgent?: VirtualMachineAgentInstanceView;
+ maintenanceRedeployStatus?: MaintenanceRedeployStatus;
+ disks?: DiskInstanceView[];
+ extensions?: VirtualMachineExtensionInstanceView[];
+ readonly vmHealth?: VirtualMachineHealthStatus;
+ bootDiagnostics?: BootDiagnosticsInstanceView;
+ statuses?: InstanceViewStatus[];
+ placementGroupId?: string;
+}
+
+/**
+ * @class
+ * Initializes a new instance of the VirtualMachineScaleSetVM class.
+ * @constructor
+ * Describes a virtual machine scale set virtual machine.
+ *
+ * @member {string} [instanceId] The virtual machine instance ID.
+ * @member {object} [sku] The virtual machine SKU.
+ * @member {string} [sku.name] The sku name.
+ * @member {string} [sku.tier] Specifies the tier of virtual machines in a
+ * scale set.
Possible Values:
**Standard**
+ * **Basic**
+ * @member {number} [sku.capacity] Specifies the number of virtual machines in
+ * the scale set.
+ * @member {boolean} [latestModelApplied] Specifies whether the latest model
+ * has been applied to the virtual machine.
+ * @member {string} [vmId] Azure VM unique ID.
+ * @member {object} [instanceView] The virtual machine instance view.
+ * @member {number} [instanceView.platformUpdateDomain] The Update Domain
+ * count.
+ * @member {number} [instanceView.platformFaultDomain] The Fault Domain count.
+ * @member {string} [instanceView.rdpThumbPrint] The Remote desktop certificate
+ * thumbprint.
+ * @member {object} [instanceView.vmAgent] The VM Agent running on the virtual
+ * machine.
+ * @member {string} [instanceView.vmAgent.vmAgentVersion] The VM Agent full
+ * version.
+ * @member {array} [instanceView.vmAgent.extensionHandlers] The virtual machine
+ * extension handler instance view.
+ * @member {array} [instanceView.vmAgent.statuses] The resource status
+ * information.
+ * @member {object} [instanceView.maintenanceRedeployStatus] The Maintenance
+ * Operation status on the virtual machine.
+ * @member {boolean}
+ * [instanceView.maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed]
+ * True, if customer is allowed to perform Maintenance.
* @member {date}
* [instanceView.maintenanceRedeployStatus.preMaintenanceWindowStartTime] Start
* Time for the Pre Maintenance Window.
@@ -4320,8 +4890,19 @@ export interface VirtualMachineScaleSetSku {
* @member {string}
* [instanceView.maintenanceRedeployStatus.lastOperationMessage] Message
* returned for the last Maintenance Operation.
- * @member {array} [instanceView.disks] The virtual machine disk information.
+ * @member {array} [instanceView.disks] The disks information.
* @member {array} [instanceView.extensions] The extensions information.
+ * @member {object} [instanceView.vmHealth] The health status for the VM.
+ * @member {object} [instanceView.vmHealth.status] The health status
+ * information for the VM.
+ * @member {string} [instanceView.vmHealth.status.code] The status code.
+ * @member {string} [instanceView.vmHealth.status.level] The level code.
+ * Possible values include: 'Info', 'Warning', 'Error'
+ * @member {string} [instanceView.vmHealth.status.displayStatus] The short
+ * localizable label for the status.
+ * @member {string} [instanceView.vmHealth.status.message] The detailed status
+ * message, including for alerts and error messages.
+ * @member {date} [instanceView.vmHealth.status.time] The time of the status.
* @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a
* debugging feature which allows you to view Console Output and Screenshot to
* diagnose VM status.
For Linux Virtual Machines, you can easily view
@@ -4333,6 +4914,9 @@ export interface VirtualMachineScaleSetSku {
* @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri] The
* Linux serial console log blob Uri.
* @member {array} [instanceView.statuses] The resource status information.
+ * @member {string} [instanceView.placementGroupId] The placement group in
+ * which the VM is running. If the VM is deallocated it will not have a
+ * placementGroupId.
* @member {object} [hardwareProfile] Specifies the hardware settings for the
* virtual machine.
* @member {string} [hardwareProfile.vmSize] Specifies the size of the virtual
@@ -4481,8 +5065,8 @@ export interface VirtualMachineScaleSetSku {
* parameters.
* @member {string} [storageProfile.osDisk.managedDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [storageProfile.dataDisks] Specifies the parameters that are
* used to add a data disk to a virtual machine.
For more information
* about disks, see [About disks and VHDs for Azure virtual
@@ -4562,8 +5146,17 @@ export interface VirtualMachineScaleSetSku {
* configuration for a Linux OS.
* @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of
* SSH public keys used to authenticate with linux based VMs.
+ * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent] Indicates
+ * whether virtual machine agent should be provisioned on the virtual machine.
+ *
When this property is not specified in the request body, default
+ * behavior is to set it to true. This will ensure that VM Agent is installed
+ * on the VM so that extensions can be added to the VM later.
* @member {array} [osProfile.secrets] Specifies set of certificates that
* should be installed onto the virtual machine.
+ * @member {boolean} [osProfile.allowExtensionOperations] Specifies whether
+ * extension operations should be allowed on the virtual machine.
This
+ * may only be set to False when no extensions are present on the virtual
+ * machine.
* @member {object} [networkProfile] Specifies the network interfaces of the
* virtual machine.
* @member {array} [networkProfile.networkInterfaces] Specifies the list of
@@ -4617,13 +5210,14 @@ export interface VirtualMachineScaleSetSku {
* element.
* @member {string} [plan.promotionCode] The promotion code.
* @member {array} [resources] The virtual machine child extension resources.
+ * @member {array} [zones] The virtual machine zones.
*/
export interface VirtualMachineScaleSetVM extends Resource {
readonly instanceId?: string;
readonly sku?: Sku;
readonly latestModelApplied?: boolean;
readonly vmId?: string;
- readonly instanceView?: VirtualMachineInstanceView;
+ readonly instanceView?: VirtualMachineScaleSetVMInstanceView;
hardwareProfile?: HardwareProfile;
storageProfile?: StorageProfile;
osProfile?: OSProfile;
@@ -4634,97 +5228,7 @@ export interface VirtualMachineScaleSetVM extends Resource {
licenseType?: string;
plan?: Plan;
readonly resources?: VirtualMachineExtension[];
-}
-
-/**
- * @class
- * Initializes a new instance of the VirtualMachineHealthStatus class.
- * @constructor
- * The health status of the VM.
- *
- * @member {object} [status] The health status information for the VM.
- * @member {string} [status.code] The status code.
- * @member {string} [status.level] The level code. Possible values include:
- * 'Info', 'Warning', 'Error'
- * @member {string} [status.displayStatus] The short localizable label for the
- * status.
- * @member {string} [status.message] The detailed status message, including for
- * alerts and error messages.
- * @member {date} [status.time] The time of the status.
- */
-export interface VirtualMachineHealthStatus {
- readonly status?: InstanceViewStatus;
-}
-
-/**
- * @class
- * Initializes a new instance of the VirtualMachineScaleSetVMInstanceView class.
- * @constructor
- * The instance view of a virtual machine scale set VM.
- *
- * @member {number} [platformUpdateDomain] The Update Domain count.
- * @member {number} [platformFaultDomain] The Fault Domain count.
- * @member {string} [rdpThumbPrint] The Remote desktop certificate thumbprint.
- * @member {object} [vmAgent] The VM Agent running on the virtual machine.
- * @member {string} [vmAgent.vmAgentVersion] The VM Agent full version.
- * @member {array} [vmAgent.extensionHandlers] The virtual machine extension
- * handler instance view.
- * @member {array} [vmAgent.statuses] The resource status information.
- * @member {object} [maintenanceRedeployStatus] The Maintenance Operation
- * status on the virtual machine.
- * @member {boolean}
- * [maintenanceRedeployStatus.isCustomerInitiatedMaintenanceAllowed] True, if
- * customer is allowed to perform Maintenance.
- * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowStartTime]
- * Start Time for the Pre Maintenance Window.
- * @member {date} [maintenanceRedeployStatus.preMaintenanceWindowEndTime] End
- * Time for the Pre Maintenance Window.
- * @member {date} [maintenanceRedeployStatus.maintenanceWindowStartTime] Start
- * Time for the Maintenance Window.
- * @member {date} [maintenanceRedeployStatus.maintenanceWindowEndTime] End Time
- * for the Maintenance Window.
- * @member {string} [maintenanceRedeployStatus.lastOperationResultCode] The
- * Last Maintenance Operation Result Code. Possible values include: 'None',
- * 'RetryLater', 'MaintenanceAborted', 'MaintenanceCompleted'
- * @member {string} [maintenanceRedeployStatus.lastOperationMessage] Message
- * returned for the last Maintenance Operation.
- * @member {array} [disks] The disks information.
- * @member {array} [extensions] The extensions information.
- * @member {object} [vmHealth] The health status for the VM.
- * @member {object} [vmHealth.status] The health status information for the VM.
- * @member {string} [vmHealth.status.code] The status code.
- * @member {string} [vmHealth.status.level] The level code. Possible values
- * include: 'Info', 'Warning', 'Error'
- * @member {string} [vmHealth.status.displayStatus] The short localizable label
- * for the status.
- * @member {string} [vmHealth.status.message] The detailed status message,
- * including for alerts and error messages.
- * @member {date} [vmHealth.status.time] The time of the status.
- * @member {object} [bootDiagnostics] Boot Diagnostics is a debugging feature
- * which allows you to view Console Output and Screenshot to diagnose VM
- * status.
For Linux Virtual Machines, you can easily view the output
- * of your console log.
For both Windows and Linux virtual machines,
- * Azure also enables you to see a screenshot of the VM from the hypervisor.
- * @member {string} [bootDiagnostics.consoleScreenshotBlobUri] The console
- * screenshot blob URI.
- * @member {string} [bootDiagnostics.serialConsoleLogBlobUri] The Linux serial
- * console log blob Uri.
- * @member {array} [statuses] The resource status information.
- * @member {string} [placementGroupId] The placement group in which the VM is
- * running. If the VM is deallocated it will not have a placementGroupId.
- */
-export interface VirtualMachineScaleSetVMInstanceView {
- platformUpdateDomain?: number;
- platformFaultDomain?: number;
- rdpThumbPrint?: string;
- vmAgent?: VirtualMachineAgentInstanceView;
- maintenanceRedeployStatus?: MaintenanceRedeployStatus;
- disks?: DiskInstanceView[];
- extensions?: VirtualMachineExtensionInstanceView[];
- readonly vmHealth?: VirtualMachineHealthStatus;
- bootDiagnostics?: BootDiagnosticsInstanceView;
- statuses?: InstanceViewStatus[];
- placementGroupId?: string;
+ readonly zones?: string[];
}
/**
@@ -4748,82 +5252,6 @@ export interface RollingUpgradeRunningStatus {
readonly lastActionTime?: Date;
}
-/**
- * @class
- * Initializes a new instance of the RollingUpgradeProgressInfo class.
- * @constructor
- * Information about the number of virtual machine instances in each upgrade
- * state.
- *
- * @member {number} [successfulInstanceCount] The number of instances that have
- * been successfully upgraded.
- * @member {number} [failedInstanceCount] The number of instances that have
- * failed to be upgraded successfully.
- * @member {number} [inProgressInstanceCount] The number of instances that are
- * currently being upgraded.
- * @member {number} [pendingInstanceCount] The number of instances that have
- * not yet begun to be upgraded.
- */
-export interface RollingUpgradeProgressInfo {
- readonly successfulInstanceCount?: number;
- readonly failedInstanceCount?: number;
- readonly inProgressInstanceCount?: number;
- readonly pendingInstanceCount?: number;
-}
-
-/**
- * @class
- * Initializes a new instance of the ApiErrorBase class.
- * @constructor
- * Api error base.
- *
- * @member {string} [code] The error code.
- * @member {string} [target] The target of the particular error.
- * @member {string} [message] The error message.
- */
-export interface ApiErrorBase {
- code?: string;
- target?: string;
- message?: string;
-}
-
-/**
- * @class
- * Initializes a new instance of the InnerError class.
- * @constructor
- * Inner error details.
- *
- * @member {string} [exceptiontype] The exception type.
- * @member {string} [errordetail] The internal error message or exception dump.
- */
-export interface InnerError {
- exceptiontype?: string;
- errordetail?: string;
-}
-
-/**
- * @class
- * Initializes a new instance of the ApiError class.
- * @constructor
- * Api error.
- *
- * @member {array} [details] The Api error details
- * @member {object} [innererror] The Api inner error
- * @member {string} [innererror.exceptiontype] The exception type.
- * @member {string} [innererror.errordetail] The internal error message or
- * exception dump.
- * @member {string} [code] The error code.
- * @member {string} [target] The target of the particular error.
- * @member {string} [message] The error message.
- */
-export interface ApiError {
- details?: ApiErrorBase[];
- innererror?: InnerError;
- code?: string;
- target?: string;
- message?: string;
-}
-
/**
* @class
* Initializes a new instance of the RollingUpgradeStatusInfo class.
@@ -4890,18 +5318,6 @@ export interface RollingUpgradeStatusInfo extends Resource {
readonly error?: ApiError;
}
-/**
- * @class
- * Initializes a new instance of the ComputeLongRunningOperationProperties class.
- * @constructor
- * Compute-specific operation properties, including output
- *
- * @member {object} [output] Operation output data (raw JSON)
- */
-export interface ComputeLongRunningOperationProperties {
- output?: any;
-}
-
/**
* @class
* Initializes a new instance of the RecoveryWalkResponse class.
@@ -4918,34 +5334,6 @@ export interface RecoveryWalkResponse {
readonly nextPlatformUpdateDomain?: number;
}
-/**
- * @class
- * Initializes a new instance of the OperationStatusResponse class.
- * @constructor
- * Operation status response
- *
- * @member {string} [name] Operation ID
- * @member {string} [status] Operation status
- * @member {date} [startTime] Start time of the operation
- * @member {date} [endTime] End time of the operation
- * @member {object} [error] Api error
- * @member {array} [error.details] The Api error details
- * @member {object} [error.innererror] The Api inner error
- * @member {string} [error.innererror.exceptiontype] The exception type.
- * @member {string} [error.innererror.errordetail] The internal error message
- * or exception dump.
- * @member {string} [error.code] The error code.
- * @member {string} [error.target] The target of the particular error.
- * @member {string} [error.message] The error message.
- */
-export interface OperationStatusResponse {
- readonly name?: string;
- readonly status?: string;
- readonly startTime?: Date;
- readonly endTime?: Date;
- readonly error?: ApiError;
-}
-
/**
* @class
* Initializes a new instance of the LogAnalyticsInputBase class.
@@ -5016,7 +5404,7 @@ export interface LogAnalyticsOutput {
* @member {object} [properties] LogAnalyticsOutput
* @member {string} [properties.output] Output file Uri path to blob container.
*/
-export interface LogAnalyticsOperationResult extends OperationStatusResponse {
+export interface LogAnalyticsOperationResult {
readonly properties?: LogAnalyticsOutput;
}
@@ -5110,12 +5498,10 @@ export interface RunCommandDocument extends RunCommandDocumentBase {
* @class
* Initializes a new instance of the RunCommandResult class.
* @constructor
- * Run command operation response.
- *
- * @member {object} [output] Operation output data (raw JSON)
+ * @member {array} [value] Run command operation response.
*/
-export interface RunCommandResult extends OperationStatusResponse {
- output?: any;
+export interface RunCommandResult {
+ value?: InstanceViewStatus[];
}
/**
@@ -5273,10 +5659,10 @@ export interface ResourceSku {
* @class
* Initializes a new instance of the DiskSku class.
* @constructor
- * The disks sku name. Can be Standard_LRS or Premium_LRS.
+ * The disks sku name. Can be Standard_LRS, Premium_LRS, or StandardSSD_LRS.
*
* @member {string} [name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {string} [tier] The sku tier. Default value: 'Standard' .
*/
export interface DiskSku {
@@ -5284,23 +5670,6 @@ export interface DiskSku {
readonly tier?: string;
}
-/**
- * @class
- * Initializes a new instance of the ResourceUpdate class.
- * @constructor
- * The Resource model definition.
- *
- * @member {object} [tags] Resource tags
- * @member {object} [sku]
- * @member {string} [sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
- * @member {string} [sku.tier] The sku tier.
- */
-export interface ResourceUpdate {
- tags?: { [propertyName: string]: string };
- sku?: DiskSku;
-}
-
/**
* @class
* Initializes a new instance of the ImageDiskReference class.
@@ -5437,7 +5806,7 @@ export interface EncryptionSettings {
* has the disk attached.
* @member {object} [sku]
* @member {string} [sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {string} [sku.tier] The sku tier.
* @member {array} [zones] The Logical zone list for Disk.
* @member {date} [timeCreated] The time when the disk was created.
@@ -5540,11 +5909,18 @@ export interface Disk extends Resource {
* Resource Id
* @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing
* to a key or secret in KeyVault
+ * @member {object} [tags] Resource tags
+ * @member {object} [sku]
+ * @member {string} [sku.name] The sku name. Possible values include:
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
+ * @member {string} [sku.tier] The sku tier.
*/
-export interface DiskUpdate extends ResourceUpdate {
+export interface DiskUpdate {
osType?: string;
diskSizeGB?: number;
encryptionSettings?: EncryptionSettings;
+ tags?: { [propertyName: string]: string };
+ sku?: DiskSku;
}
/**
@@ -5699,11 +6075,18 @@ export interface Snapshot extends Resource {
* Resource Id
* @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing
* to a key or secret in KeyVault
+ * @member {object} [tags] Resource tags
+ * @member {object} [sku]
+ * @member {string} [sku.name] The sku name. Possible values include:
+ * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS'
+ * @member {string} [sku.tier] The sku tier.
*/
-export interface SnapshotUpdate extends ResourceUpdate {
+export interface SnapshotUpdate {
osType?: string;
diskSizeGB?: number;
encryptionSettings?: EncryptionSettings;
+ tags?: { [propertyName: string]: string };
+ sku?: SnapshotSku;
}
/**
@@ -5971,8 +6354,12 @@ export interface ComputeOperationListResult extends Array
* @constructor
* The List Availability Set operation response.
*
+ * @member {string} [nextLink] The URI to fetch the next page of
+ * AvailabilitySets. Call ListNext() with this URI to fetch the next page of
+ * AvailabilitySets.
*/
export interface AvailabilitySetListResult extends Array {
+ nextLink?: string;
}
/**
@@ -5985,19 +6372,6 @@ export interface AvailabilitySetListResult extends Array {
export interface VirtualMachineSizeListResult extends Array {
}
-/**
- * @class
- * Initializes a new instance of the VirtualMachineListResult class.
- * @constructor
- * The List Virtual Machine operation response.
- *
- * @member {string} [nextLink] The URI to fetch the next page of VMs. Call
- * ListNext() with this URI to fetch the next page of Virtual Machines.
- */
-export interface VirtualMachineListResult extends Array {
- nextLink?: string;
-}
-
/**
* @class
* Initializes a new instance of the ListUsagesResult class.
@@ -6025,6 +6399,19 @@ export interface ImageListResult extends Array {
nextLink?: string;
}
+/**
+ * @class
+ * Initializes a new instance of the VirtualMachineListResult class.
+ * @constructor
+ * The List Virtual Machine operation response.
+ *
+ * @member {string} [nextLink] The URI to fetch the next page of VMs. Call
+ * ListNext() with this URI to fetch the next page of Virtual Machines.
+ */
+export interface VirtualMachineListResult extends Array {
+ nextLink?: string;
+}
+
/**
* @class
* Initializes a new instance of the VirtualMachineScaleSetListResult class.
@@ -6067,6 +6454,20 @@ export interface VirtualMachineScaleSetListSkusResult extends Array {
+ nextLink?: string;
+}
+
/**
* @class
* Initializes a new instance of the VirtualMachineScaleSetExtensionListResult class.
diff --git a/lib/services/computeManagement2/lib/models/index.js b/lib/services/computeManagement2/lib/models/index.js
index f396363aaa..792d56d379 100644
--- a/lib/services/computeManagement2/lib/models/index.js
+++ b/lib/services/computeManagement2/lib/models/index.js
@@ -70,11 +70,13 @@ exports.VirtualMachineExtensionHandlerInstanceView = require('./virtualMachineEx
exports.VirtualMachineAgentInstanceView = require('./virtualMachineAgentInstanceView');
exports.DiskInstanceView = require('./diskInstanceView');
exports.BootDiagnosticsInstanceView = require('./bootDiagnosticsInstanceView');
+exports.VirtualMachineIdentityUserAssignedIdentitiesValue = require('./virtualMachineIdentityUserAssignedIdentitiesValue');
exports.VirtualMachineIdentity = require('./virtualMachineIdentity');
exports.MaintenanceRedeployStatus = require('./maintenanceRedeployStatus');
exports.VirtualMachineInstanceView = require('./virtualMachineInstanceView');
exports.VirtualMachine = require('./virtualMachine');
exports.VirtualMachineUpdate = require('./virtualMachineUpdate');
+exports.AutoOSUpgradePolicy = require('./autoOSUpgradePolicy');
exports.RollingUpgradePolicy = require('./rollingUpgradePolicy');
exports.UpgradePolicy = require('./upgradePolicy');
exports.ImageOSDisk = require('./imageOSDisk');
@@ -82,6 +84,7 @@ exports.ImageDataDisk = require('./imageDataDisk');
exports.ImageStorageProfile = require('./imageStorageProfile');
exports.Image = require('./image');
exports.ImageUpdate = require('./imageUpdate');
+exports.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue = require('./virtualMachineScaleSetIdentityUserAssignedIdentitiesValue');
exports.VirtualMachineScaleSetIdentity = require('./virtualMachineScaleSetIdentity');
exports.VirtualMachineScaleSetOSProfile = require('./virtualMachineScaleSetOSProfile');
exports.VirtualMachineScaleSetUpdateOSProfile = require('./virtualMachineScaleSetUpdateOSProfile');
@@ -93,6 +96,7 @@ exports.VirtualMachineScaleSetStorageProfile = require('./virtualMachineScaleSet
exports.VirtualMachineScaleSetUpdateStorageProfile = require('./virtualMachineScaleSetUpdateStorageProfile');
exports.ApiEntityReference = require('./apiEntityReference');
exports.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings = require('./virtualMachineScaleSetPublicIPAddressConfigurationDnsSettings');
+exports.VirtualMachineScaleSetIpTag = require('./virtualMachineScaleSetIpTag');
exports.VirtualMachineScaleSetPublicIPAddressConfiguration = require('./virtualMachineScaleSetPublicIPAddressConfiguration');
exports.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration = require('./virtualMachineScaleSetUpdatePublicIPAddressConfiguration');
exports.VirtualMachineScaleSetIPConfiguration = require('./virtualMachineScaleSetIPConfiguration');
@@ -117,18 +121,20 @@ exports.VirtualMachineScaleSetVMExtensionsSummary = require('./virtualMachineSca
exports.VirtualMachineScaleSetInstanceView = require('./virtualMachineScaleSetInstanceView');
exports.VirtualMachineScaleSetSkuCapacity = require('./virtualMachineScaleSetSkuCapacity');
exports.VirtualMachineScaleSetSku = require('./virtualMachineScaleSetSku');
-exports.VirtualMachineScaleSetVM = require('./virtualMachineScaleSetVM');
-exports.VirtualMachineHealthStatus = require('./virtualMachineHealthStatus');
-exports.VirtualMachineScaleSetVMInstanceView = require('./virtualMachineScaleSetVMInstanceView');
-exports.RollingUpgradeRunningStatus = require('./rollingUpgradeRunningStatus');
-exports.RollingUpgradeProgressInfo = require('./rollingUpgradeProgressInfo');
exports.ApiErrorBase = require('./apiErrorBase');
exports.InnerError = require('./innerError');
exports.ApiError = require('./apiError');
+exports.RollbackStatusInfo = require('./rollbackStatusInfo');
+exports.UpgradeOperationHistoryStatus = require('./upgradeOperationHistoryStatus');
+exports.RollingUpgradeProgressInfo = require('./rollingUpgradeProgressInfo');
+exports.UpgradeOperationHistoricalStatusInfoProperties = require('./upgradeOperationHistoricalStatusInfoProperties');
+exports.UpgradeOperationHistoricalStatusInfo = require('./upgradeOperationHistoricalStatusInfo');
+exports.VirtualMachineHealthStatus = require('./virtualMachineHealthStatus');
+exports.VirtualMachineScaleSetVMInstanceView = require('./virtualMachineScaleSetVMInstanceView');
+exports.VirtualMachineScaleSetVM = require('./virtualMachineScaleSetVM');
+exports.RollingUpgradeRunningStatus = require('./rollingUpgradeRunningStatus');
exports.RollingUpgradeStatusInfo = require('./rollingUpgradeStatusInfo');
-exports.ComputeLongRunningOperationProperties = require('./computeLongRunningOperationProperties');
exports.RecoveryWalkResponse = require('./recoveryWalkResponse');
-exports.OperationStatusResponse = require('./operationStatusResponse');
exports.LogAnalyticsInputBase = require('./logAnalyticsInputBase');
exports.RequestRateByIntervalInput = require('./requestRateByIntervalInput');
exports.ThrottledRequestsInput = require('./throttledRequestsInput');
@@ -148,7 +154,6 @@ exports.ResourceSkuRestrictions = require('./resourceSkuRestrictions');
exports.ResourceSkuLocationInfo = require('./resourceSkuLocationInfo');
exports.ResourceSku = require('./resourceSku');
exports.DiskSku = require('./diskSku');
-exports.ResourceUpdate = require('./resourceUpdate');
exports.ImageDiskReference = require('./imageDiskReference');
exports.CreationData = require('./creationData');
exports.SourceVault = require('./sourceVault');
@@ -177,12 +182,13 @@ exports.ContainerService = require('./containerService');
exports.ComputeOperationListResult = require('./computeOperationListResult');
exports.AvailabilitySetListResult = require('./availabilitySetListResult');
exports.VirtualMachineSizeListResult = require('./virtualMachineSizeListResult');
-exports.VirtualMachineListResult = require('./virtualMachineListResult');
exports.ListUsagesResult = require('./listUsagesResult');
exports.ImageListResult = require('./imageListResult');
+exports.VirtualMachineListResult = require('./virtualMachineListResult');
exports.VirtualMachineScaleSetListResult = require('./virtualMachineScaleSetListResult');
exports.VirtualMachineScaleSetListWithLinkResult = require('./virtualMachineScaleSetListWithLinkResult');
exports.VirtualMachineScaleSetListSkusResult = require('./virtualMachineScaleSetListSkusResult');
+exports.VirtualMachineScaleSetListOSUpgradeHistory = require('./virtualMachineScaleSetListOSUpgradeHistory');
exports.VirtualMachineScaleSetExtensionListResult = require('./virtualMachineScaleSetExtensionListResult');
exports.VirtualMachineScaleSetVMListResult = require('./virtualMachineScaleSetVMListResult');
exports.RunCommandListResult = require('./runCommandListResult');
diff --git a/lib/services/computeManagement2/lib/models/keyVaultAndKeyReference.js b/lib/services/computeManagement2/lib/models/keyVaultAndKeyReference.js
index a20c7e9b39..6c9bf7d60b 100644
--- a/lib/services/computeManagement2/lib/models/keyVaultAndKeyReference.js
+++ b/lib/services/computeManagement2/lib/models/keyVaultAndKeyReference.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Key Vault Key Url and vault id of KeK, KeK is optional and when provided is
* used to unwrap the encryptionKey
diff --git a/lib/services/computeManagement2/lib/models/keyVaultAndSecretReference.js b/lib/services/computeManagement2/lib/models/keyVaultAndSecretReference.js
index 967bc9c38c..aa6bcbfe5a 100644
--- a/lib/services/computeManagement2/lib/models/keyVaultAndSecretReference.js
+++ b/lib/services/computeManagement2/lib/models/keyVaultAndSecretReference.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Key Vault Secret Url and vault id of the encryption key
*
diff --git a/lib/services/computeManagement2/lib/models/keyVaultKeyReference.js b/lib/services/computeManagement2/lib/models/keyVaultKeyReference.js
index d5875b2927..f66d9f0e9d 100644
--- a/lib/services/computeManagement2/lib/models/keyVaultKeyReference.js
+++ b/lib/services/computeManagement2/lib/models/keyVaultKeyReference.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a reference to Key Vault Key
*
diff --git a/lib/services/computeManagement2/lib/models/keyVaultSecretReference.js b/lib/services/computeManagement2/lib/models/keyVaultSecretReference.js
index ea317e47e8..422a764da3 100644
--- a/lib/services/computeManagement2/lib/models/keyVaultSecretReference.js
+++ b/lib/services/computeManagement2/lib/models/keyVaultSecretReference.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a reference to Key Vault Secret
*
diff --git a/lib/services/computeManagement2/lib/models/linuxConfiguration.js b/lib/services/computeManagement2/lib/models/linuxConfiguration.js
index 879d4b2cc5..e5b3822cc4 100644
--- a/lib/services/computeManagement2/lib/models/linuxConfiguration.js
+++ b/lib/services/computeManagement2/lib/models/linuxConfiguration.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Specifies the Linux operating system settings on the virtual machine.
*
For a list of supported Linux distributions, see [Linux on
@@ -30,6 +28,11 @@ class LinuxConfiguration {
* @member {object} [ssh] Specifies the ssh key configuration for a Linux OS.
* @member {array} [ssh.publicKeys] The list of SSH public keys used to
* authenticate with linux based VMs.
+ * @member {boolean} [provisionVMAgent] Indicates whether virtual machine
+ * agent should be provisioned on the virtual machine.
When this
+ * property is not specified in the request body, default behavior is to set
+ * it to true. This will ensure that VM Agent is installed on the VM so that
+ * extensions can be added to the VM later.
*/
constructor() {
}
@@ -62,6 +65,13 @@ class LinuxConfiguration {
name: 'Composite',
className: 'SshConfiguration'
}
+ },
+ provisionVMAgent: {
+ required: false,
+ serializedName: 'provisionVMAgent',
+ type: {
+ name: 'Boolean'
+ }
}
}
}
diff --git a/lib/services/computeManagement2/lib/models/logAnalyticsOperationResult.js b/lib/services/computeManagement2/lib/models/logAnalyticsOperationResult.js
index 0bc73509e1..993e0aa9af 100644
--- a/lib/services/computeManagement2/lib/models/logAnalyticsOperationResult.js
+++ b/lib/services/computeManagement2/lib/models/logAnalyticsOperationResult.js
@@ -10,14 +10,11 @@
'use strict';
-const models = require('./index');
-
/**
* LogAnalytics operation status response
*
- * @extends models['OperationStatusResponse']
*/
-class LogAnalyticsOperationResult extends models['OperationStatusResponse'] {
+class LogAnalyticsOperationResult {
/**
* Create a LogAnalyticsOperationResult.
* @member {object} [properties] LogAnalyticsOutput
@@ -25,7 +22,6 @@ class LogAnalyticsOperationResult extends models['OperationStatusResponse'] {
* container.
*/
constructor() {
- super();
}
/**
@@ -42,47 +38,6 @@ class LogAnalyticsOperationResult extends models['OperationStatusResponse'] {
name: 'Composite',
className: 'LogAnalyticsOperationResult',
modelProperties: {
- name: {
- required: false,
- readOnly: true,
- serializedName: 'name',
- type: {
- name: 'String'
- }
- },
- status: {
- required: false,
- readOnly: true,
- serializedName: 'status',
- type: {
- name: 'String'
- }
- },
- startTime: {
- required: false,
- readOnly: true,
- serializedName: 'startTime',
- type: {
- name: 'DateTime'
- }
- },
- endTime: {
- required: false,
- readOnly: true,
- serializedName: 'endTime',
- type: {
- name: 'DateTime'
- }
- },
- error: {
- required: false,
- readOnly: true,
- serializedName: 'error',
- type: {
- name: 'Composite',
- className: 'ApiError'
- }
- },
properties: {
required: false,
readOnly: true,
diff --git a/lib/services/computeManagement2/lib/models/managedArtifact.js b/lib/services/computeManagement2/lib/models/managedArtifact.js
new file mode 100644
index 0000000000..cadb714ab4
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/managedArtifact.js
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * The managed artifact.
+ *
+ */
+class ManagedArtifact {
+ /**
+ * Create a ManagedArtifact.
+ * @member {string} [id] The managed artifact id.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of ManagedArtifact
+ *
+ * @returns {object} metadata of ManagedArtifact
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'ManagedArtifact',
+ type: {
+ name: 'Composite',
+ className: 'ManagedArtifact',
+ modelProperties: {
+ id: {
+ required: false,
+ serializedName: 'id',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = ManagedArtifact;
diff --git a/lib/services/computeManagement2/lib/models/managedDiskParameters.js b/lib/services/computeManagement2/lib/models/managedDiskParameters.js
index 3764fa7812..68d7404f03 100644
--- a/lib/services/computeManagement2/lib/models/managedDiskParameters.js
+++ b/lib/services/computeManagement2/lib/models/managedDiskParameters.js
@@ -21,8 +21,9 @@ class ManagedDiskParameters extends models['SubResource'] {
/**
* Create a ManagedDiskParameters.
* @member {string} [storageAccountType] Specifies the storage account type
- * for the managed disk. Possible values are: Standard_LRS or Premium_LRS.
- * Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * for the managed disk. Possible values are: Standard_LRS, Premium_LRS, and
+ * StandardSSD_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS',
+ * 'StandardSSD_LRS'
*/
constructor() {
super();
diff --git a/lib/services/computeManagement2/lib/models/networkProfile.js b/lib/services/computeManagement2/lib/models/networkProfile.js
index 050b2faa00..7d6912dada 100644
--- a/lib/services/computeManagement2/lib/models/networkProfile.js
+++ b/lib/services/computeManagement2/lib/models/networkProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Specifies the network interfaces of the virtual machine.
*
diff --git a/lib/services/computeManagement2/lib/models/oSDisk.js b/lib/services/computeManagement2/lib/models/oSDisk.js
index bf576f1740..3743327dcd 100644
--- a/lib/services/computeManagement2/lib/models/oSDisk.js
+++ b/lib/services/computeManagement2/lib/models/oSDisk.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Specifies information about the operating system disk used by the virtual
* machine.
For more information about disks, see [About disks and
@@ -74,8 +72,9 @@ class OSDisk {
* virtual machine image.
This value cannot be larger than 1023 GB
* @member {object} [managedDisk] The managed disk parameters.
* @member {string} [managedDisk.storageAccountType] Specifies the storage
- * account type for the managed disk. Possible values are: Standard_LRS or
- * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * account type for the managed disk. Possible values are: Standard_LRS,
+ * Premium_LRS, and StandardSSD_LRS. Possible values include: 'Standard_LRS',
+ * 'Premium_LRS', 'StandardSSD_LRS'
*/
constructor() {
}
diff --git a/lib/services/computeManagement2/lib/models/oSProfile.js b/lib/services/computeManagement2/lib/models/oSProfile.js
index cf904eba6f..60b86fa154 100644
--- a/lib/services/computeManagement2/lib/models/oSProfile.js
+++ b/lib/services/computeManagement2/lib/models/oSProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Specifies the operating system settings for the virtual machine.
*
@@ -90,8 +88,16 @@ class OSProfile {
* configuration for a Linux OS.
* @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public
* keys used to authenticate with linux based VMs.
+ * @member {boolean} [linuxConfiguration.provisionVMAgent] Indicates whether
+ * virtual machine agent should be provisioned on the virtual machine.
+ *
When this property is not specified in the request body, default
+ * behavior is to set it to true. This will ensure that VM Agent is
+ * installed on the VM so that extensions can be added to the VM later.
* @member {array} [secrets] Specifies set of certificates that should be
* installed onto the virtual machine.
+ * @member {boolean} [allowExtensionOperations] Specifies whether extension
+ * operations should be allowed on the virtual machine.
This may only
+ * be set to False when no extensions are present on the virtual machine.
*/
constructor() {
}
@@ -168,6 +174,13 @@ class OSProfile {
}
}
}
+ },
+ allowExtensionOperations: {
+ required: false,
+ serializedName: 'allowExtensionOperations',
+ type: {
+ name: 'Boolean'
+ }
}
}
}
diff --git a/lib/services/computeManagement2/lib/models/recommendedMachineConfiguration.js b/lib/services/computeManagement2/lib/models/recommendedMachineConfiguration.js
new file mode 100644
index 0000000000..a3070932a6
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/recommendedMachineConfiguration.js
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const models = require('./index');
+
+/**
+ * Describes the recommended machine configuration.
+ *
+ */
+class RecommendedMachineConfiguration {
+ /**
+ * Create a RecommendedMachineConfiguration.
+ * @member {object} [vCPUs]
+ * @member {number} [vCPUs.min] The minimum number of the resource.
+ * @member {number} [vCPUs.max] The maximum number of the resource.
+ * @member {object} [memory]
+ * @member {number} [memory.min] The minimum number of the resource.
+ * @member {number} [memory.max] The maximum number of the resource.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of RecommendedMachineConfiguration
+ *
+ * @returns {object} metadata of RecommendedMachineConfiguration
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'RecommendedMachineConfiguration',
+ type: {
+ name: 'Composite',
+ className: 'RecommendedMachineConfiguration',
+ modelProperties: {
+ vCPUs: {
+ required: false,
+ serializedName: 'vCPUs',
+ type: {
+ name: 'Composite',
+ className: 'ResourceRange'
+ }
+ },
+ memory: {
+ required: false,
+ serializedName: 'memory',
+ type: {
+ name: 'Composite',
+ className: 'ResourceRange'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = RecommendedMachineConfiguration;
diff --git a/lib/services/computeManagement2/lib/models/regionalReplicationStatus.js b/lib/services/computeManagement2/lib/models/regionalReplicationStatus.js
new file mode 100644
index 0000000000..61db9eb55d
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/regionalReplicationStatus.js
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * This is the regional replication status.
+ *
+ */
+class RegionalReplicationStatus {
+ /**
+ * Create a RegionalReplicationStatus.
+ * @member {string} [region] The region where the gallery image version is
+ * published to.
+ * @member {string} [state] This is the regional replication state. Possible
+ * values include: 'Unknown', 'Replicating', 'Completed', 'Failed'
+ * @member {string} [details] The details of the replication status.
+ * @member {number} [progress] It indicates progress of the replication job.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of RegionalReplicationStatus
+ *
+ * @returns {object} metadata of RegionalReplicationStatus
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'RegionalReplicationStatus',
+ type: {
+ name: 'Composite',
+ className: 'RegionalReplicationStatus',
+ modelProperties: {
+ region: {
+ required: false,
+ serializedName: 'region',
+ type: {
+ name: 'String'
+ }
+ },
+ state: {
+ required: false,
+ serializedName: 'state',
+ type: {
+ name: 'Enum',
+ allowedValues: [ 'Unknown', 'Replicating', 'Completed', 'Failed' ]
+ }
+ },
+ details: {
+ required: false,
+ serializedName: 'details',
+ type: {
+ name: 'String'
+ }
+ },
+ progress: {
+ required: false,
+ serializedName: 'progress',
+ type: {
+ name: 'Number'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = RegionalReplicationStatus;
diff --git a/lib/services/computeManagement2/lib/models/replicationStatus.js b/lib/services/computeManagement2/lib/models/replicationStatus.js
new file mode 100644
index 0000000000..edaa93fdf1
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/replicationStatus.js
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const models = require('./index');
+
+/**
+ * This is the replication status of the gallery image version.
+ *
+ */
+class ReplicationStatus {
+ /**
+ * Create a ReplicationStatus.
+ * @member {string} [aggregatedState] This is the aggregated replication
+ * status based on the regional replication status. Possible values include:
+ * 'Unknown', 'InProgress', 'Completed', 'Failed'
+ * @member {array} [summary] This is a summary of replication status for each
+ * region.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of ReplicationStatus
+ *
+ * @returns {object} metadata of ReplicationStatus
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'ReplicationStatus',
+ type: {
+ name: 'Composite',
+ className: 'ReplicationStatus',
+ modelProperties: {
+ aggregatedState: {
+ required: false,
+ serializedName: 'aggregatedState',
+ type: {
+ name: 'Enum',
+ allowedValues: [ 'Unknown', 'InProgress', 'Completed', 'Failed' ]
+ }
+ },
+ summary: {
+ required: false,
+ serializedName: 'summary',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'RegionalReplicationStatusElementType',
+ type: {
+ name: 'Composite',
+ className: 'RegionalReplicationStatus'
+ }
+ }
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = ReplicationStatus;
diff --git a/lib/services/computeManagement2/lib/models/resourceRange.js b/lib/services/computeManagement2/lib/models/resourceRange.js
new file mode 100644
index 0000000000..6c249385e7
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/resourceRange.js
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * Describes the resource range.
+ *
+ */
+class ResourceRange {
+ /**
+ * Create a ResourceRange.
+ * @member {number} [min] The minimum number of the resource.
+ * @member {number} [max] The maximum number of the resource.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of ResourceRange
+ *
+ * @returns {object} metadata of ResourceRange
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'ResourceRange',
+ type: {
+ name: 'Composite',
+ className: 'ResourceRange',
+ modelProperties: {
+ min: {
+ required: false,
+ serializedName: 'min',
+ type: {
+ name: 'Number'
+ }
+ },
+ max: {
+ required: false,
+ serializedName: 'max',
+ type: {
+ name: 'Number'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = ResourceRange;
diff --git a/lib/services/computeManagement2/lib/models/resourceSku.js b/lib/services/computeManagement2/lib/models/resourceSku.js
index 848c0dc886..d6d21873b6 100644
--- a/lib/services/computeManagement2/lib/models/resourceSku.js
+++ b/lib/services/computeManagement2/lib/models/resourceSku.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes an available Compute SKU.
*
diff --git a/lib/services/computeManagement2/lib/models/resourceSkuRestrictions.js b/lib/services/computeManagement2/lib/models/resourceSkuRestrictions.js
index e163e71ec6..2a8db80958 100644
--- a/lib/services/computeManagement2/lib/models/resourceSkuRestrictions.js
+++ b/lib/services/computeManagement2/lib/models/resourceSkuRestrictions.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes scaling information of a SKU.
*
diff --git a/lib/services/computeManagement2/lib/models/rollbackStatusInfo.js b/lib/services/computeManagement2/lib/models/rollbackStatusInfo.js
new file mode 100644
index 0000000000..bbfa82de4f
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/rollbackStatusInfo.js
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * Information about rollback on failed VM instances after a OS Upgrade
+ * operation.
+ *
+ */
+class RollbackStatusInfo {
+ /**
+ * Create a RollbackStatusInfo.
+ * @member {number} [successfullyRolledbackInstanceCount] The number of
+ * instances which have been successfully rolled back.
+ * @member {number} [failedRolledbackInstanceCount] The number of instances
+ * which failed to rollback.
+ * @member {object} [rollbackError] Error details if OS rollback failed.
+ * @member {array} [rollbackError.details] The Api error details
+ * @member {object} [rollbackError.innererror] The Api inner error
+ * @member {string} [rollbackError.innererror.exceptiontype] The exception
+ * type.
+ * @member {string} [rollbackError.innererror.errordetail] The internal error
+ * message or exception dump.
+ * @member {string} [rollbackError.code] The error code.
+ * @member {string} [rollbackError.target] The target of the particular
+ * error.
+ * @member {string} [rollbackError.message] The error message.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of RollbackStatusInfo
+ *
+ * @returns {object} metadata of RollbackStatusInfo
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'RollbackStatusInfo',
+ type: {
+ name: 'Composite',
+ className: 'RollbackStatusInfo',
+ modelProperties: {
+ successfullyRolledbackInstanceCount: {
+ required: false,
+ readOnly: true,
+ serializedName: 'successfullyRolledbackInstanceCount',
+ type: {
+ name: 'Number'
+ }
+ },
+ failedRolledbackInstanceCount: {
+ required: false,
+ readOnly: true,
+ serializedName: 'failedRolledbackInstanceCount',
+ type: {
+ name: 'Number'
+ }
+ },
+ rollbackError: {
+ required: false,
+ readOnly: true,
+ serializedName: 'rollbackError',
+ type: {
+ name: 'Composite',
+ className: 'ApiError'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = RollbackStatusInfo;
diff --git a/lib/services/computeManagement2/lib/models/runCommandInput.js b/lib/services/computeManagement2/lib/models/runCommandInput.js
index e245ae5fe0..0aebb6e982 100644
--- a/lib/services/computeManagement2/lib/models/runCommandInput.js
+++ b/lib/services/computeManagement2/lib/models/runCommandInput.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Capture Virtual Machine parameters.
*
diff --git a/lib/services/computeManagement2/lib/models/runCommandResult.js b/lib/services/computeManagement2/lib/models/runCommandResult.js
index f23a7d1b8c..7b5d56c547 100644
--- a/lib/services/computeManagement2/lib/models/runCommandResult.js
+++ b/lib/services/computeManagement2/lib/models/runCommandResult.js
@@ -10,20 +10,15 @@
'use strict';
-const models = require('./index');
-
/**
- * Run command operation response.
- *
- * @extends models['OperationStatusResponse']
+ * Class representing a RunCommandResult.
*/
-class RunCommandResult extends models['OperationStatusResponse'] {
+class RunCommandResult {
/**
* Create a RunCommandResult.
- * @member {object} [output] Operation output data (raw JSON)
+ * @member {array} [value] Run command operation response.
*/
constructor() {
- super();
}
/**
@@ -40,52 +35,19 @@ class RunCommandResult extends models['OperationStatusResponse'] {
name: 'Composite',
className: 'RunCommandResult',
modelProperties: {
- name: {
- required: false,
- readOnly: true,
- serializedName: 'name',
- type: {
- name: 'String'
- }
- },
- status: {
- required: false,
- readOnly: true,
- serializedName: 'status',
- type: {
- name: 'String'
- }
- },
- startTime: {
- required: false,
- readOnly: true,
- serializedName: 'startTime',
- type: {
- name: 'DateTime'
- }
- },
- endTime: {
- required: false,
- readOnly: true,
- serializedName: 'endTime',
- type: {
- name: 'DateTime'
- }
- },
- error: {
- required: false,
- readOnly: true,
- serializedName: 'error',
- type: {
- name: 'Composite',
- className: 'ApiError'
- }
- },
- output: {
+ value: {
required: false,
- serializedName: 'properties.output',
+ serializedName: 'value',
type: {
- name: 'Object'
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'InstanceViewStatusElementType',
+ type: {
+ name: 'Composite',
+ className: 'InstanceViewStatus'
+ }
+ }
}
}
}
diff --git a/lib/services/computeManagement2/lib/models/snapshotUpdate.js b/lib/services/computeManagement2/lib/models/snapshotUpdate.js
index c09c4e427f..967545e4f8 100644
--- a/lib/services/computeManagement2/lib/models/snapshotUpdate.js
+++ b/lib/services/computeManagement2/lib/models/snapshotUpdate.js
@@ -10,14 +10,11 @@
'use strict';
-const models = require('./index');
-
/**
* Snapshot update resource.
*
- * @extends models['ResourceUpdate']
*/
-class SnapshotUpdate extends models['ResourceUpdate'] {
+class SnapshotUpdate {
/**
* Create a SnapshotUpdate.
* @member {string} [osType] the Operating System type. Possible values
@@ -50,9 +47,13 @@ class SnapshotUpdate extends models['ResourceUpdate'] {
* Resource Id
* @member {string} [encryptionSettings.keyEncryptionKey.keyUrl] Url pointing
* to a key or secret in KeyVault
+ * @member {object} [tags] Resource tags
+ * @member {object} [sku]
+ * @member {string} [sku.name] The sku name. Possible values include:
+ * 'Standard_LRS', 'Premium_LRS', 'Standard_ZRS'
+ * @member {string} [sku.tier] The sku tier.
*/
constructor() {
- super();
}
/**
@@ -69,28 +70,6 @@ class SnapshotUpdate extends models['ResourceUpdate'] {
name: 'Composite',
className: 'SnapshotUpdate',
modelProperties: {
- tags: {
- required: false,
- serializedName: 'tags',
- type: {
- name: 'Dictionary',
- value: {
- required: false,
- serializedName: 'StringElementType',
- type: {
- name: 'String'
- }
- }
- }
- },
- sku: {
- required: false,
- serializedName: 'sku',
- type: {
- name: 'Composite',
- className: 'DiskSku'
- }
- },
osType: {
required: false,
serializedName: 'properties.osType',
@@ -113,6 +92,28 @@ class SnapshotUpdate extends models['ResourceUpdate'] {
name: 'Composite',
className: 'EncryptionSettings'
}
+ },
+ tags: {
+ required: false,
+ serializedName: 'tags',
+ type: {
+ name: 'Dictionary',
+ value: {
+ required: false,
+ serializedName: 'StringElementType',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ },
+ sku: {
+ required: false,
+ serializedName: 'sku',
+ type: {
+ name: 'Composite',
+ className: 'SnapshotSku'
+ }
}
}
}
diff --git a/lib/services/computeManagement2/lib/models/sshConfiguration.js b/lib/services/computeManagement2/lib/models/sshConfiguration.js
index 0dc25e1a7e..dea2921dd5 100644
--- a/lib/services/computeManagement2/lib/models/sshConfiguration.js
+++ b/lib/services/computeManagement2/lib/models/sshConfiguration.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* SSH configuration for Linux based VMs running on Azure
*
diff --git a/lib/services/computeManagement2/lib/models/storageProfile.js b/lib/services/computeManagement2/lib/models/storageProfile.js
index 38b108fcd0..864a758aa1 100644
--- a/lib/services/computeManagement2/lib/models/storageProfile.js
+++ b/lib/services/computeManagement2/lib/models/storageProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Specifies the storage settings for the virtual machine disks.
*
@@ -95,8 +93,8 @@ class StorageProfile {
* @member {object} [osDisk.managedDisk] The managed disk parameters.
* @member {string} [osDisk.managedDisk.storageAccountType] Specifies the
* storage account type for the managed disk. Possible values are:
- * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values include:
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [dataDisks] Specifies the parameters that are used to add
* a data disk to a virtual machine.
For more information about
* disks, see [About disks and VHDs for Azure virtual
diff --git a/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfo.js b/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfo.js
new file mode 100644
index 0000000000..cc5a4f043b
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfo.js
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * 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';
+
+/**
+ * Virtual Machine Scale Set OS Upgrade History operation response.
+ *
+ */
+class UpgradeOperationHistoricalStatusInfo {
+ /**
+ * Create a UpgradeOperationHistoricalStatusInfo.
+ * @member {object} [properties] Information about the properties of the
+ * upgrade operation.
+ * @member {object} [properties.runningStatus] Information about the overall
+ * status of the upgrade operation.
+ * @member {string} [properties.runningStatus.code] Code indicating the
+ * current status of the upgrade. Possible values include: 'RollingForward',
+ * 'Cancelled', 'Completed', 'Faulted'
+ * @member {date} [properties.runningStatus.startTime] Start time of the
+ * upgrade.
+ * @member {date} [properties.runningStatus.endTime] End time of the upgrade.
+ * @member {object} [properties.progress] Counts of the VM's in each state.
+ * @member {number} [properties.progress.successfulInstanceCount] The number
+ * of instances that have been successfully upgraded.
+ * @member {number} [properties.progress.failedInstanceCount] The number of
+ * instances that have failed to be upgraded successfully.
+ * @member {number} [properties.progress.inProgressInstanceCount] The number
+ * of instances that are currently being upgraded.
+ * @member {number} [properties.progress.pendingInstanceCount] The number of
+ * instances that have not yet begun to be upgraded.
+ * @member {object} [properties.error] Error Details for this upgrade if
+ * there are any.
+ * @member {array} [properties.error.details] The Api error details
+ * @member {object} [properties.error.innererror] The Api inner error
+ * @member {string} [properties.error.innererror.exceptiontype] The exception
+ * type.
+ * @member {string} [properties.error.innererror.errordetail] The internal
+ * error message or exception dump.
+ * @member {string} [properties.error.code] The error code.
+ * @member {string} [properties.error.target] The target of the particular
+ * error.
+ * @member {string} [properties.error.message] The error message.
+ * @member {string} [properties.startedBy] Invoker of the Upgrade Operation.
+ * Possible values include: 'Unknown', 'User', 'Platform'
+ * @member {object} [properties.targetImageReference] Image Reference details
+ * @member {string} [properties.targetImageReference.publisher] The image
+ * publisher.
+ * @member {string} [properties.targetImageReference.offer] Specifies the
+ * offer of the platform image or marketplace image used to create the
+ * virtual machine.
+ * @member {string} [properties.targetImageReference.sku] The image SKU.
+ * @member {string} [properties.targetImageReference.version] Specifies the
+ * version of the platform image or marketplace image used to create the
+ * virtual machine. The allowed formats are Major.Minor.Build or 'latest'.
+ * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the
+ * latest version of an image available at deploy time. Even if you use
+ * 'latest', the VM image will not automatically update after deploy time
+ * even if a new version becomes available.
+ * @member {object} [properties.rollbackInfo] Information about OS rollback
+ * if performed
+ * @member {number}
+ * [properties.rollbackInfo.successfullyRolledbackInstanceCount] The number
+ * of instances which have been successfully rolled back.
+ * @member {number} [properties.rollbackInfo.failedRolledbackInstanceCount]
+ * The number of instances which failed to rollback.
+ * @member {object} [properties.rollbackInfo.rollbackError] Error details if
+ * OS rollback failed.
+ * @member {array} [properties.rollbackInfo.rollbackError.details] The Api
+ * error details
+ * @member {object} [properties.rollbackInfo.rollbackError.innererror] The
+ * Api inner error
+ * @member {string}
+ * [properties.rollbackInfo.rollbackError.innererror.exceptiontype] The
+ * exception type.
+ * @member {string}
+ * [properties.rollbackInfo.rollbackError.innererror.errordetail] The
+ * internal error message or exception dump.
+ * @member {string} [properties.rollbackInfo.rollbackError.code] The error
+ * code.
+ * @member {string} [properties.rollbackInfo.rollbackError.target] The target
+ * of the particular error.
+ * @member {string} [properties.rollbackInfo.rollbackError.message] The error
+ * message.
+ * @member {string} [type] Resource type
+ * @member {string} [location] Resource location
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of UpgradeOperationHistoricalStatusInfo
+ *
+ * @returns {object} metadata of UpgradeOperationHistoricalStatusInfo
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'UpgradeOperationHistoricalStatusInfo',
+ type: {
+ name: 'Composite',
+ className: 'UpgradeOperationHistoricalStatusInfo',
+ modelProperties: {
+ properties: {
+ required: false,
+ readOnly: true,
+ serializedName: 'properties',
+ type: {
+ name: 'Composite',
+ className: 'UpgradeOperationHistoricalStatusInfoProperties'
+ }
+ },
+ type: {
+ required: false,
+ readOnly: true,
+ serializedName: 'type',
+ type: {
+ name: 'String'
+ }
+ },
+ location: {
+ required: false,
+ readOnly: true,
+ serializedName: 'location',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = UpgradeOperationHistoricalStatusInfo;
diff --git a/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfoProperties.js b/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfoProperties.js
new file mode 100644
index 0000000000..2b6ff23fa5
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/upgradeOperationHistoricalStatusInfoProperties.js
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * Describes each OS upgrade on the Virtual Machine Scale Set.
+ *
+ */
+class UpgradeOperationHistoricalStatusInfoProperties {
+ /**
+ * Create a UpgradeOperationHistoricalStatusInfoProperties.
+ * @member {object} [runningStatus] Information about the overall status of
+ * the upgrade operation.
+ * @member {string} [runningStatus.code] Code indicating the current status
+ * of the upgrade. Possible values include: 'RollingForward', 'Cancelled',
+ * 'Completed', 'Faulted'
+ * @member {date} [runningStatus.startTime] Start time of the upgrade.
+ * @member {date} [runningStatus.endTime] End time of the upgrade.
+ * @member {object} [progress] Counts of the VM's in each state.
+ * @member {number} [progress.successfulInstanceCount] The number of
+ * instances that have been successfully upgraded.
+ * @member {number} [progress.failedInstanceCount] The number of instances
+ * that have failed to be upgraded successfully.
+ * @member {number} [progress.inProgressInstanceCount] The number of
+ * instances that are currently being upgraded.
+ * @member {number} [progress.pendingInstanceCount] The number of instances
+ * that have not yet begun to be upgraded.
+ * @member {object} [error] Error Details for this upgrade if there are any.
+ * @member {array} [error.details] The Api error details
+ * @member {object} [error.innererror] The Api inner error
+ * @member {string} [error.innererror.exceptiontype] The exception type.
+ * @member {string} [error.innererror.errordetail] The internal error message
+ * or exception dump.
+ * @member {string} [error.code] The error code.
+ * @member {string} [error.target] The target of the particular error.
+ * @member {string} [error.message] The error message.
+ * @member {string} [startedBy] Invoker of the Upgrade Operation. Possible
+ * values include: 'Unknown', 'User', 'Platform'
+ * @member {object} [targetImageReference] Image Reference details
+ * @member {string} [targetImageReference.publisher] The image publisher.
+ * @member {string} [targetImageReference.offer] Specifies the offer of the
+ * platform image or marketplace image used to create the virtual machine.
+ * @member {string} [targetImageReference.sku] The image SKU.
+ * @member {string} [targetImageReference.version] Specifies the version of
+ * the platform image or marketplace image used to create the virtual
+ * machine. The allowed formats are Major.Minor.Build or 'latest'. Major,
+ * Minor, and Build are decimal numbers. Specify 'latest' to use the latest
+ * version of an image available at deploy time. Even if you use 'latest',
+ * the VM image will not automatically update after deploy time even if a new
+ * version becomes available.
+ * @member {object} [rollbackInfo] Information about OS rollback if performed
+ * @member {number} [rollbackInfo.successfullyRolledbackInstanceCount] The
+ * number of instances which have been successfully rolled back.
+ * @member {number} [rollbackInfo.failedRolledbackInstanceCount] The number
+ * of instances which failed to rollback.
+ * @member {object} [rollbackInfo.rollbackError] Error details if OS rollback
+ * failed.
+ * @member {array} [rollbackInfo.rollbackError.details] The Api error details
+ * @member {object} [rollbackInfo.rollbackError.innererror] The Api inner
+ * error
+ * @member {string} [rollbackInfo.rollbackError.innererror.exceptiontype] The
+ * exception type.
+ * @member {string} [rollbackInfo.rollbackError.innererror.errordetail] The
+ * internal error message or exception dump.
+ * @member {string} [rollbackInfo.rollbackError.code] The error code.
+ * @member {string} [rollbackInfo.rollbackError.target] The target of the
+ * particular error.
+ * @member {string} [rollbackInfo.rollbackError.message] The error message.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of UpgradeOperationHistoricalStatusInfoProperties
+ *
+ * @returns {object} metadata of UpgradeOperationHistoricalStatusInfoProperties
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'UpgradeOperationHistoricalStatusInfoProperties',
+ type: {
+ name: 'Composite',
+ className: 'UpgradeOperationHistoricalStatusInfoProperties',
+ modelProperties: {
+ runningStatus: {
+ required: false,
+ readOnly: true,
+ serializedName: 'runningStatus',
+ type: {
+ name: 'Composite',
+ className: 'UpgradeOperationHistoryStatus'
+ }
+ },
+ progress: {
+ required: false,
+ readOnly: true,
+ serializedName: 'progress',
+ type: {
+ name: 'Composite',
+ className: 'RollingUpgradeProgressInfo'
+ }
+ },
+ error: {
+ required: false,
+ readOnly: true,
+ serializedName: 'error',
+ type: {
+ name: 'Composite',
+ className: 'ApiError'
+ }
+ },
+ startedBy: {
+ required: false,
+ readOnly: true,
+ serializedName: 'startedBy',
+ type: {
+ name: 'Enum',
+ allowedValues: [ 'Unknown', 'User', 'Platform' ]
+ }
+ },
+ targetImageReference: {
+ required: false,
+ readOnly: true,
+ serializedName: 'targetImageReference',
+ type: {
+ name: 'Composite',
+ className: 'ImageReference'
+ }
+ },
+ rollbackInfo: {
+ required: false,
+ readOnly: true,
+ serializedName: 'rollbackInfo',
+ type: {
+ name: 'Composite',
+ className: 'RollbackStatusInfo'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = UpgradeOperationHistoricalStatusInfoProperties;
diff --git a/lib/services/computeManagement2/lib/models/upgradeOperationHistoryStatus.js b/lib/services/computeManagement2/lib/models/upgradeOperationHistoryStatus.js
new file mode 100644
index 0000000000..989c1480d4
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/upgradeOperationHistoryStatus.js
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * Information about the current running state of the overall upgrade.
+ *
+ */
+class UpgradeOperationHistoryStatus {
+ /**
+ * Create a UpgradeOperationHistoryStatus.
+ * @member {string} [code] Code indicating the current status of the upgrade.
+ * Possible values include: 'RollingForward', 'Cancelled', 'Completed',
+ * 'Faulted'
+ * @member {date} [startTime] Start time of the upgrade.
+ * @member {date} [endTime] End time of the upgrade.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of UpgradeOperationHistoryStatus
+ *
+ * @returns {object} metadata of UpgradeOperationHistoryStatus
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'UpgradeOperationHistoryStatus',
+ type: {
+ name: 'Composite',
+ className: 'UpgradeOperationHistoryStatus',
+ modelProperties: {
+ code: {
+ required: false,
+ readOnly: true,
+ serializedName: 'code',
+ type: {
+ name: 'Enum',
+ allowedValues: [ 'RollingForward', 'Cancelled', 'Completed', 'Faulted' ]
+ }
+ },
+ startTime: {
+ required: false,
+ readOnly: true,
+ serializedName: 'startTime',
+ type: {
+ name: 'DateTime'
+ }
+ },
+ endTime: {
+ required: false,
+ readOnly: true,
+ serializedName: 'endTime',
+ type: {
+ name: 'DateTime'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = UpgradeOperationHistoryStatus;
diff --git a/lib/services/computeManagement2/lib/models/upgradePolicy.js b/lib/services/computeManagement2/lib/models/upgradePolicy.js
index eb5f4643c8..401ac53237 100644
--- a/lib/services/computeManagement2/lib/models/upgradePolicy.js
+++ b/lib/services/computeManagement2/lib/models/upgradePolicy.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes an upgrade policy - automatic, manual, or rolling.
*
@@ -54,6 +52,10 @@ class UpgradePolicy {
* @member {boolean} [automaticOSUpgrade] Whether OS upgrades should
* automatically be applied to scale set instances in a rolling fashion when
* a newer version of the image becomes available.
+ * @member {object} [autoOSUpgradePolicy] Configuration parameters used for
+ * performing automatic OS Upgrade.
+ * @member {boolean} [autoOSUpgradePolicy.disableAutoRollback] Whether OS
+ * image rollback feature should be disabled. Default value is false.
*/
constructor() {
}
@@ -94,6 +96,14 @@ class UpgradePolicy {
type: {
name: 'Boolean'
}
+ },
+ autoOSUpgradePolicy: {
+ required: false,
+ serializedName: 'autoOSUpgradePolicy',
+ type: {
+ name: 'Composite',
+ className: 'AutoOSUpgradePolicy'
+ }
}
}
}
diff --git a/lib/services/computeManagement2/lib/models/usage.js b/lib/services/computeManagement2/lib/models/usage.js
index 8566e4ebee..c840e66a99 100644
--- a/lib/services/computeManagement2/lib/models/usage.js
+++ b/lib/services/computeManagement2/lib/models/usage.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes Compute Resource Usage.
*
diff --git a/lib/services/computeManagement2/lib/models/vaultSecretGroup.js b/lib/services/computeManagement2/lib/models/vaultSecretGroup.js
index e1a7e3f5ff..9922059631 100644
--- a/lib/services/computeManagement2/lib/models/vaultSecretGroup.js
+++ b/lib/services/computeManagement2/lib/models/vaultSecretGroup.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a set of certificates which are all in the same Key Vault.
*
diff --git a/lib/services/computeManagement2/lib/models/virtualMachine.js b/lib/services/computeManagement2/lib/models/virtualMachine.js
index dfb237a362..937e0fab38 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachine.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachine.js
@@ -187,8 +187,8 @@ class VirtualMachine extends models['Resource'] {
* parameters.
* @member {string} [storageProfile.osDisk.managedDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [storageProfile.dataDisks] Specifies the parameters that
* are used to add a data disk to a virtual machine.
For more
* information about disks, see [About disks and VHDs for Azure virtual
@@ -271,8 +271,18 @@ class VirtualMachine extends models['Resource'] {
* configuration for a Linux OS.
* @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of
* SSH public keys used to authenticate with linux based VMs.
+ * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent]
+ * Indicates whether virtual machine agent should be provisioned on the
+ * virtual machine.
When this property is not specified in the
+ * request body, default behavior is to set it to true. This will ensure
+ * that VM Agent is installed on the VM so that extensions can be added to
+ * the VM later.
* @member {array} [osProfile.secrets] Specifies set of certificates that
* should be installed onto the virtual machine.
+ * @member {boolean} [osProfile.allowExtensionOperations] Specifies whether
+ * extension operations should be allowed on the virtual machine.
+ *
This may only be set to False when no extensions are present on
+ * the virtual machine.
* @member {object} [networkProfile] Specifies the network interfaces of the
* virtual machine.
* @member {array} [networkProfile.networkInterfaces] Specifies the list of
@@ -389,10 +399,10 @@ class VirtualMachine extends models['Resource'] {
* type 'None' will remove any identities from the virtual machine. Possible
* values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned,
* UserAssigned', 'None'
- * @member {array} [identity.identityIds] The list of user identities
- * associated with the Virtual Machine. The user identity references will be
- * ARM resource ids in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
+ * @member {object} [identity.userAssignedIdentities] The list of user
+ * identities associated with the Virtual Machine. The user identity
+ * dictionary key references will be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
* @member {array} [zones] The virtual machine zones.
*/
constructor() {
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineAgentInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineAgentInstanceView.js
index 93bc2c51be..25fe929ef7 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineAgentInstanceView.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineAgentInstanceView.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* The instance view of the VM Agent running on the virtual machine.
*
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineCaptureResult.js b/lib/services/computeManagement2/lib/models/virtualMachineCaptureResult.js
index 82d3ef372b..67facb1d8a 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineCaptureResult.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineCaptureResult.js
@@ -13,14 +13,18 @@
const models = require('./index');
/**
- * Resource Id.
+ * Output of virtual machine capture operation.
*
* @extends models['SubResource']
*/
class VirtualMachineCaptureResult extends models['SubResource'] {
/**
* Create a VirtualMachineCaptureResult.
- * @member {object} [output] Operation output data (raw JSON)
+ * @member {string} [schema] the schema of the captured virtual machine
+ * @member {string} [contentVersion] the version of the content
+ * @member {object} [parameters] parameters of the captured virtual machine
+ * @member {array} [resources] a list of resource items of the captured
+ * virtual machine
*/
constructor() {
super();
@@ -47,12 +51,44 @@ class VirtualMachineCaptureResult extends models['SubResource'] {
name: 'String'
}
},
- output: {
+ schema: {
required: false,
- serializedName: 'properties.output',
+ readOnly: true,
+ serializedName: '$schema',
+ type: {
+ name: 'String'
+ }
+ },
+ contentVersion: {
+ required: false,
+ readOnly: true,
+ serializedName: 'contentVersion',
+ type: {
+ name: 'String'
+ }
+ },
+ parameters: {
+ required: false,
+ readOnly: true,
+ serializedName: 'parameters',
type: {
name: 'Object'
}
+ },
+ resources: {
+ required: false,
+ readOnly: true,
+ serializedName: 'resources',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'ObjectElementType',
+ type: {
+ name: 'Object'
+ }
+ }
+ }
}
}
}
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineExtensionHandlerInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineExtensionHandlerInstanceView.js
index a4ce866b57..4900bc611b 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineExtensionHandlerInstanceView.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineExtensionHandlerInstanceView.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* The instance view of a virtual machine extension handler.
*
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineExtensionInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineExtensionInstanceView.js
index cdd03e40d8..5e49fb98fa 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineExtensionInstanceView.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineExtensionInstanceView.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* The instance view of a virtual machine extension.
*
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineExtensionsListResult.js b/lib/services/computeManagement2/lib/models/virtualMachineExtensionsListResult.js
index f3d08ea382..f405c3d0f6 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineExtensionsListResult.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineExtensionsListResult.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* The List Extension operation response
*
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineHealthStatus.js b/lib/services/computeManagement2/lib/models/virtualMachineHealthStatus.js
index 0ccd89fedd..8a4fe2090e 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineHealthStatus.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineHealthStatus.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* The health status of the VM.
*
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineIdentity.js b/lib/services/computeManagement2/lib/models/virtualMachineIdentity.js
index 741dcde48e..bc329d687a 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineIdentity.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineIdentity.js
@@ -29,10 +29,10 @@ class VirtualMachineIdentity {
* will remove any identities from the virtual machine. Possible values
* include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned',
* 'None'
- * @member {array} [identityIds] The list of user identities associated with
- * the Virtual Machine. The user identity references will be ARM resource ids
- * in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
+ * @member {object} [userAssignedIdentities] The list of user identities
+ * associated with the Virtual Machine. The user identity dictionary key
+ * references will be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
*/
constructor() {
}
@@ -75,16 +75,17 @@ class VirtualMachineIdentity {
allowedValues: [ 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' ]
}
},
- identityIds: {
+ userAssignedIdentities: {
required: false,
- serializedName: 'identityIds',
+ serializedName: 'userAssignedIdentities',
type: {
- name: 'Sequence',
- element: {
+ name: 'Dictionary',
+ value: {
required: false,
- serializedName: 'StringElementType',
+ serializedName: 'VirtualMachineIdentityUserAssignedIdentitiesValueElementType',
type: {
- name: 'String'
+ name: 'Composite',
+ className: 'VirtualMachineIdentityUserAssignedIdentitiesValue'
}
}
}
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineIdentityUserAssignedIdentitiesValue.js b/lib/services/computeManagement2/lib/models/virtualMachineIdentityUserAssignedIdentitiesValue.js
new file mode 100644
index 0000000000..09033f5b29
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/virtualMachineIdentityUserAssignedIdentitiesValue.js
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * Class representing a VirtualMachineIdentityUserAssignedIdentitiesValue.
+ */
+class VirtualMachineIdentityUserAssignedIdentitiesValue {
+ /**
+ * Create a VirtualMachineIdentityUserAssignedIdentitiesValue.
+ * @member {string} [principalId] The principal id of user assigned identity.
+ * @member {string} [clientId] The client id of user assigned identity.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of VirtualMachineIdentityUserAssignedIdentitiesValue
+ *
+ * @returns {object} metadata of VirtualMachineIdentityUserAssignedIdentitiesValue
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'VirtualMachineIdentity_userAssignedIdentitiesValue',
+ type: {
+ name: 'Composite',
+ className: 'VirtualMachineIdentityUserAssignedIdentitiesValue',
+ modelProperties: {
+ principalId: {
+ required: false,
+ readOnly: true,
+ serializedName: 'principalId',
+ type: {
+ name: 'String'
+ }
+ },
+ clientId: {
+ required: false,
+ readOnly: true,
+ serializedName: 'clientId',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = VirtualMachineIdentityUserAssignedIdentitiesValue;
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineInstanceView.js
index aa4805f496..0092fc874e 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineInstanceView.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineInstanceView.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* The instance view of a virtual machine.
*
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js
index 58136094b6..fea0ed48e7 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js
@@ -79,6 +79,11 @@ class VirtualMachineScaleSet extends models['Resource'] {
* @member {boolean} [upgradePolicy.automaticOSUpgrade] Whether OS upgrades
* should automatically be applied to scale set instances in a rolling
* fashion when a newer version of the image becomes available.
+ * @member {object} [upgradePolicy.autoOSUpgradePolicy] Configuration
+ * parameters used for performing automatic OS Upgrade.
+ * @member {boolean} [upgradePolicy.autoOSUpgradePolicy.disableAutoRollback]
+ * Whether OS image rollback feature should be disabled. Default value is
+ * false.
* @member {object} [virtualMachineProfile] The virtual machine profile.
* @member {object} [virtualMachineProfile.osProfile] Specifies the operating
* system settings for the virtual machines in the scale set.
@@ -165,6 +170,13 @@ class VirtualMachineScaleSet extends models['Resource'] {
* @member {array}
* [virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] The
* list of SSH public keys used to authenticate with linux based VMs.
+ * @member {boolean}
+ * [virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent]
+ * Indicates whether virtual machine agent should be provisioned on the
+ * virtual machine.
When this property is not specified in the
+ * request body, default behavior is to set it to true. This will ensure
+ * that VM Agent is installed on the VM so that extensions can be added to
+ * the VM later.
* @member {array} [virtualMachineProfile.osProfile.secrets] Specifies set of
* certificates that should be installed onto the virtual machines in the
* scale set.
@@ -217,6 +229,10 @@ class VirtualMachineScaleSet extends models['Resource'] {
* image, you also use the imageReference element described above. If you are
* using a marketplace image, you also use the plan element previously
* described. Possible values include: 'FromImage', 'Empty', 'Attach'
+ * @member {number} [virtualMachineProfile.storageProfile.osDisk.diskSizeGB]
+ * Specifies the size of the operating system disk in gigabytes. This element
+ * can be used to overwrite the size of the disk in a virtual machine image.
+ *
This value cannot be larger than 1023 GB
* @member {string} [virtualMachineProfile.storageProfile.osDisk.osType] This
* property allows you to specify the type of the OS that is included in the
* disk if creating a VM from user-image or a specialized VHD.
@@ -236,8 +252,8 @@ class VirtualMachineScaleSet extends models['Resource'] {
* @member {string}
* [virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [virtualMachineProfile.storageProfile.dataDisks] Specifies
* the parameters that are used to add data disks to the virtual machines in
* the scale set.
For more information about disks, see [About disks
@@ -291,6 +307,10 @@ class VirtualMachineScaleSet extends models['Resource'] {
* @member {string} [virtualMachineProfile.priority] Specifies the priority
* for the virtual machines in the scale set.
Minimum api-version:
* 2017-10-30-preview. Possible values include: 'Regular', 'Low'
+ * @member {string} [virtualMachineProfile.evictionPolicy] Specifies the
+ * eviction policy for virtual machines in a low priority scale set.
+ *
Minimum api-version: 2017-10-30-preview. Possible values include:
+ * 'Deallocate', 'Delete'
* @member {string} [provisioningState] The provisioning state, which only
* appears in the response.
* @member {boolean} [overprovision] Specifies whether the Virtual Machine
@@ -317,10 +337,10 @@ class VirtualMachineScaleSet extends models['Resource'] {
* type 'None' will remove any identities from the virtual machine scale set.
* Possible values include: 'SystemAssigned', 'UserAssigned',
* 'SystemAssigned, UserAssigned', 'None'
- * @member {array} [identity.identityIds] The list of user identities
- * associated with the virtual machine scale set. The user identity
- * references will be ARM resource ids in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
+ * @member {object} [identity.userAssignedIdentities] The list of user
+ * identities associated with the virtual machine scale set. The user
+ * identity dictionary key references will be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
* @member {array} [zones] The virtual machine scale set zones.
*/
constructor() {
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetDataDisk.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetDataDisk.js
index 764ded8a19..0ed7bb5261 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetDataDisk.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetDataDisk.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a virtual machine scale set data disk.
*
@@ -33,12 +31,13 @@ class VirtualMachineScaleSetDataDisk {
* @member {string} createOption The create option. Possible values include:
* 'FromImage', 'Empty', 'Attach'
* @member {number} [diskSizeGB] Specifies the size of an empty data disk in
- * gigabytes. This element can be used to overwrite the name of the disk in a
+ * gigabytes. This element can be used to overwrite the size of the disk in a
* virtual machine image.
This value cannot be larger than 1023 GB
* @member {object} [managedDisk] The managed disk parameters.
* @member {string} [managedDisk.storageAccountType] Specifies the storage
- * account type for the managed disk. Possible values are: Standard_LRS or
- * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * account type for the managed disk. Possible values are: Standard_LRS,
+ * Premium_LRS, and StandardSSD_LRS. Possible values include: 'Standard_LRS',
+ * 'Premium_LRS', 'StandardSSD_LRS'
*/
constructor() {
}
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtensionProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtensionProfile.js
index fa2d107f7e..d27660bf3a 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtensionProfile.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetExtensionProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a virtual machine scale set extension profile.
*
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIPConfiguration.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIPConfiguration.js
index acba9a2b2c..35be769b56 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIPConfiguration.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIPConfiguration.js
@@ -38,6 +38,12 @@ class VirtualMachineScaleSetIPConfiguration extends models['SubResource'] {
* [publicIPAddressConfiguration.dnsSettings.domainNameLabel] The Domain name
* label.The concatenation of the domain name label and vm index will be the
* domain name labels of the PublicIPAddress resources that will be created
+ * @member {array} [publicIPAddressConfiguration.ipTags] The list of IP tags
+ * associated with the public IP address.
+ * @member {object} [publicIPAddressConfiguration.publicIPPrefix] The
+ * PublicIPPrefix from which to allocate publicIP addresses.
+ * @member {string} [publicIPAddressConfiguration.publicIPPrefix.id] Resource
+ * Id
* @member {string} [privateIPAddressVersion] Available from Api-Version
* 2017-03-30 onwards, it represents whether the specific ipconfiguration is
* IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and
@@ -46,6 +52,8 @@ class VirtualMachineScaleSetIPConfiguration extends models['SubResource'] {
* of references to backend address pools of application gateways. A scale
* set can reference backend address pools of multiple application gateways.
* Multiple scale sets cannot use the same application gateway.
+ * @member {array} [applicationSecurityGroups] Specifies an array of
+ * references to application security group.
* @member {array} [loadBalancerBackendAddressPools] Specifies an array of
* references to backend address pools of load balancers. A scale set can
* reference backend address pools of one public and one internal load
@@ -132,6 +140,21 @@ class VirtualMachineScaleSetIPConfiguration extends models['SubResource'] {
}
}
},
+ applicationSecurityGroups: {
+ required: false,
+ serializedName: 'properties.applicationSecurityGroups',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'SubResourceElementType',
+ type: {
+ name: 'Composite',
+ className: 'SubResource'
+ }
+ }
+ }
+ },
loadBalancerBackendAddressPools: {
required: false,
serializedName: 'properties.loadBalancerBackendAddressPools',
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentity.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentity.js
index c820acdcf9..c57257efe5 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentity.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentity.js
@@ -29,10 +29,10 @@ class VirtualMachineScaleSetIdentity {
* type 'None' will remove any identities from the virtual machine scale set.
* Possible values include: 'SystemAssigned', 'UserAssigned',
* 'SystemAssigned, UserAssigned', 'None'
- * @member {array} [identityIds] The list of user identities associated with
- * the virtual machine scale set. The user identity references will be ARM
- * resource ids in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
+ * @member {object} [userAssignedIdentities] The list of user identities
+ * associated with the virtual machine scale set. The user identity
+ * dictionary key references will be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
*/
constructor() {
}
@@ -75,16 +75,17 @@ class VirtualMachineScaleSetIdentity {
allowedValues: [ 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' ]
}
},
- identityIds: {
+ userAssignedIdentities: {
required: false,
- serializedName: 'identityIds',
+ serializedName: 'userAssignedIdentities',
type: {
- name: 'Sequence',
- element: {
+ name: 'Dictionary',
+ value: {
required: false,
- serializedName: 'StringElementType',
+ serializedName: 'VirtualMachineScaleSetIdentityUserAssignedIdentitiesValueElementType',
type: {
- name: 'String'
+ name: 'Composite',
+ className: 'VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue'
}
}
}
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentityUserAssignedIdentitiesValue.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentityUserAssignedIdentitiesValue.js
new file mode 100644
index 0000000000..0752bf5253
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIdentityUserAssignedIdentitiesValue.js
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * Class representing a VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue.
+ */
+class VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue {
+ /**
+ * Create a VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue.
+ * @member {string} [principalId] The principal id of user assigned identity.
+ * @member {string} [clientId] The client id of user assigned identity.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue
+ *
+ * @returns {object} metadata of VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'VirtualMachineScaleSetIdentity_userAssignedIdentitiesValue',
+ type: {
+ name: 'Composite',
+ className: 'VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue',
+ modelProperties: {
+ principalId: {
+ required: false,
+ readOnly: true,
+ serializedName: 'principalId',
+ type: {
+ name: 'String'
+ }
+ },
+ clientId: {
+ required: false,
+ readOnly: true,
+ serializedName: 'clientId',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue;
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceView.js
index b1ef6a6a1f..9229eec790 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceView.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceView.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* The instance view of a virtual machine scale set.
*
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js
index c5755dfc84..c852cb303e 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetInstanceViewStatusesSummary.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Instance view statuses summary for virtual machines of a virtual machine
* scale set.
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIpTag.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIpTag.js
new file mode 100644
index 0000000000..f133b20ed3
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetIpTag.js
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * Contains the IP tag associated with the public IP address.
+ *
+ */
+class VirtualMachineScaleSetIpTag {
+ /**
+ * Create a VirtualMachineScaleSetIpTag.
+ * @member {string} [ipTagType] IP tag type. Example: FirstPartyUsage.
+ * @member {string} [tag] IP tag associated with the public IP. Example: SQL,
+ * Storage etc.
+ */
+ constructor() {
+ }
+
+ /**
+ * Defines the metadata of VirtualMachineScaleSetIpTag
+ *
+ * @returns {object} metadata of VirtualMachineScaleSetIpTag
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'VirtualMachineScaleSetIpTag',
+ type: {
+ name: 'Composite',
+ className: 'VirtualMachineScaleSetIpTag',
+ modelProperties: {
+ ipTagType: {
+ required: false,
+ serializedName: 'ipTagType',
+ type: {
+ name: 'String'
+ }
+ },
+ tag: {
+ required: false,
+ serializedName: 'tag',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = VirtualMachineScaleSetIpTag;
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListOSUpgradeHistory.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListOSUpgradeHistory.js
new file mode 100644
index 0000000000..67be7c8893
--- /dev/null
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetListOSUpgradeHistory.js
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+/**
+ * List of Virtual Machine Scale Set OS Upgrade History operation response.
+ */
+class VirtualMachineScaleSetListOSUpgradeHistory extends Array {
+ /**
+ * Create a VirtualMachineScaleSetListOSUpgradeHistory.
+ * @member {string} [nextLink] The uri to fetch the next page of OS Upgrade
+ * History. Call ListNext() with this to fetch the next page of history of
+ * upgrades.
+ */
+ constructor() {
+ super();
+ }
+
+ /**
+ * Defines the metadata of VirtualMachineScaleSetListOSUpgradeHistory
+ *
+ * @returns {object} metadata of VirtualMachineScaleSetListOSUpgradeHistory
+ *
+ */
+ mapper() {
+ return {
+ required: false,
+ serializedName: 'VirtualMachineScaleSetListOSUpgradeHistory',
+ type: {
+ name: 'Composite',
+ className: 'VirtualMachineScaleSetListOSUpgradeHistory',
+ modelProperties: {
+ value: {
+ required: true,
+ serializedName: '',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'UpgradeOperationHistoricalStatusInfoElementType',
+ type: {
+ name: 'Composite',
+ className: 'UpgradeOperationHistoricalStatusInfo'
+ }
+ }
+ }
+ },
+ nextLink: {
+ required: false,
+ serializedName: 'nextLink',
+ type: {
+ name: 'String'
+ }
+ }
+ }
+ }
+ };
+ }
+}
+
+module.exports = VirtualMachineScaleSetListOSUpgradeHistory;
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetManagedDiskParameters.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetManagedDiskParameters.js
index a11dae5d33..aeb0c452f0 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetManagedDiskParameters.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetManagedDiskParameters.js
@@ -18,8 +18,9 @@ class VirtualMachineScaleSetManagedDiskParameters {
/**
* Create a VirtualMachineScaleSetManagedDiskParameters.
* @member {string} [storageAccountType] Specifies the storage account type
- * for the managed disk. Possible values are: Standard_LRS or Premium_LRS.
- * Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * for the managed disk. Possible values are: Standard_LRS, Premium_LRS, and
+ * StandardSSD_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS',
+ * 'StandardSSD_LRS'
*/
constructor() {
}
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkProfile.js
index f3b8e80b4e..6b069ffceb 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkProfile.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetNetworkProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a virtual machine scale set network profile.
*
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js
index 737b7c9db1..f72c6c0bb8 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a virtual machine scale set operating system disk.
*
@@ -34,6 +32,10 @@ class VirtualMachineScaleSetOSDisk {
* use the imageReference element described above. If you are using a
* marketplace image, you also use the plan element previously described.
* Possible values include: 'FromImage', 'Empty', 'Attach'
+ * @member {number} [diskSizeGB] Specifies the size of the operating system
+ * disk in gigabytes. This element can be used to overwrite the size of the
+ * disk in a virtual machine image.
This value cannot be larger than
+ * 1023 GB
* @member {string} [osType] This property allows you to specify the type of
* the OS that is included in the disk if creating a VM from user-image or a
* specialized VHD.
Possible values are:
**Windows**
@@ -45,8 +47,9 @@ class VirtualMachineScaleSetOSDisk {
* to store operating system disks for the scale set.
* @member {object} [managedDisk] The managed disk parameters.
* @member {string} [managedDisk.storageAccountType] Specifies the storage
- * account type for the managed disk. Possible values are: Standard_LRS or
- * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * account type for the managed disk. Possible values are: Standard_LRS,
+ * Premium_LRS, and StandardSSD_LRS. Possible values include: 'Standard_LRS',
+ * 'Premium_LRS', 'StandardSSD_LRS'
*/
constructor() {
}
@@ -94,6 +97,13 @@ class VirtualMachineScaleSetOSDisk {
name: 'String'
}
},
+ diskSizeGB: {
+ required: false,
+ serializedName: 'diskSizeGB',
+ type: {
+ name: 'Number'
+ }
+ },
osType: {
required: false,
serializedName: 'osType',
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSProfile.js
index 83622b758e..5520c6f135 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSProfile.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a virtual machine scale set OS profile.
*
@@ -88,6 +86,11 @@ class VirtualMachineScaleSetOSProfile {
* configuration for a Linux OS.
* @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public
* keys used to authenticate with linux based VMs.
+ * @member {boolean} [linuxConfiguration.provisionVMAgent] Indicates whether
+ * virtual machine agent should be provisioned on the virtual machine.
+ *
When this property is not specified in the request body, default
+ * behavior is to set it to true. This will ensure that VM Agent is
+ * installed on the VM so that extensions can be added to the VM later.
* @member {array} [secrets] Specifies set of certificates that should be
* installed onto the virtual machines in the scale set.
*/
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetPublicIPAddressConfiguration.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetPublicIPAddressConfiguration.js
index 7b99a1abf7..d46e68fd16 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetPublicIPAddressConfiguration.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetPublicIPAddressConfiguration.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a virtual machines scale set IP Configuration's PublicIPAddress
* configuration
@@ -28,6 +26,11 @@ class VirtualMachineScaleSetPublicIPAddressConfiguration {
* @member {string} [dnsSettings.domainNameLabel] The Domain name label.The
* concatenation of the domain name label and vm index will be the domain
* name labels of the PublicIPAddress resources that will be created
+ * @member {array} [ipTags] The list of IP tags associated with the public IP
+ * address.
+ * @member {object} [publicIPPrefix] The PublicIPPrefix from which to
+ * allocate publicIP addresses.
+ * @member {string} [publicIPPrefix.id] Resource Id
*/
constructor() {
}
@@ -67,6 +70,29 @@ class VirtualMachineScaleSetPublicIPAddressConfiguration {
name: 'Composite',
className: 'VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings'
}
+ },
+ ipTags: {
+ required: false,
+ serializedName: 'properties.ipTags',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'VirtualMachineScaleSetIpTagElementType',
+ type: {
+ name: 'Composite',
+ className: 'VirtualMachineScaleSetIpTag'
+ }
+ }
+ }
+ },
+ publicIPPrefix: {
+ required: false,
+ serializedName: 'properties.publicIPPrefix',
+ type: {
+ name: 'Composite',
+ className: 'SubResource'
+ }
}
}
}
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSku.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSku.js
index 6fe583507e..9f9719323c 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSku.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetSku.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes an available virtual machine scale set sku.
*
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js
index b8ab9a175b..4c0b81de04 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a virtual machine scale set storage profile.
*
@@ -54,6 +52,10 @@ class VirtualMachineScaleSetStorageProfile {
* use the imageReference element described above. If you are using a
* marketplace image, you also use the plan element previously described.
* Possible values include: 'FromImage', 'Empty', 'Attach'
+ * @member {number} [osDisk.diskSizeGB] Specifies the size of the operating
+ * system disk in gigabytes. This element can be used to overwrite the size
+ * of the disk in a virtual machine image.
This value cannot be
+ * larger than 1023 GB
* @member {string} [osDisk.osType] This property allows you to specify the
* type of the OS that is included in the disk if creating a VM from
* user-image or a specialized VHD.
Possible values are:
@@ -67,8 +69,8 @@ class VirtualMachineScaleSetStorageProfile {
* @member {object} [osDisk.managedDisk] The managed disk parameters.
* @member {string} [osDisk.managedDisk.storageAccountType] Specifies the
* storage account type for the managed disk. Possible values are:
- * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values include:
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [dataDisks] Specifies the parameters that are used to add
* data disks to the virtual machines in the scale set.
For more
* information about disks, see [About disks and VHDs for Azure virtual
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdate.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdate.js
index 693917b226..c43ab504ac 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdate.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdate.js
@@ -74,6 +74,11 @@ class VirtualMachineScaleSetUpdate extends models['UpdateResource'] {
* @member {boolean} [upgradePolicy.automaticOSUpgrade] Whether OS upgrades
* should automatically be applied to scale set instances in a rolling
* fashion when a newer version of the image becomes available.
+ * @member {object} [upgradePolicy.autoOSUpgradePolicy] Configuration
+ * parameters used for performing automatic OS Upgrade.
+ * @member {boolean} [upgradePolicy.autoOSUpgradePolicy.disableAutoRollback]
+ * Whether OS image rollback feature should be disabled. Default value is
+ * false.
* @member {object} [virtualMachineProfile] The virtual machine profile.
* @member {object} [virtualMachineProfile.osProfile] The virtual machine
* scale set OS profile.
@@ -115,6 +120,13 @@ class VirtualMachineScaleSetUpdate extends models['UpdateResource'] {
* @member {array}
* [virtualMachineProfile.osProfile.linuxConfiguration.ssh.publicKeys] The
* list of SSH public keys used to authenticate with linux based VMs.
+ * @member {boolean}
+ * [virtualMachineProfile.osProfile.linuxConfiguration.provisionVMAgent]
+ * Indicates whether virtual machine agent should be provisioned on the
+ * virtual machine.
When this property is not specified in the
+ * request body, default behavior is to set it to true. This will ensure
+ * that VM Agent is installed on the VM so that extensions can be added to
+ * the VM later.
* @member {array} [virtualMachineProfile.osProfile.secrets] The List of
* certificates for addition to the VM.
* @member {object} [virtualMachineProfile.storageProfile] The virtual
@@ -146,6 +158,10 @@ class VirtualMachineScaleSetUpdate extends models['UpdateResource'] {
* [virtualMachineProfile.storageProfile.osDisk.writeAcceleratorEnabled]
* Specifies whether writeAccelerator should be enabled or disabled on the
* disk.
+ * @member {number} [virtualMachineProfile.storageProfile.osDisk.diskSizeGB]
+ * Specifies the size of the operating system disk in gigabytes. This element
+ * can be used to overwrite the size of the disk in a virtual machine image.
+ *
This value cannot be larger than 1023 GB
* @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
@@ -160,8 +176,8 @@ class VirtualMachineScaleSetUpdate extends models['UpdateResource'] {
* @member {string}
* [virtualMachineProfile.storageProfile.osDisk.managedDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [virtualMachineProfile.storageProfile.dataDisks] The data
* disks.
* @member {object} [virtualMachineProfile.networkProfile] The virtual
@@ -209,10 +225,10 @@ class VirtualMachineScaleSetUpdate extends models['UpdateResource'] {
* type 'None' will remove any identities from the virtual machine scale set.
* Possible values include: 'SystemAssigned', 'UserAssigned',
* 'SystemAssigned, UserAssigned', 'None'
- * @member {array} [identity.identityIds] The list of user identities
- * associated with the virtual machine scale set. The user identity
- * references will be ARM resource ids in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
+ * @member {object} [identity.userAssignedIdentities] The list of user
+ * identities associated with the virtual machine scale set. The user
+ * identity dictionary key references will be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
*/
constructor() {
super();
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateIPConfiguration.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateIPConfiguration.js
index 861de94e23..602dae90fc 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateIPConfiguration.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateIPConfiguration.js
@@ -44,6 +44,8 @@ class VirtualMachineScaleSetUpdateIPConfiguration extends models['SubResource']
* 'IPv6'. Possible values include: 'IPv4', 'IPv6'
* @member {array} [applicationGatewayBackendAddressPools] The application
* gateway backend address pools.
+ * @member {array} [applicationSecurityGroups] Specifies an array of
+ * references to application security group.
* @member {array} [loadBalancerBackendAddressPools] The load balancer
* backend address pools.
* @member {array} [loadBalancerInboundNatPools] The load balancer inbound
@@ -126,6 +128,21 @@ class VirtualMachineScaleSetUpdateIPConfiguration extends models['SubResource']
}
}
},
+ applicationSecurityGroups: {
+ required: false,
+ serializedName: 'properties.applicationSecurityGroups',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'SubResourceElementType',
+ type: {
+ name: 'Composite',
+ className: 'SubResource'
+ }
+ }
+ }
+ },
loadBalancerBackendAddressPools: {
required: false,
serializedName: 'properties.loadBalancerBackendAddressPools',
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateNetworkProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateNetworkProfile.js
index 9b4153b3ab..cddb45cbfe 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateNetworkProfile.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateNetworkProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a virtual machine scale set network profile.
*
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSDisk.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSDisk.js
index 3ef0f2ea89..7302df893f 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSDisk.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSDisk.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes virtual machine scale set operating system disk Update Object.
* This should be used for Updating VMSS OS Disk.
@@ -24,6 +22,10 @@ class VirtualMachineScaleSetUpdateOSDisk {
* 'None', 'ReadOnly', 'ReadWrite'
* @member {boolean} [writeAcceleratorEnabled] Specifies whether
* writeAccelerator should be enabled or disabled on the disk.
+ * @member {number} [diskSizeGB] Specifies the size of the operating system
+ * disk in gigabytes. This element can be used to overwrite the size of the
+ * disk in a virtual machine image.
This value cannot be larger than
+ * 1023 GB
* @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
@@ -33,8 +35,9 @@ class VirtualMachineScaleSetUpdateOSDisk {
* uris.
* @member {object} [managedDisk] The managed disk parameters.
* @member {string} [managedDisk.storageAccountType] Specifies the storage
- * account type for the managed disk. Possible values are: Standard_LRS or
- * Premium_LRS. Possible values include: 'Standard_LRS', 'Premium_LRS'
+ * account type for the managed disk. Possible values are: Standard_LRS,
+ * Premium_LRS, and StandardSSD_LRS. Possible values include: 'Standard_LRS',
+ * 'Premium_LRS', 'StandardSSD_LRS'
*/
constructor() {
}
@@ -68,6 +71,13 @@ class VirtualMachineScaleSetUpdateOSDisk {
name: 'Boolean'
}
},
+ diskSizeGB: {
+ required: false,
+ serializedName: 'diskSizeGB',
+ type: {
+ name: 'Number'
+ }
+ },
image: {
required: false,
serializedName: 'image',
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSProfile.js
index 54fbf6cd9d..90c31f219f 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSProfile.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateOSProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a virtual machine scale set OS profile.
*
@@ -46,6 +44,11 @@ class VirtualMachineScaleSetUpdateOSProfile {
* configuration for a Linux OS.
* @member {array} [linuxConfiguration.ssh.publicKeys] The list of SSH public
* keys used to authenticate with linux based VMs.
+ * @member {boolean} [linuxConfiguration.provisionVMAgent] Indicates whether
+ * virtual machine agent should be provisioned on the virtual machine.
+ *
When this property is not specified in the request body, default
+ * behavior is to set it to true. This will ensure that VM Agent is
+ * installed on the VM so that extensions can be added to the VM later.
* @member {array} [secrets] The List of certificates for addition to the VM.
*/
constructor() {
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdatePublicIPAddressConfiguration.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdatePublicIPAddressConfiguration.js
index 66c86376cc..840a0afbf0 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdatePublicIPAddressConfiguration.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdatePublicIPAddressConfiguration.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a virtual machines scale set IP Configuration's PublicIPAddress
* configuration
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateStorageProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateStorageProfile.js
index 4d51b93ded..11055e0402 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateStorageProfile.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateStorageProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a virtual machine scale set storage profile.
*
@@ -36,6 +34,10 @@ class VirtualMachineScaleSetUpdateStorageProfile {
* include: 'None', 'ReadOnly', 'ReadWrite'
* @member {boolean} [osDisk.writeAcceleratorEnabled] Specifies whether
* writeAccelerator should be enabled or disabled on the disk.
+ * @member {number} [osDisk.diskSizeGB] Specifies the size of the operating
+ * system disk in gigabytes. This element can be used to overwrite the size
+ * of the disk in a virtual machine image.
This value cannot be
+ * larger than 1023 GB
* @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
@@ -46,8 +48,8 @@ class VirtualMachineScaleSetUpdateStorageProfile {
* @member {object} [osDisk.managedDisk] The managed disk parameters.
* @member {string} [osDisk.managedDisk.storageAccountType] Specifies the
* storage account type for the managed disk. Possible values are:
- * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values include:
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [dataDisks] The data disks.
*/
constructor() {
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateVMProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateVMProfile.js
index 4f8962feef..0626b85606 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateVMProfile.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetUpdateVMProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a virtual machine scale set virtual machine profile.
*
@@ -51,6 +49,12 @@ class VirtualMachineScaleSetUpdateVMProfile {
* configuration for a Linux OS.
* @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of
* SSH public keys used to authenticate with linux based VMs.
+ * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent]
+ * Indicates whether virtual machine agent should be provisioned on the
+ * virtual machine.
When this property is not specified in the
+ * request body, default behavior is to set it to true. This will ensure
+ * that VM Agent is installed on the VM so that extensions can be added to
+ * the VM later.
* @member {array} [osProfile.secrets] The List of certificates for addition
* to the VM.
* @member {object} [storageProfile] The virtual machine scale set storage
@@ -75,6 +79,10 @@ class VirtualMachineScaleSetUpdateVMProfile {
* @member {boolean} [storageProfile.osDisk.writeAcceleratorEnabled]
* Specifies whether writeAccelerator should be enabled or disabled on the
* disk.
+ * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of
+ * the operating system disk in gigabytes. This element can be used to
+ * overwrite the size of the disk in a virtual machine image.
This
+ * value cannot be larger than 1023 GB
* @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
@@ -87,8 +95,8 @@ class VirtualMachineScaleSetUpdateVMProfile {
* parameters.
* @member {string} [storageProfile.osDisk.managedDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [storageProfile.dataDisks] The data disks.
* @member {object} [networkProfile] The virtual machine scale set network
* profile.
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js
index 7b9e19dea1..ce0b9c63f4 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js
@@ -32,16 +32,10 @@ class VirtualMachineScaleSetVM extends models['Resource'] {
* has been applied to the virtual machine.
* @member {string} [vmId] Azure VM unique ID.
* @member {object} [instanceView] The virtual machine instance view.
- * @member {number} [instanceView.platformUpdateDomain] Specifies the update
- * domain of the virtual machine.
- * @member {number} [instanceView.platformFaultDomain] Specifies the fault
- * domain of the virtual machine.
- * @member {string} [instanceView.computerName] The computer name assigned to
- * the virtual machine.
- * @member {string} [instanceView.osName] The Operating System running on the
- * virtual machine.
- * @member {string} [instanceView.osVersion] The version of Operating System
- * running on the virtual machine.
+ * @member {number} [instanceView.platformUpdateDomain] The Update Domain
+ * count.
+ * @member {number} [instanceView.platformFaultDomain] The Fault Domain
+ * count.
* @member {string} [instanceView.rdpThumbPrint] The Remote desktop
* certificate thumbprint.
* @member {object} [instanceView.vmAgent] The VM Agent running on the
@@ -76,8 +70,19 @@ class VirtualMachineScaleSetVM extends models['Resource'] {
* @member {string}
* [instanceView.maintenanceRedeployStatus.lastOperationMessage] Message
* returned for the last Maintenance Operation.
- * @member {array} [instanceView.disks] The virtual machine disk information.
+ * @member {array} [instanceView.disks] The disks information.
* @member {array} [instanceView.extensions] The extensions information.
+ * @member {object} [instanceView.vmHealth] The health status for the VM.
+ * @member {object} [instanceView.vmHealth.status] The health status
+ * information for the VM.
+ * @member {string} [instanceView.vmHealth.status.code] The status code.
+ * @member {string} [instanceView.vmHealth.status.level] The level code.
+ * Possible values include: 'Info', 'Warning', 'Error'
+ * @member {string} [instanceView.vmHealth.status.displayStatus] The short
+ * localizable label for the status.
+ * @member {string} [instanceView.vmHealth.status.message] The detailed
+ * status message, including for alerts and error messages.
+ * @member {date} [instanceView.vmHealth.status.time] The time of the status.
* @member {object} [instanceView.bootDiagnostics] Boot Diagnostics is a
* debugging feature which allows you to view Console Output and Screenshot
* to diagnose VM status.
For Linux Virtual Machines, you can easily
@@ -89,6 +94,9 @@ class VirtualMachineScaleSetVM extends models['Resource'] {
* @member {string} [instanceView.bootDiagnostics.serialConsoleLogBlobUri]
* The Linux serial console log blob Uri.
* @member {array} [instanceView.statuses] The resource status information.
+ * @member {string} [instanceView.placementGroupId] The placement group in
+ * which the VM is running. If the VM is deallocated it will not have a
+ * placementGroupId.
* @member {object} [hardwareProfile] Specifies the hardware settings for the
* virtual machine.
* @member {string} [hardwareProfile.vmSize] Specifies the size of the
@@ -243,8 +251,8 @@ class VirtualMachineScaleSetVM extends models['Resource'] {
* parameters.
* @member {string} [storageProfile.osDisk.managedDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [storageProfile.dataDisks] Specifies the parameters that
* are used to add a data disk to a virtual machine.
For more
* information about disks, see [About disks and VHDs for Azure virtual
@@ -327,8 +335,18 @@ class VirtualMachineScaleSetVM extends models['Resource'] {
* configuration for a Linux OS.
* @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of
* SSH public keys used to authenticate with linux based VMs.
+ * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent]
+ * Indicates whether virtual machine agent should be provisioned on the
+ * virtual machine.
When this property is not specified in the
+ * request body, default behavior is to set it to true. This will ensure
+ * that VM Agent is installed on the VM so that extensions can be added to
+ * the VM later.
* @member {array} [osProfile.secrets] Specifies set of certificates that
* should be installed onto the virtual machine.
+ * @member {boolean} [osProfile.allowExtensionOperations] Specifies whether
+ * extension operations should be allowed on the virtual machine.
+ *
This may only be set to False when no extensions are present on
+ * the virtual machine.
* @member {object} [networkProfile] Specifies the network interfaces of the
* virtual machine.
* @member {array} [networkProfile.networkInterfaces] Specifies the list of
@@ -383,6 +401,7 @@ class VirtualMachineScaleSetVM extends models['Resource'] {
* element.
* @member {string} [plan.promotionCode] The promotion code.
* @member {array} [resources] The virtual machine child extension resources.
+ * @member {array} [zones] The virtual machine zones.
*/
constructor() {
super();
@@ -486,7 +505,7 @@ class VirtualMachineScaleSetVM extends models['Resource'] {
serializedName: 'properties.instanceView',
type: {
name: 'Composite',
- className: 'VirtualMachineInstanceView'
+ className: 'VirtualMachineScaleSetVMInstanceView'
}
},
hardwareProfile: {
@@ -575,6 +594,21 @@ class VirtualMachineScaleSetVM extends models['Resource'] {
}
}
}
+ },
+ zones: {
+ required: false,
+ readOnly: true,
+ serializedName: 'zones',
+ type: {
+ name: 'Sequence',
+ element: {
+ required: false,
+ serializedName: 'StringElementType',
+ type: {
+ name: 'String'
+ }
+ }
+ }
}
}
}
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMExtensionsSummary.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMExtensionsSummary.js
index ec86ebf39d..ddeedbc348 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMExtensionsSummary.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMExtensionsSummary.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Extensions summary for virtual machines of a virtual machine scale set.
*
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceView.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceView.js
index e408d869b7..2b34d4980f 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceView.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMInstanceView.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* The instance view of a virtual machine scale set VM.
*
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js
index 59d202754a..c701443c3f 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes a virtual machine scale set virtual machine profile.
*
@@ -94,6 +92,12 @@ class VirtualMachineScaleSetVMProfile {
* configuration for a Linux OS.
* @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of
* SSH public keys used to authenticate with linux based VMs.
+ * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent]
+ * Indicates whether virtual machine agent should be provisioned on the
+ * virtual machine.
When this property is not specified in the
+ * request body, default behavior is to set it to true. This will ensure
+ * that VM Agent is installed on the VM so that extensions can be added to
+ * the VM later.
* @member {array} [osProfile.secrets] Specifies set of certificates that
* should be installed onto the virtual machines in the scale set.
* @member {object} [storageProfile] Specifies the storage settings for the
@@ -137,6 +141,10 @@ class VirtualMachineScaleSetVMProfile {
* image, you also use the imageReference element described above. If you are
* using a marketplace image, you also use the plan element previously
* described. Possible values include: 'FromImage', 'Empty', 'Attach'
+ * @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of
+ * the operating system disk in gigabytes. This element can be used to
+ * overwrite the size of the disk in a virtual machine image.
This
+ * value cannot be larger than 1023 GB
* @member {string} [storageProfile.osDisk.osType] This property allows you
* to specify the type of the OS that is included in the disk if creating a
* VM from user-image or a specialized VHD.
Possible values are:
@@ -153,8 +161,8 @@ class VirtualMachineScaleSetVMProfile {
* parameters.
* @member {string} [storageProfile.osDisk.managedDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [storageProfile.dataDisks] Specifies the parameters that
* are used to add data disks to the virtual machines in the scale set.
*
For more information about disks, see [About disks and VHDs for
@@ -199,6 +207,9 @@ class VirtualMachineScaleSetVMProfile {
* @member {string} [priority] Specifies the priority for the virtual
* machines in the scale set.
Minimum api-version:
* 2017-10-30-preview. Possible values include: 'Regular', 'Low'
+ * @member {string} [evictionPolicy] Specifies the eviction policy for
+ * virtual machines in a low priority scale set.
Minimum api-version:
+ * 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete'
*/
constructor() {
}
@@ -270,6 +281,13 @@ class VirtualMachineScaleSetVMProfile {
type: {
name: 'String'
}
+ },
+ evictionPolicy: {
+ required: false,
+ serializedName: 'evictionPolicy',
+ type: {
+ name: 'String'
+ }
}
}
}
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineUpdate.js b/lib/services/computeManagement2/lib/models/virtualMachineUpdate.js
index bfc6f87c21..bdfe0816aa 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineUpdate.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineUpdate.js
@@ -13,7 +13,7 @@
const models = require('./index');
/**
- * Describes a Virtual Machine.
+ * Describes a Virtual Machine Update.
*
* @extends models['UpdateResource']
*/
@@ -187,8 +187,8 @@ class VirtualMachineUpdate extends models['UpdateResource'] {
* parameters.
* @member {string} [storageProfile.osDisk.managedDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
* @member {array} [storageProfile.dataDisks] Specifies the parameters that
* are used to add a data disk to a virtual machine.
For more
* information about disks, see [About disks and VHDs for Azure virtual
@@ -271,8 +271,18 @@ class VirtualMachineUpdate extends models['UpdateResource'] {
* configuration for a Linux OS.
* @member {array} [osProfile.linuxConfiguration.ssh.publicKeys] The list of
* SSH public keys used to authenticate with linux based VMs.
+ * @member {boolean} [osProfile.linuxConfiguration.provisionVMAgent]
+ * Indicates whether virtual machine agent should be provisioned on the
+ * virtual machine.
When this property is not specified in the
+ * request body, default behavior is to set it to true. This will ensure
+ * that VM Agent is installed on the VM so that extensions can be added to
+ * the VM later.
* @member {array} [osProfile.secrets] Specifies set of certificates that
* should be installed onto the virtual machine.
+ * @member {boolean} [osProfile.allowExtensionOperations] Specifies whether
+ * extension operations should be allowed on the virtual machine.
+ *
This may only be set to False when no extensions are present on
+ * the virtual machine.
* @member {object} [networkProfile] Specifies the network interfaces of the
* virtual machine.
* @member {array} [networkProfile.networkInterfaces] Specifies the list of
@@ -388,10 +398,10 @@ class VirtualMachineUpdate extends models['UpdateResource'] {
* type 'None' will remove any identities from the virtual machine. Possible
* values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned,
* UserAssigned', 'None'
- * @member {array} [identity.identityIds] The list of user identities
- * associated with the Virtual Machine. The user identity references will be
- * ARM resource ids in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
+ * @member {object} [identity.userAssignedIdentities] The list of user
+ * identities associated with the Virtual Machine. The user identity
+ * dictionary key references will be ARM resource ids in the form:
+ * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
* @member {array} [zones] The virtual machine zones.
*/
constructor() {
diff --git a/lib/services/computeManagement2/lib/models/winRMConfiguration.js b/lib/services/computeManagement2/lib/models/winRMConfiguration.js
index 0ce512bfb7..a3f2d1ba8d 100644
--- a/lib/services/computeManagement2/lib/models/winRMConfiguration.js
+++ b/lib/services/computeManagement2/lib/models/winRMConfiguration.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Describes Windows Remote Management configuration of the VM
*
diff --git a/lib/services/computeManagement2/lib/models/windowsConfiguration.js b/lib/services/computeManagement2/lib/models/windowsConfiguration.js
index c3cf889c8d..5d2cb0544a 100644
--- a/lib/services/computeManagement2/lib/models/windowsConfiguration.js
+++ b/lib/services/computeManagement2/lib/models/windowsConfiguration.js
@@ -10,8 +10,6 @@
'use strict';
-const models = require('./index');
-
/**
* Specifies Windows operating system settings on the virtual machine.
*
diff --git a/lib/services/computeManagement2/lib/operations/availabilitySets.js b/lib/services/computeManagement2/lib/operations/availabilitySets.js
index 292da5c63a..af9d53c1b8 100644
--- a/lib/services/computeManagement2/lib/operations/availabilitySets.js
+++ b/lib/services/computeManagement2/lib/operations/availabilitySets.js
@@ -74,7 +74,7 @@ function _createOrUpdate(resourceGroupName, availabilitySetName, parameters, opt
if (!callback) {
throw new Error('callback cannot be null.');
}
- let apiVersion = '2017-12-01';
+ let apiVersion = '2018-06-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
@@ -257,7 +257,7 @@ function _update(resourceGroupName, availabilitySetName, parameters, options, ca
if (!callback) {
throw new Error('callback cannot be null.');
}
- let apiVersion = '2017-12-01';
+ let apiVersion = '2018-06-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
@@ -400,9 +400,7 @@ function _update(resourceGroupName, availabilitySetName, parameters, options, ca
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
- * {object} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
@@ -418,7 +416,7 @@ function _deleteMethod(resourceGroupName, availabilitySetName, options, callback
if (!callback) {
throw new Error('callback cannot be null.');
}
- let apiVersion = '2017-12-01';
+ let apiVersion = '2018-06-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
@@ -504,6 +502,132 @@ function _deleteMethod(resourceGroupName, availabilitySetName, options, callback
// Create Result
let result = null;
if (responseBody === '') responseBody = null;
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Retrieves information about an availability set.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} availabilitySetName The name of the availability set.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link AvailabilitySet} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _get(resourceGroupName, availabilitySetName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (availabilitySetName === null || availabilitySetName === undefined || typeof availabilitySetName.valueOf() !== 'string') {
+ throw new Error('availabilitySetName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}';
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{availabilitySetName}', encodeURIComponent(availabilitySetName));
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
// Deserialize Response
if (statusCode === 200) {
let parsedResponse = null;
@@ -511,7 +635,7 @@ function _deleteMethod(resourceGroupName, availabilitySetName, options, callback
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
- let resultMapper = new client.models['OperationStatusResponse']().mapper();
+ let resultMapper = new client.models['AvailabilitySet']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
@@ -527,11 +651,141 @@ function _deleteMethod(resourceGroupName, availabilitySetName, options, callback
}
/**
- * Retrieves information about an availability set.
+ * Lists all availability sets in a subscription.
*
- * @param {string} resourceGroupName The name of the resource group.
+ * @param {object} [options] Optional Parameters.
*
- * @param {string} availabilitySetName The name of the availability set.
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link AvailabilitySetListResult} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _listBySubscription(options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['AvailabilitySetListResult']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Lists all availability sets in a resource group.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
*
* @param {object} [options] Optional Parameters.
*
@@ -545,13 +799,14 @@ function _deleteMethod(resourceGroupName, availabilitySetName, options, callback
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
- * See {@link AvailabilitySet} for more information.
+ * See {@link AvailabilitySetListResult} for more
+ * information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
-function _get(resourceGroupName, availabilitySetName, options, callback) {
+function _list(resourceGroupName, options, callback) {
/* jshint validthis: true */
let client = this.client;
if(!callback && typeof options === 'function') {
@@ -561,15 +816,12 @@ function _get(resourceGroupName, availabilitySetName, options, callback) {
if (!callback) {
throw new Error('callback cannot be null.');
}
- let apiVersion = '2017-12-01';
+ let apiVersion = '2018-06-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
}
- if (availabilitySetName === null || availabilitySetName === undefined || typeof availabilitySetName.valueOf() !== 'string') {
- throw new Error('availabilitySetName cannot be null or undefined and it must be of type string.');
- }
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
}
@@ -582,9 +834,8 @@ function _get(resourceGroupName, availabilitySetName, options, callback) {
// Construct URL
let baseUrl = this.client.baseUri;
- let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}';
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets';
requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
- requestUrl = requestUrl.replace('{availabilitySetName}', encodeURIComponent(availabilitySetName));
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
let queryParameters = [];
queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
@@ -654,7 +905,7 @@ function _get(resourceGroupName, availabilitySetName, options, callback) {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
- let resultMapper = new client.models['AvailabilitySet']().mapper();
+ let resultMapper = new client.models['AvailabilitySetListResult']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
@@ -670,10 +921,13 @@ function _get(resourceGroupName, availabilitySetName, options, callback) {
}
/**
- * Lists all availability sets in a resource group.
+ * Lists all available virtual machine sizes that can be used to create a new
+ * virtual machine in an existing availability set.
*
* @param {string} resourceGroupName The name of the resource group.
*
+ * @param {string} availabilitySetName The name of the availability set.
+ *
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
@@ -686,14 +940,14 @@ function _get(resourceGroupName, availabilitySetName, options, callback) {
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
- * See {@link AvailabilitySetListResult} for more
+ * See {@link VirtualMachineSizeListResult} for more
* information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
-function _list(resourceGroupName, options, callback) {
+function _listAvailableSizes(resourceGroupName, availabilitySetName, options, callback) {
/* jshint validthis: true */
let client = this.client;
if(!callback && typeof options === 'function') {
@@ -703,12 +957,15 @@ function _list(resourceGroupName, options, callback) {
if (!callback) {
throw new Error('callback cannot be null.');
}
- let apiVersion = '2017-12-01';
+ let apiVersion = '2018-06-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
}
+ if (availabilitySetName === null || availabilitySetName === undefined || typeof availabilitySetName.valueOf() !== 'string') {
+ throw new Error('availabilitySetName cannot be null or undefined and it must be of type string.');
+ }
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
}
@@ -721,8 +978,9 @@ function _list(resourceGroupName, options, callback) {
// Construct URL
let baseUrl = this.client.baseUri;
- let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets';
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes';
requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{availabilitySetName}', encodeURIComponent(availabilitySetName));
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
let queryParameters = [];
queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
@@ -730,6 +988,134 @@ function _list(resourceGroupName, options, callback) {
requestUrl += '?' + queryParameters.join('&');
}
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['VirtualMachineSizeListResult']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Lists all availability sets in a subscription.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link AvailabilitySetListResult} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _listBySubscriptionNext(nextPageLink, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ // Validate
+ try {
+ if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
+ throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let requestUrl = '{nextLink}';
+ requestUrl = requestUrl.replace('{nextLink}', nextPageLink);
+
// Create HTTP transport objects
let httpRequest = new WebResource();
httpRequest.method = 'GET';
@@ -808,12 +1194,10 @@ function _list(resourceGroupName, options, callback) {
}
/**
- * Lists all available virtual machine sizes that can be used to create a new
- * virtual machine in an existing availability set.
- *
- * @param {string} resourceGroupName The name of the resource group.
+ * Lists all availability sets in a resource group.
*
- * @param {string} availabilitySetName The name of the availability set.
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
*
* @param {object} [options] Optional Parameters.
*
@@ -827,14 +1211,14 @@ function _list(resourceGroupName, options, callback) {
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
- * See {@link VirtualMachineSizeListResult} for more
+ * See {@link AvailabilitySetListResult} for more
* information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
-function _listAvailableSizes(resourceGroupName, availabilitySetName, options, callback) {
+function _listNext(nextPageLink, options, callback) {
/* jshint validthis: true */
let client = this.client;
if(!callback && typeof options === 'function') {
@@ -844,17 +1228,10 @@ function _listAvailableSizes(resourceGroupName, availabilitySetName, options, ca
if (!callback) {
throw new Error('callback cannot be null.');
}
- let apiVersion = '2017-12-01';
// Validate
try {
- if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
- throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
- }
- if (availabilitySetName === null || availabilitySetName === undefined || typeof availabilitySetName.valueOf() !== 'string') {
- throw new Error('availabilitySetName cannot be null or undefined and it must be of type string.');
- }
- if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
- throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ if (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.');
@@ -864,16 +1241,8 @@ function _listAvailableSizes(resourceGroupName, availabilitySetName, options, ca
}
// Construct URL
- let baseUrl = this.client.baseUri;
- let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes';
- requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
- requestUrl = requestUrl.replace('{availabilitySetName}', encodeURIComponent(availabilitySetName));
- requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
- let queryParameters = [];
- queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
- if (queryParameters.length > 0) {
- requestUrl += '?' + queryParameters.join('&');
- }
+ let requestUrl = '{nextLink}';
+ requestUrl = requestUrl.replace('{nextLink}', nextPageLink);
// Create HTTP transport objects
let httpRequest = new WebResource();
@@ -937,7 +1306,7 @@ function _listAvailableSizes(resourceGroupName, availabilitySetName, options, ca
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
- let resultMapper = new client.models['VirtualMachineSizeListResult']().mapper();
+ let resultMapper = new client.models['AvailabilitySetListResult']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
@@ -964,8 +1333,11 @@ class AvailabilitySets {
this._update = _update;
this._deleteMethod = _deleteMethod;
this._get = _get;
+ this._listBySubscription = _listBySubscription;
this._list = _list;
this._listAvailableSizes = _listAvailableSizes;
+ this._listBySubscriptionNext = _listBySubscriptionNext;
+ this._listNext = _listNext;
}
/**
@@ -1250,7 +1622,7 @@ class AvailabilitySets {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
@@ -1287,7 +1659,7 @@ class AvailabilitySets {
*
* {Promise} A promise is returned
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error} - The error object.
*
@@ -1295,9 +1667,7 @@ class AvailabilitySets {
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
- * {object} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
@@ -1409,6 +1779,85 @@ class AvailabilitySets {
}
}
+ /**
+ * Lists all availability sets in a subscription.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listBySubscriptionWithHttpOperationResponse(options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listBySubscription(options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Lists all availability sets in a subscription.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {AvailabilitySetListResult} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link AvailabilitySetListResult} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listBySubscription(options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listBySubscription(options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listBySubscription(options, optionalCallback);
+ }
+ }
+
/**
* Lists all availability sets in a resource group.
*
@@ -1581,6 +2030,176 @@ class AvailabilitySets {
}
}
+ /**
+ * Lists all availability sets in a subscription.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listBySubscriptionNextWithHttpOperationResponse(nextPageLink, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listBySubscriptionNext(nextPageLink, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Lists all availability sets in a subscription.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {AvailabilitySetListResult} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link AvailabilitySetListResult} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listBySubscriptionNext(nextPageLink, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listBySubscriptionNext(nextPageLink, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listBySubscriptionNext(nextPageLink, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Lists all availability sets in a resource group.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listNextWithHttpOperationResponse(nextPageLink, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listNext(nextPageLink, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Lists all availability sets in a resource group.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {AvailabilitySetListResult} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link AvailabilitySetListResult} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listNext(nextPageLink, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listNext(nextPageLink, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listNext(nextPageLink, options, optionalCallback);
+ }
+ }
+
}
module.exports = AvailabilitySets;
diff --git a/lib/services/computeManagement2/lib/operations/disks.js b/lib/services/computeManagement2/lib/operations/disks.js
index aeb9e01a49..0650e9ba33 100644
--- a/lib/services/computeManagement2/lib/operations/disks.js
+++ b/lib/services/computeManagement2/lib/operations/disks.js
@@ -31,7 +31,7 @@ const WebResource = msRest.WebResource;
* @param {object} [disk.sku]
*
* @param {string} [disk.sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [disk.zones] The Logical zone list for Disk.
*
@@ -233,7 +233,7 @@ function _createOrUpdate(resourceGroupName, diskName, disk, options, callback) {
* @param {object} [disk.sku]
*
* @param {string} [disk.sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {object} [options] Optional Parameters.
*
@@ -473,9 +473,7 @@ function _get(resourceGroupName, diskName, options, callback) {
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
- * {object} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
@@ -513,20 +511,6 @@ function _deleteMethod(resourceGroupName, diskName, options, callback) {
if (responseBody === '') responseBody = null;
// Deserialize Response
- let parsedResponse = null;
- try {
- parsedResponse = JSON.parse(responseBody);
- result = JSON.parse(responseBody);
- if (parsedResponse !== null && parsedResponse !== undefined) {
- let resultMapper = new client.models['OperationStatusResponse']().mapper();
- result = client.deserialize(resultMapper, parsedResponse, 'result');
- }
- } catch (error) {
- let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
- deserializationError.request = msRest.stripRequest(httpRequest);
- deserializationError.response = msRest.stripResponse(response);
- return callback(deserializationError);
- }
return callback(null, result, httpRequest, response);
});
@@ -913,9 +897,7 @@ function _grantAccess(resourceGroupName, diskName, grantAccessData, options, cal
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
- * {object} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
@@ -953,20 +935,6 @@ function _revokeAccess(resourceGroupName, diskName, options, callback) {
if (responseBody === '') responseBody = null;
// Deserialize Response
- let parsedResponse = null;
- try {
- parsedResponse = JSON.parse(responseBody);
- result = JSON.parse(responseBody);
- if (parsedResponse !== null && parsedResponse !== undefined) {
- let resultMapper = new client.models['OperationStatusResponse']().mapper();
- result = client.deserialize(resultMapper, parsedResponse, 'result');
- }
- } catch (error) {
- let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
- deserializationError.request = msRest.stripRequest(httpRequest);
- deserializationError.response = msRest.stripResponse(response);
- return callback(deserializationError);
- }
return callback(null, result, httpRequest, response);
});
@@ -989,7 +957,7 @@ function _revokeAccess(resourceGroupName, diskName, options, callback) {
* @param {object} [disk.sku]
*
* @param {string} [disk.sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [disk.zones] The Logical zone list for Disk.
*
@@ -1290,7 +1258,7 @@ function _beginCreateOrUpdate(resourceGroupName, diskName, disk, options, callba
* @param {object} [disk.sku]
*
* @param {string} [disk.sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {object} [options] Optional Parameters.
*
@@ -1483,9 +1451,7 @@ function _beginUpdate(resourceGroupName, diskName, disk, options, callback) {
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
- * {object} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
@@ -1587,23 +1553,6 @@ function _beginDeleteMethod(resourceGroupName, diskName, options, callback) {
// Create Result
let result = null;
if (responseBody === '') responseBody = null;
- // Deserialize Response
- if (statusCode === 200) {
- let parsedResponse = null;
- try {
- parsedResponse = JSON.parse(responseBody);
- result = JSON.parse(responseBody);
- if (parsedResponse !== null && parsedResponse !== undefined) {
- let resultMapper = new client.models['OperationStatusResponse']().mapper();
- result = client.deserialize(resultMapper, parsedResponse, 'result');
- }
- } catch (error) {
- let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
- deserializationError.request = msRest.stripRequest(httpRequest);
- deserializationError.response = msRest.stripResponse(response);
- return callback(deserializationError);
- }
- }
return callback(null, result, httpRequest, response);
});
@@ -1802,9 +1751,7 @@ function _beginGrantAccess(resourceGroupName, diskName, grantAccessData, options
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
- * {object} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
@@ -1906,23 +1853,6 @@ function _beginRevokeAccess(resourceGroupName, diskName, options, callback) {
// Create Result
let result = null;
if (responseBody === '') responseBody = null;
- // Deserialize Response
- if (statusCode === 200) {
- let parsedResponse = null;
- try {
- parsedResponse = JSON.parse(responseBody);
- result = JSON.parse(responseBody);
- if (parsedResponse !== null && parsedResponse !== undefined) {
- let resultMapper = new client.models['OperationStatusResponse']().mapper();
- result = client.deserialize(resultMapper, parsedResponse, 'result');
- }
- } catch (error) {
- let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
- deserializationError.request = msRest.stripRequest(httpRequest);
- deserializationError.response = msRest.stripResponse(response);
- return callback(deserializationError);
- }
- }
return callback(null, result, httpRequest, response);
});
@@ -2223,7 +2153,7 @@ class Disks {
* @param {object} [disk.sku]
*
* @param {string} [disk.sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [disk.zones] The Logical zone list for Disk.
*
@@ -2338,7 +2268,7 @@ class Disks {
* @param {object} [disk.sku]
*
* @param {string} [disk.sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [disk.zones] The Logical zone list for Disk.
*
@@ -2516,7 +2446,7 @@ class Disks {
* @param {object} [disk.sku]
*
* @param {string} [disk.sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {object} [options] Optional Parameters.
*
@@ -2600,7 +2530,7 @@ class Disks {
* @param {object} [disk.sku]
*
* @param {string} [disk.sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {object} [options] Optional Parameters.
*
@@ -2758,7 +2688,7 @@ class Disks {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
@@ -2798,7 +2728,7 @@ class Disks {
*
* {Promise} A promise is returned
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error} - The error object.
*
@@ -2806,9 +2736,7 @@ class Disks {
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
- * {object} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
@@ -3121,7 +3049,7 @@ class Disks {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
@@ -3161,7 +3089,7 @@ class Disks {
*
* {Promise} A promise is returned
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error} - The error object.
*
@@ -3169,9 +3097,7 @@ class Disks {
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
- * {object} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
@@ -3213,7 +3139,7 @@ class Disks {
* @param {object} [disk.sku]
*
* @param {string} [disk.sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [disk.zones] The Logical zone list for Disk.
*
@@ -3328,7 +3254,7 @@ class Disks {
* @param {object} [disk.sku]
*
* @param {string} [disk.sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [disk.zones] The Logical zone list for Disk.
*
@@ -3506,7 +3432,7 @@ class Disks {
* @param {object} [disk.sku]
*
* @param {string} [disk.sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {object} [options] Optional Parameters.
*
@@ -3590,7 +3516,7 @@ class Disks {
* @param {object} [disk.sku]
*
* @param {string} [disk.sku.name] The sku name. Possible values include:
- * 'Standard_LRS', 'Premium_LRS'
+ * 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {object} [options] Optional Parameters.
*
@@ -3656,7 +3582,7 @@ class Disks {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
@@ -3696,7 +3622,7 @@ class Disks {
*
* {Promise} A promise is returned
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error} - The error object.
*
@@ -3704,9 +3630,7 @@ class Disks {
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
- * {object} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
@@ -3859,7 +3783,7 @@ class Disks {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
@@ -3899,7 +3823,7 @@ class Disks {
*
* {Promise} A promise is returned
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error} - The error object.
*
@@ -3907,9 +3831,7 @@ class Disks {
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
- * {object} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
diff --git a/lib/services/computeManagement2/lib/operations/galleries.js b/lib/services/computeManagement2/lib/operations/galleries.js
new file mode 100644
index 0000000000..d4ac24efb0
--- /dev/null
+++ b/lib/services/computeManagement2/lib/operations/galleries.js
@@ -0,0 +1,2013 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const msRest = require('ms-rest');
+const msRestAzure = require('ms-rest-azure');
+const WebResource = msRest.WebResource;
+
+
+/**
+ * Create or update a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} gallery Parameters supplied to the create or update gallery
+ * operation.
+ *
+ * @param {string} [gallery.description] The description of this gallery
+ * resource.
+ *
+ * @param {object} [gallery.identifier]
+ *
+ * @param {string} gallery.location Resource location
+ *
+ * @param {object} [gallery.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link Gallery} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _createOrUpdate(resourceGroupName, galleryName, gallery, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+
+ // Send request
+ this.beginCreateOrUpdate(resourceGroupName, galleryName, gallery, options, (err, parsedResult, httpRequest, response) => {
+ if (err) return callback(err);
+
+ let initialResult = new msRest.HttpOperationResponse();
+ initialResult.request = httpRequest;
+ initialResult.response = response;
+ initialResult.body = response.body;
+ client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => {
+ if (err) return callback(err);
+
+ // Create Result
+ let result = null;
+
+ httpRequest = pollingResult.request;
+ response = pollingResult.response;
+ let responseBody = pollingResult.body;
+ if (responseBody === '') responseBody = null;
+
+ // Deserialize Response
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['Gallery']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+ });
+}
+
+/**
+ * Retrieves information about a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link Gallery} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _get(resourceGroupName, galleryName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['Gallery']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+
+/**
+ * Delete a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link OperationStatusResponse} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _deleteMethod(resourceGroupName, galleryName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+
+ // Send request
+ this.beginDeleteMethod(resourceGroupName, galleryName, options, (err, parsedResult, httpRequest, response) => {
+ if (err) return callback(err);
+
+ let initialResult = new msRest.HttpOperationResponse();
+ initialResult.request = httpRequest;
+ initialResult.response = response;
+ initialResult.body = response.body;
+ client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => {
+ if (err) return callback(err);
+
+ // Create Result
+ let result = null;
+
+ httpRequest = pollingResult.request;
+ response = pollingResult.response;
+ let responseBody = pollingResult.body;
+ if (responseBody === '') responseBody = null;
+
+ // Deserialize Response
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['OperationStatusResponse']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+ });
+}
+
+/**
+ * List galleries under a resource group.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _listByResourceGroup(resourceGroupName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryList']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * List galleries under a subscription.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _listBySubscription(options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryList']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Create or update a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} gallery Parameters supplied to the create or update gallery
+ * operation.
+ *
+ * @param {string} [gallery.description] The description of this gallery
+ * resource.
+ *
+ * @param {object} [gallery.identifier]
+ *
+ * @param {string} gallery.location Resource location
+ *
+ * @param {object} [gallery.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link Gallery} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _beginCreateOrUpdate(resourceGroupName, galleryName, gallery, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (gallery === null || gallery === undefined) {
+ throw new Error('gallery cannot be null or undefined.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'PUT';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ // Serialize Request
+ let requestContent = null;
+ let requestModel = null;
+ try {
+ if (gallery !== null && gallery !== undefined) {
+ let requestModelMapper = new client.models['Gallery']().mapper();
+ requestModel = client.serialize(requestModelMapper, gallery, 'gallery');
+ requestContent = JSON.stringify(requestModel);
+ }
+ } catch (error) {
+ let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
+ `payload - ${JSON.stringify(gallery, null, 2)}.`);
+ return callback(serializationError);
+ }
+ httpRequest.body = requestContent;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200 && statusCode !== 201) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['Gallery']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+ // Deserialize Response
+ if (statusCode === 201) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['Gallery']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError1.request = msRest.stripRequest(httpRequest);
+ deserializationError1.response = msRest.stripResponse(response);
+ return callback(deserializationError1);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Delete a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link OperationStatusResponse} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _beginDeleteMethod(resourceGroupName, galleryName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'DELETE';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['OperationStatusResponse']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * List galleries under a resource group.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _listByResourceGroupNext(nextPageLink, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ // Validate
+ try {
+ if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
+ throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let requestUrl = '{nextLink}';
+ requestUrl = requestUrl.replace('{nextLink}', nextPageLink);
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryList']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * List galleries under a subscription.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _listBySubscriptionNext(nextPageLink, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ // Validate
+ try {
+ if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
+ throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let requestUrl = '{nextLink}';
+ requestUrl = requestUrl.replace('{nextLink}', nextPageLink);
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryList']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/** Class representing a Galleries. */
+class Galleries {
+ /**
+ * Create a Galleries.
+ * @param {ComputeManagementClient} client Reference to the service client.
+ */
+ constructor(client) {
+ this.client = client;
+ this._createOrUpdate = _createOrUpdate;
+ this._get = _get;
+ this._deleteMethod = _deleteMethod;
+ this._listByResourceGroup = _listByResourceGroup;
+ this._listBySubscription = _listBySubscription;
+ this._beginCreateOrUpdate = _beginCreateOrUpdate;
+ this._beginDeleteMethod = _beginDeleteMethod;
+ this._listByResourceGroupNext = _listByResourceGroupNext;
+ this._listBySubscriptionNext = _listBySubscriptionNext;
+ }
+
+ /**
+ * Create or update a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} gallery Parameters supplied to the create or update gallery
+ * operation.
+ *
+ * @param {string} [gallery.description] The description of this gallery
+ * resource.
+ *
+ * @param {object} [gallery.identifier]
+ *
+ * @param {string} gallery.location Resource location
+ *
+ * @param {object} [gallery.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ createOrUpdateWithHttpOperationResponse(resourceGroupName, galleryName, gallery, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._createOrUpdate(resourceGroupName, galleryName, gallery, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Create or update a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} gallery Parameters supplied to the create or update gallery
+ * operation.
+ *
+ * @param {string} [gallery.description] The description of this gallery
+ * resource.
+ *
+ * @param {object} [gallery.identifier]
+ *
+ * @param {string} gallery.location Resource location
+ *
+ * @param {object} [gallery.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {Gallery} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link Gallery} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ createOrUpdate(resourceGroupName, galleryName, gallery, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._createOrUpdate(resourceGroupName, galleryName, gallery, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._createOrUpdate(resourceGroupName, galleryName, gallery, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Retrieves information about a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ getWithHttpOperationResponse(resourceGroupName, galleryName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._get(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Retrieves information about a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {Gallery} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link Gallery} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ get(resourceGroupName, galleryName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._get(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._get(resourceGroupName, galleryName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Delete a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ deleteMethodWithHttpOperationResponse(resourceGroupName, galleryName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._deleteMethod(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Delete a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {OperationStatusResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link OperationStatusResponse} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ deleteMethod(resourceGroupName, galleryName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._deleteMethod(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._deleteMethod(resourceGroupName, galleryName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * List galleries under a resource group.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * List galleries under a resource group.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryList} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listByResourceGroup(resourceGroupName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listByResourceGroup(resourceGroupName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * List galleries under a subscription.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listBySubscriptionWithHttpOperationResponse(options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listBySubscription(options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * List galleries under a subscription.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryList} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listBySubscription(options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listBySubscription(options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listBySubscription(options, optionalCallback);
+ }
+ }
+
+ /**
+ * Create or update a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} gallery Parameters supplied to the create or update gallery
+ * operation.
+ *
+ * @param {string} [gallery.description] The description of this gallery
+ * resource.
+ *
+ * @param {object} [gallery.identifier]
+ *
+ * @param {string} gallery.location Resource location
+ *
+ * @param {object} [gallery.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, galleryName, gallery, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._beginCreateOrUpdate(resourceGroupName, galleryName, gallery, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Create or update a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} gallery Parameters supplied to the create or update gallery
+ * operation.
+ *
+ * @param {string} [gallery.description] The description of this gallery
+ * resource.
+ *
+ * @param {object} [gallery.identifier]
+ *
+ * @param {string} gallery.location Resource location
+ *
+ * @param {object} [gallery.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {Gallery} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link Gallery} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ beginCreateOrUpdate(resourceGroupName, galleryName, gallery, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._beginCreateOrUpdate(resourceGroupName, galleryName, gallery, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._beginCreateOrUpdate(resourceGroupName, galleryName, gallery, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Delete a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ beginDeleteMethodWithHttpOperationResponse(resourceGroupName, galleryName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._beginDeleteMethod(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Delete a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {OperationStatusResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link OperationStatusResponse} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ beginDeleteMethod(resourceGroupName, galleryName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._beginDeleteMethod(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._beginDeleteMethod(resourceGroupName, galleryName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * List galleries under a resource group.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * List galleries under a resource group.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryList} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listByResourceGroupNext(nextPageLink, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listByResourceGroupNext(nextPageLink, options, optionalCallback);
+ }
+ }
+
+ /**
+ * List galleries under a subscription.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listBySubscriptionNextWithHttpOperationResponse(nextPageLink, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listBySubscriptionNext(nextPageLink, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * List galleries under a subscription.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryList} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listBySubscriptionNext(nextPageLink, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listBySubscriptionNext(nextPageLink, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listBySubscriptionNext(nextPageLink, options, optionalCallback);
+ }
+ }
+
+}
+
+module.exports = Galleries;
diff --git a/lib/services/computeManagement2/lib/operations/galleryImageOperations.js b/lib/services/computeManagement2/lib/operations/galleryImageOperations.js
new file mode 100644
index 0000000000..f54b4fa9a0
--- /dev/null
+++ b/lib/services/computeManagement2/lib/operations/galleryImageOperations.js
@@ -0,0 +1,1680 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const msRest = require('ms-rest');
+const msRestAzure = require('ms-rest-azure');
+const WebResource = msRest.WebResource;
+
+
+/**
+ * Create or update a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery image operation.
+ *
+ * @param {string} [parameters.description] The description of this gallery
+ * image resource.
+ *
+ * @param {string} [parameters.eula] The Eula agreement for the gallery image.
+ *
+ * @param {string} [parameters.privacyStatementUri] The privacy statement uri.
+ *
+ * @param {string} [parameters.releaseNoteUri] The release note uri.
+ *
+ * @param {string} [parameters.osType] This property allows you to specify the
+ * type of the OS that is included in the disk if creating a VM from user-image
+ * or a specialized VHD.
Possible values are:
**Windows**
+ *
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} [parameters.osState] The OS State. Possible values include:
+ * 'Generalized', 'Specialized'
+ *
+ * @param {date} [parameters.endOfLifeDate] The end of life of this gallery
+ * image.
+ *
+ * @param {object} [parameters.identifier]
+ *
+ * @param {string} [parameters.identifier.publisher] The gallery image
+ * publisher name.
+ *
+ * @param {string} [parameters.identifier.offer] The gallery image offer name.
+ *
+ * @param {string} [parameters.identifier.sku] The gallery image sku name.
+ *
+ * @param {object} [parameters.recommended]
+ *
+ * @param {object} [parameters.recommended.vCPUs]
+ *
+ * @param {object} [parameters.recommended.memory]
+ *
+ * @param {number} [parameters.recommended.memory.min] The minimum number of
+ * the resource.
+ *
+ * @param {number} [parameters.recommended.memory.max] The maximum number of
+ * the resource.
+ *
+ * @param {object} [parameters.disallowed]
+ *
+ * @param {array} [parameters.disallowed.diskTypes] A list of disk types.
+ *
+ * @param {object} [parameters.purchasePlan]
+ *
+ * @param {string} [parameters.purchasePlan.name] The plan ID.
+ *
+ * @param {string} [parameters.purchasePlan.publisher] The publisher ID.
+ *
+ * @param {string} [parameters.purchasePlan.product] The product ID.
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImage} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _createOrUpdate(resourceGroupName, galleryName, galleryImageName, parameters, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+
+ // Send request
+ this.beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, parameters, options, (err, parsedResult, httpRequest, response) => {
+ if (err) return callback(err);
+
+ let initialResult = new msRest.HttpOperationResponse();
+ initialResult.request = httpRequest;
+ initialResult.response = response;
+ initialResult.body = response.body;
+ client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => {
+ if (err) return callback(err);
+
+ // Create Result
+ let result = null;
+
+ httpRequest = pollingResult.request;
+ response = pollingResult.response;
+ let responseBody = pollingResult.body;
+ if (responseBody === '') responseBody = null;
+
+ // Deserialize Response
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImage']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+ });
+}
+
+/**
+ * Retrieves information about a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImage} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _get(resourceGroupName, galleryName, galleryImageName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') {
+ throw new Error('galleryImageName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImage']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+
+/**
+ * Delete a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {null} [result] - The deserialized result object if an error did not occur.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _deleteMethod(resourceGroupName, galleryName, galleryImageName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+
+ // Send request
+ this.beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, options, (err, parsedResult, httpRequest, response) => {
+ if (err) return callback(err);
+
+ let initialResult = new msRest.HttpOperationResponse();
+ initialResult.request = httpRequest;
+ initialResult.response = response;
+ initialResult.body = response.body;
+ client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => {
+ if (err) return callback(err);
+
+ // Create Result
+ let result = null;
+
+ httpRequest = pollingResult.request;
+ response = pollingResult.response;
+ let responseBody = pollingResult.body;
+ if (responseBody === '') responseBody = null;
+
+ // Deserialize Response
+
+ return callback(null, result, httpRequest, response);
+ });
+ });
+}
+
+/**
+ * List gallery images under a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _listGalleryImagesInGallery(resourceGroupName, galleryName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImageList']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Create or update a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery image operation.
+ *
+ * @param {string} [parameters.description] The description of this gallery
+ * image resource.
+ *
+ * @param {string} [parameters.eula] The Eula agreement for the gallery image.
+ *
+ * @param {string} [parameters.privacyStatementUri] The privacy statement uri.
+ *
+ * @param {string} [parameters.releaseNoteUri] The release note uri.
+ *
+ * @param {string} [parameters.osType] This property allows you to specify the
+ * type of the OS that is included in the disk if creating a VM from user-image
+ * or a specialized VHD.
Possible values are:
**Windows**
+ *
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} [parameters.osState] The OS State. Possible values include:
+ * 'Generalized', 'Specialized'
+ *
+ * @param {date} [parameters.endOfLifeDate] The end of life of this gallery
+ * image.
+ *
+ * @param {object} [parameters.identifier]
+ *
+ * @param {string} [parameters.identifier.publisher] The gallery image
+ * publisher name.
+ *
+ * @param {string} [parameters.identifier.offer] The gallery image offer name.
+ *
+ * @param {string} [parameters.identifier.sku] The gallery image sku name.
+ *
+ * @param {object} [parameters.recommended]
+ *
+ * @param {object} [parameters.recommended.vCPUs]
+ *
+ * @param {object} [parameters.recommended.memory]
+ *
+ * @param {number} [parameters.recommended.memory.min] The minimum number of
+ * the resource.
+ *
+ * @param {number} [parameters.recommended.memory.max] The maximum number of
+ * the resource.
+ *
+ * @param {object} [parameters.disallowed]
+ *
+ * @param {array} [parameters.disallowed.diskTypes] A list of disk types.
+ *
+ * @param {object} [parameters.purchasePlan]
+ *
+ * @param {string} [parameters.purchasePlan.name] The plan ID.
+ *
+ * @param {string} [parameters.purchasePlan.publisher] The publisher ID.
+ *
+ * @param {string} [parameters.purchasePlan.product] The product ID.
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImage} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, parameters, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') {
+ throw new Error('galleryImageName cannot be null or undefined and it must be of type string.');
+ }
+ if (parameters === null || parameters === undefined) {
+ throw new Error('parameters cannot be null or undefined.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'PUT';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ // Serialize Request
+ let requestContent = null;
+ let requestModel = null;
+ try {
+ if (parameters !== null && parameters !== undefined) {
+ let requestModelMapper = new client.models['GalleryImage']().mapper();
+ requestModel = client.serialize(requestModelMapper, parameters, 'parameters');
+ requestContent = JSON.stringify(requestModel);
+ }
+ } catch (error) {
+ let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
+ `payload - ${JSON.stringify(parameters, null, 2)}.`);
+ return callback(serializationError);
+ }
+ httpRequest.body = requestContent;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 201 && statusCode !== 202) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 201) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImage']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+ // Deserialize Response
+ if (statusCode === 202) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImage']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError1.request = msRest.stripRequest(httpRequest);
+ deserializationError1.response = msRest.stripResponse(response);
+ return callback(deserializationError1);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Delete a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {null} [result] - The deserialized result object if an error did not occur.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') {
+ throw new Error('galleryImageName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'DELETE';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 202 && statusCode !== 204) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/** Class representing a GalleryImageOperations. */
+class GalleryImageOperations {
+ /**
+ * Create a GalleryImageOperations.
+ * @param {ComputeManagementClient} client Reference to the service client.
+ */
+ constructor(client) {
+ this.client = client;
+ this._createOrUpdate = _createOrUpdate;
+ this._get = _get;
+ this._deleteMethod = _deleteMethod;
+ this._listGalleryImagesInGallery = _listGalleryImagesInGallery;
+ this._beginCreateOrUpdate = _beginCreateOrUpdate;
+ this._beginDeleteMethod = _beginDeleteMethod;
+ }
+
+ /**
+ * Create or update a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery image operation.
+ *
+ * @param {string} [parameters.description] The description of this gallery
+ * image resource.
+ *
+ * @param {string} [parameters.eula] The Eula agreement for the gallery image.
+ *
+ * @param {string} [parameters.privacyStatementUri] The privacy statement uri.
+ *
+ * @param {string} [parameters.releaseNoteUri] The release note uri.
+ *
+ * @param {string} [parameters.osType] This property allows you to specify the
+ * type of the OS that is included in the disk if creating a VM from user-image
+ * or a specialized VHD.
Possible values are:
**Windows**
+ *
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} [parameters.osState] The OS State. Possible values include:
+ * 'Generalized', 'Specialized'
+ *
+ * @param {date} [parameters.endOfLifeDate] The end of life of this gallery
+ * image.
+ *
+ * @param {object} [parameters.identifier]
+ *
+ * @param {string} [parameters.identifier.publisher] The gallery image
+ * publisher name.
+ *
+ * @param {string} [parameters.identifier.offer] The gallery image offer name.
+ *
+ * @param {string} [parameters.identifier.sku] The gallery image sku name.
+ *
+ * @param {object} [parameters.recommended]
+ *
+ * @param {object} [parameters.recommended.vCPUs]
+ *
+ * @param {object} [parameters.recommended.memory]
+ *
+ * @param {number} [parameters.recommended.memory.min] The minimum number of
+ * the resource.
+ *
+ * @param {number} [parameters.recommended.memory.max] The maximum number of
+ * the resource.
+ *
+ * @param {object} [parameters.disallowed]
+ *
+ * @param {array} [parameters.disallowed.diskTypes] A list of disk types.
+ *
+ * @param {object} [parameters.purchasePlan]
+ *
+ * @param {string} [parameters.purchasePlan.name] The plan ID.
+ *
+ * @param {string} [parameters.purchasePlan.publisher] The publisher ID.
+ *
+ * @param {string} [parameters.purchasePlan.product] The product ID.
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ createOrUpdateWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, parameters, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, parameters, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Create or update a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery image operation.
+ *
+ * @param {string} [parameters.description] The description of this gallery
+ * image resource.
+ *
+ * @param {string} [parameters.eula] The Eula agreement for the gallery image.
+ *
+ * @param {string} [parameters.privacyStatementUri] The privacy statement uri.
+ *
+ * @param {string} [parameters.releaseNoteUri] The release note uri.
+ *
+ * @param {string} [parameters.osType] This property allows you to specify the
+ * type of the OS that is included in the disk if creating a VM from user-image
+ * or a specialized VHD.
Possible values are:
**Windows**
+ *
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} [parameters.osState] The OS State. Possible values include:
+ * 'Generalized', 'Specialized'
+ *
+ * @param {date} [parameters.endOfLifeDate] The end of life of this gallery
+ * image.
+ *
+ * @param {object} [parameters.identifier]
+ *
+ * @param {string} [parameters.identifier.publisher] The gallery image
+ * publisher name.
+ *
+ * @param {string} [parameters.identifier.offer] The gallery image offer name.
+ *
+ * @param {string} [parameters.identifier.sku] The gallery image sku name.
+ *
+ * @param {object} [parameters.recommended]
+ *
+ * @param {object} [parameters.recommended.vCPUs]
+ *
+ * @param {object} [parameters.recommended.memory]
+ *
+ * @param {number} [parameters.recommended.memory.min] The minimum number of
+ * the resource.
+ *
+ * @param {number} [parameters.recommended.memory.max] The maximum number of
+ * the resource.
+ *
+ * @param {object} [parameters.disallowed]
+ *
+ * @param {array} [parameters.disallowed.diskTypes] A list of disk types.
+ *
+ * @param {object} [parameters.purchasePlan]
+ *
+ * @param {string} [parameters.purchasePlan.name] The plan ID.
+ *
+ * @param {string} [parameters.purchasePlan.publisher] The publisher ID.
+ *
+ * @param {string} [parameters.purchasePlan.product] The product ID.
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImage} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImage} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ createOrUpdate(resourceGroupName, galleryName, galleryImageName, parameters, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, parameters, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, parameters, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Retrieves information about a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ getWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._get(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Retrieves information about a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImage} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImage} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ get(resourceGroupName, galleryName, galleryImageName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._get(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._get(resourceGroupName, galleryName, galleryImageName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Delete a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ deleteMethodWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._deleteMethod(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Delete a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {null} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {null} [result] - The deserialized result object if an error did not occur.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ deleteMethod(resourceGroupName, galleryName, galleryImageName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._deleteMethod(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._deleteMethod(resourceGroupName, galleryName, galleryImageName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * List gallery images under a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listGalleryImagesInGalleryWithHttpOperationResponse(resourceGroupName, galleryName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listGalleryImagesInGallery(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * List gallery images under a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImageList} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listGalleryImagesInGallery(resourceGroupName, galleryName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listGalleryImagesInGallery(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listGalleryImagesInGallery(resourceGroupName, galleryName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Create or update a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery image operation.
+ *
+ * @param {string} [parameters.description] The description of this gallery
+ * image resource.
+ *
+ * @param {string} [parameters.eula] The Eula agreement for the gallery image.
+ *
+ * @param {string} [parameters.privacyStatementUri] The privacy statement uri.
+ *
+ * @param {string} [parameters.releaseNoteUri] The release note uri.
+ *
+ * @param {string} [parameters.osType] This property allows you to specify the
+ * type of the OS that is included in the disk if creating a VM from user-image
+ * or a specialized VHD.
Possible values are:
**Windows**
+ *
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} [parameters.osState] The OS State. Possible values include:
+ * 'Generalized', 'Specialized'
+ *
+ * @param {date} [parameters.endOfLifeDate] The end of life of this gallery
+ * image.
+ *
+ * @param {object} [parameters.identifier]
+ *
+ * @param {string} [parameters.identifier.publisher] The gallery image
+ * publisher name.
+ *
+ * @param {string} [parameters.identifier.offer] The gallery image offer name.
+ *
+ * @param {string} [parameters.identifier.sku] The gallery image sku name.
+ *
+ * @param {object} [parameters.recommended]
+ *
+ * @param {object} [parameters.recommended.vCPUs]
+ *
+ * @param {object} [parameters.recommended.memory]
+ *
+ * @param {number} [parameters.recommended.memory.min] The minimum number of
+ * the resource.
+ *
+ * @param {number} [parameters.recommended.memory.max] The maximum number of
+ * the resource.
+ *
+ * @param {object} [parameters.disallowed]
+ *
+ * @param {array} [parameters.disallowed.diskTypes] A list of disk types.
+ *
+ * @param {object} [parameters.purchasePlan]
+ *
+ * @param {string} [parameters.purchasePlan.name] The plan ID.
+ *
+ * @param {string} [parameters.purchasePlan.publisher] The publisher ID.
+ *
+ * @param {string} [parameters.purchasePlan.product] The product ID.
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, parameters, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, parameters, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Create or update a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery image operation.
+ *
+ * @param {string} [parameters.description] The description of this gallery
+ * image resource.
+ *
+ * @param {string} [parameters.eula] The Eula agreement for the gallery image.
+ *
+ * @param {string} [parameters.privacyStatementUri] The privacy statement uri.
+ *
+ * @param {string} [parameters.releaseNoteUri] The release note uri.
+ *
+ * @param {string} [parameters.osType] This property allows you to specify the
+ * type of the OS that is included in the disk if creating a VM from user-image
+ * or a specialized VHD.
Possible values are:
**Windows**
+ *
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} [parameters.osState] The OS State. Possible values include:
+ * 'Generalized', 'Specialized'
+ *
+ * @param {date} [parameters.endOfLifeDate] The end of life of this gallery
+ * image.
+ *
+ * @param {object} [parameters.identifier]
+ *
+ * @param {string} [parameters.identifier.publisher] The gallery image
+ * publisher name.
+ *
+ * @param {string} [parameters.identifier.offer] The gallery image offer name.
+ *
+ * @param {string} [parameters.identifier.sku] The gallery image sku name.
+ *
+ * @param {object} [parameters.recommended]
+ *
+ * @param {object} [parameters.recommended.vCPUs]
+ *
+ * @param {object} [parameters.recommended.memory]
+ *
+ * @param {number} [parameters.recommended.memory.min] The minimum number of
+ * the resource.
+ *
+ * @param {number} [parameters.recommended.memory.max] The maximum number of
+ * the resource.
+ *
+ * @param {object} [parameters.disallowed]
+ *
+ * @param {array} [parameters.disallowed.diskTypes] A list of disk types.
+ *
+ * @param {object} [parameters.purchasePlan]
+ *
+ * @param {string} [parameters.purchasePlan.name] The plan ID.
+ *
+ * @param {string} [parameters.purchasePlan.publisher] The publisher ID.
+ *
+ * @param {string} [parameters.purchasePlan.product] The product ID.
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImage} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImage} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, parameters, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, parameters, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, parameters, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Delete a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ beginDeleteMethodWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Delete a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {null} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {null} [result] - The deserialized result object if an error did not occur.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, options, optionalCallback);
+ }
+ }
+
+}
+
+module.exports = GalleryImageOperations;
diff --git a/lib/services/computeManagement2/lib/operations/galleryImageVersionOperations.js b/lib/services/computeManagement2/lib/operations/galleryImageVersionOperations.js
new file mode 100644
index 0000000000..ff9e763145
--- /dev/null
+++ b/lib/services/computeManagement2/lib/operations/galleryImageVersionOperations.js
@@ -0,0 +1,1535 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const msRest = require('ms-rest');
+const msRestAzure = require('ms-rest-azure');
+const WebResource = msRest.WebResource;
+
+
+/**
+ * Create or update a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery image version operation.
+ *
+ * @param {object} [parameters.publishingProfile]
+ *
+ * @param {boolean} [parameters.publishingProfile.excludeFromLatest] The flag
+ * means that if it is set to true, people deploying VMs with 'latest' as
+ * version will not use this version.
+ *
+ * @param {date} [parameters.publishingProfile.endOfLifeDate] The end of life
+ * date of the gallery image version.
+ *
+ * @param {array} [parameters.publishingProfile.regions] The regions where the
+ * artifact is going to be published.
+ *
+ * @param {object} [parameters.publishingProfile.source]
+ *
+ * @param {object} [parameters.publishingProfile.source.managedImage]
+ *
+ * @param {string} [parameters.publishingProfile.source.managedImage.id] The
+ * managed artifact id.
+ *
+ * @param {object} [parameters.storageProfile]
+ *
+ * @param {object} [parameters.storageProfile.osDiskImage]
+ *
+ * @param {number} [parameters.storageProfile.osDiskImage.sizedInGB] It
+ * indicates the size of the VHD to create.
+ *
+ * @param {string} [parameters.storageProfile.osDiskImage.hostCaching] The host
+ * caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'.
+ * Possible values include: 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {array} [parameters.storageProfile.dataDiskImages] A list of data
+ * disk images.
+ *
+ * @param {object} [parameters.replicationStatus]
+ *
+ * @param {string} [parameters.replicationStatus.aggregatedState] This is the
+ * aggregated replication status based on the regional replication status.
+ * Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed'
+ *
+ * @param {array} [parameters.replicationStatus.summary] This is a summary of
+ * replication status for each region.
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersion} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, parameters, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+
+ // Send request
+ this.beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, parameters, options, (err, parsedResult, httpRequest, response) => {
+ if (err) return callback(err);
+
+ let initialResult = new msRest.HttpOperationResponse();
+ initialResult.request = httpRequest;
+ initialResult.response = response;
+ initialResult.body = response.body;
+ client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => {
+ if (err) return callback(err);
+
+ // Create Result
+ let result = null;
+
+ httpRequest = pollingResult.request;
+ response = pollingResult.response;
+ let responseBody = pollingResult.body;
+ if (responseBody === '') responseBody = null;
+
+ // Deserialize Response
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImageVersion']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+ });
+}
+
+/**
+ * Retrieves information about a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {string} [options.expand] The expand expression to apply on the
+ * operation.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersion} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _get(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let expand = (options && options.expand !== undefined) ? options.expand : undefined;
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') {
+ throw new Error('galleryImageName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageVersionName === null || galleryImageVersionName === undefined || typeof galleryImageVersionName.valueOf() !== 'string') {
+ throw new Error('galleryImageVersionName 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName));
+ requestUrl = requestUrl.replace('{galleryImageVersionName}', encodeURIComponent(galleryImageVersionName));
+ let queryParameters = [];
+ if (expand !== null && expand !== undefined) {
+ queryParameters.push('$expand=' + encodeURIComponent(expand));
+ }
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImageVersion']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Delete a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {null} [result] - The deserialized result object if an error did not occur.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _deleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') {
+ throw new Error('galleryImageName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageVersionName === null || galleryImageVersionName === undefined || typeof galleryImageVersionName.valueOf() !== 'string') {
+ throw new Error('galleryImageVersionName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName));
+ requestUrl = requestUrl.replace('{galleryImageVersionName}', encodeURIComponent(galleryImageVersionName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'DELETE';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 202 && statusCode !== 204) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * List gallery image versions under a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersionList} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _listGalleryImageVersionsInGalleryImage(resourceGroupName, galleryName, galleryImageName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') {
+ throw new Error('galleryImageName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImageVersionList']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Create or update a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery image version operation.
+ *
+ * @param {object} [parameters.publishingProfile]
+ *
+ * @param {boolean} [parameters.publishingProfile.excludeFromLatest] The flag
+ * means that if it is set to true, people deploying VMs with 'latest' as
+ * version will not use this version.
+ *
+ * @param {date} [parameters.publishingProfile.endOfLifeDate] The end of life
+ * date of the gallery image version.
+ *
+ * @param {array} [parameters.publishingProfile.regions] The regions where the
+ * artifact is going to be published.
+ *
+ * @param {object} [parameters.publishingProfile.source]
+ *
+ * @param {object} [parameters.publishingProfile.source.managedImage]
+ *
+ * @param {string} [parameters.publishingProfile.source.managedImage.id] The
+ * managed artifact id.
+ *
+ * @param {object} [parameters.storageProfile]
+ *
+ * @param {object} [parameters.storageProfile.osDiskImage]
+ *
+ * @param {number} [parameters.storageProfile.osDiskImage.sizedInGB] It
+ * indicates the size of the VHD to create.
+ *
+ * @param {string} [parameters.storageProfile.osDiskImage.hostCaching] The host
+ * caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'.
+ * Possible values include: 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {array} [parameters.storageProfile.dataDiskImages] A list of data
+ * disk images.
+ *
+ * @param {object} [parameters.replicationStatus]
+ *
+ * @param {string} [parameters.replicationStatus.aggregatedState] This is the
+ * aggregated replication status based on the regional replication status.
+ * Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed'
+ *
+ * @param {array} [parameters.replicationStatus.summary] This is a summary of
+ * replication status for each region.
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersion} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, parameters, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') {
+ throw new Error('galleryImageName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageVersionName === null || galleryImageVersionName === undefined || typeof galleryImageVersionName.valueOf() !== 'string') {
+ throw new Error('galleryImageVersionName cannot be null or undefined and it must be of type string.');
+ }
+ if (parameters === null || parameters === undefined) {
+ throw new Error('parameters cannot be null or undefined.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName));
+ requestUrl = requestUrl.replace('{galleryImageVersionName}', encodeURIComponent(galleryImageVersionName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'PUT';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ // Serialize Request
+ let requestContent = null;
+ let requestModel = null;
+ try {
+ if (parameters !== null && parameters !== undefined) {
+ let requestModelMapper = new client.models['GalleryImageVersion']().mapper();
+ requestModel = client.serialize(requestModelMapper, parameters, 'parameters');
+ requestContent = JSON.stringify(requestModel);
+ }
+ } catch (error) {
+ let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
+ `payload - ${JSON.stringify(parameters, null, 2)}.`);
+ return callback(serializationError);
+ }
+ httpRequest.body = requestContent;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 201 && statusCode !== 202) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 201) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImageVersion']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+ // Deserialize Response
+ if (statusCode === 202) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImageVersion']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError1.request = msRest.stripRequest(httpRequest);
+ deserializationError1.response = msRest.stripResponse(response);
+ return callback(deserializationError1);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/** Class representing a GalleryImageVersionOperations. */
+class GalleryImageVersionOperations {
+ /**
+ * Create a GalleryImageVersionOperations.
+ * @param {ComputeManagementClient} client Reference to the service client.
+ */
+ constructor(client) {
+ this.client = client;
+ this._createOrUpdate = _createOrUpdate;
+ this._get = _get;
+ this._deleteMethod = _deleteMethod;
+ this._listGalleryImageVersionsInGalleryImage = _listGalleryImageVersionsInGalleryImage;
+ this._beginCreateOrUpdate = _beginCreateOrUpdate;
+ }
+
+ /**
+ * Create or update a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery image version operation.
+ *
+ * @param {object} [parameters.publishingProfile]
+ *
+ * @param {boolean} [parameters.publishingProfile.excludeFromLatest] The flag
+ * means that if it is set to true, people deploying VMs with 'latest' as
+ * version will not use this version.
+ *
+ * @param {date} [parameters.publishingProfile.endOfLifeDate] The end of life
+ * date of the gallery image version.
+ *
+ * @param {array} [parameters.publishingProfile.regions] The regions where the
+ * artifact is going to be published.
+ *
+ * @param {object} [parameters.publishingProfile.source]
+ *
+ * @param {object} [parameters.publishingProfile.source.managedImage]
+ *
+ * @param {string} [parameters.publishingProfile.source.managedImage.id] The
+ * managed artifact id.
+ *
+ * @param {object} [parameters.storageProfile]
+ *
+ * @param {object} [parameters.storageProfile.osDiskImage]
+ *
+ * @param {number} [parameters.storageProfile.osDiskImage.sizedInGB] It
+ * indicates the size of the VHD to create.
+ *
+ * @param {string} [parameters.storageProfile.osDiskImage.hostCaching] The host
+ * caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'.
+ * Possible values include: 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {array} [parameters.storageProfile.dataDiskImages] A list of data
+ * disk images.
+ *
+ * @param {object} [parameters.replicationStatus]
+ *
+ * @param {string} [parameters.replicationStatus.aggregatedState] This is the
+ * aggregated replication status based on the regional replication status.
+ * Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed'
+ *
+ * @param {array} [parameters.replicationStatus.summary] This is a summary of
+ * replication status for each region.
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ createOrUpdateWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, parameters, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, parameters, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Create or update a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery image version operation.
+ *
+ * @param {object} [parameters.publishingProfile]
+ *
+ * @param {boolean} [parameters.publishingProfile.excludeFromLatest] The flag
+ * means that if it is set to true, people deploying VMs with 'latest' as
+ * version will not use this version.
+ *
+ * @param {date} [parameters.publishingProfile.endOfLifeDate] The end of life
+ * date of the gallery image version.
+ *
+ * @param {array} [parameters.publishingProfile.regions] The regions where the
+ * artifact is going to be published.
+ *
+ * @param {object} [parameters.publishingProfile.source]
+ *
+ * @param {object} [parameters.publishingProfile.source.managedImage]
+ *
+ * @param {string} [parameters.publishingProfile.source.managedImage.id] The
+ * managed artifact id.
+ *
+ * @param {object} [parameters.storageProfile]
+ *
+ * @param {object} [parameters.storageProfile.osDiskImage]
+ *
+ * @param {number} [parameters.storageProfile.osDiskImage.sizedInGB] It
+ * indicates the size of the VHD to create.
+ *
+ * @param {string} [parameters.storageProfile.osDiskImage.hostCaching] The host
+ * caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'.
+ * Possible values include: 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {array} [parameters.storageProfile.dataDiskImages] A list of data
+ * disk images.
+ *
+ * @param {object} [parameters.replicationStatus]
+ *
+ * @param {string} [parameters.replicationStatus.aggregatedState] This is the
+ * aggregated replication status based on the regional replication status.
+ * Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed'
+ *
+ * @param {array} [parameters.replicationStatus.summary] This is a summary of
+ * replication status for each region.
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImageVersion} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersion} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, parameters, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, parameters, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, parameters, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Retrieves information about a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {string} [options.expand] The expand expression to apply on the
+ * operation.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ getWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._get(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Retrieves information about a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {string} [options.expand] The expand expression to apply on the
+ * operation.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImageVersion} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersion} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ get(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._get(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._get(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Delete a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ deleteMethodWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._deleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Delete a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {null} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {null} [result] - The deserialized result object if an error did not occur.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ deleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._deleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._deleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * List gallery image versions under a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listGalleryImageVersionsInGalleryImageWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listGalleryImageVersionsInGalleryImage(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * List gallery image versions under a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImageVersionList} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersionList} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listGalleryImageVersionsInGalleryImage(resourceGroupName, galleryName, galleryImageName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listGalleryImageVersionsInGalleryImage(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listGalleryImageVersionsInGalleryImage(resourceGroupName, galleryName, galleryImageName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Create or update a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery image version operation.
+ *
+ * @param {object} [parameters.publishingProfile]
+ *
+ * @param {boolean} [parameters.publishingProfile.excludeFromLatest] The flag
+ * means that if it is set to true, people deploying VMs with 'latest' as
+ * version will not use this version.
+ *
+ * @param {date} [parameters.publishingProfile.endOfLifeDate] The end of life
+ * date of the gallery image version.
+ *
+ * @param {array} [parameters.publishingProfile.regions] The regions where the
+ * artifact is going to be published.
+ *
+ * @param {object} [parameters.publishingProfile.source]
+ *
+ * @param {object} [parameters.publishingProfile.source.managedImage]
+ *
+ * @param {string} [parameters.publishingProfile.source.managedImage.id] The
+ * managed artifact id.
+ *
+ * @param {object} [parameters.storageProfile]
+ *
+ * @param {object} [parameters.storageProfile.osDiskImage]
+ *
+ * @param {number} [parameters.storageProfile.osDiskImage.sizedInGB] It
+ * indicates the size of the VHD to create.
+ *
+ * @param {string} [parameters.storageProfile.osDiskImage.hostCaching] The host
+ * caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'.
+ * Possible values include: 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {array} [parameters.storageProfile.dataDiskImages] A list of data
+ * disk images.
+ *
+ * @param {object} [parameters.replicationStatus]
+ *
+ * @param {string} [parameters.replicationStatus.aggregatedState] This is the
+ * aggregated replication status based on the regional replication status.
+ * Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed'
+ *
+ * @param {array} [parameters.replicationStatus.summary] This is a summary of
+ * replication status for each region.
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, parameters, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, parameters, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Create or update a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery image version operation.
+ *
+ * @param {object} [parameters.publishingProfile]
+ *
+ * @param {boolean} [parameters.publishingProfile.excludeFromLatest] The flag
+ * means that if it is set to true, people deploying VMs with 'latest' as
+ * version will not use this version.
+ *
+ * @param {date} [parameters.publishingProfile.endOfLifeDate] The end of life
+ * date of the gallery image version.
+ *
+ * @param {array} [parameters.publishingProfile.regions] The regions where the
+ * artifact is going to be published.
+ *
+ * @param {object} [parameters.publishingProfile.source]
+ *
+ * @param {object} [parameters.publishingProfile.source.managedImage]
+ *
+ * @param {string} [parameters.publishingProfile.source.managedImage.id] The
+ * managed artifact id.
+ *
+ * @param {object} [parameters.storageProfile]
+ *
+ * @param {object} [parameters.storageProfile.osDiskImage]
+ *
+ * @param {number} [parameters.storageProfile.osDiskImage.sizedInGB] It
+ * indicates the size of the VHD to create.
+ *
+ * @param {string} [parameters.storageProfile.osDiskImage.hostCaching] The host
+ * caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'.
+ * Possible values include: 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {array} [parameters.storageProfile.dataDiskImages] A list of data
+ * disk images.
+ *
+ * @param {object} [parameters.replicationStatus]
+ *
+ * @param {string} [parameters.replicationStatus.aggregatedState] This is the
+ * aggregated replication status based on the regional replication status.
+ * Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed'
+ *
+ * @param {array} [parameters.replicationStatus.summary] This is a summary of
+ * replication status for each region.
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImageVersion} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersion} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, parameters, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, parameters, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, parameters, options, optionalCallback);
+ }
+ }
+
+}
+
+module.exports = GalleryImageVersionOperations;
diff --git a/lib/services/computeManagement2/lib/operations/galleryImageVersions.js b/lib/services/computeManagement2/lib/operations/galleryImageVersions.js
new file mode 100644
index 0000000000..60c7922175
--- /dev/null
+++ b/lib/services/computeManagement2/lib/operations/galleryImageVersions.js
@@ -0,0 +1,1967 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const msRest = require('ms-rest');
+const msRestAzure = require('ms-rest-azure');
+const WebResource = msRest.WebResource;
+
+
+/**
+ * Create or update a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} galleryImageVersion Parameters supplied to the create or
+ * update gallery image version operation.
+ *
+ * @param {object} [galleryImageVersion.publishingProfile]
+ *
+ * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest]
+ * The flag means that if it is set to true, people deploying VMs with 'latest'
+ * as version will not use this version.
+ *
+ * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end
+ * of life date of the gallery image version.
+ *
+ * @param {array} [galleryImageVersion.publishingProfile.regions] The regions
+ * where the artifact is going to be published.
+ *
+ * @param {object} [galleryImageVersion.publishingProfile.source]
+ *
+ * @param {object} [galleryImageVersion.publishingProfile.source.managedImage]
+ *
+ * @param {string}
+ * [galleryImageVersion.publishingProfile.source.managedImage.id] The managed
+ * artifact id.
+ *
+ * @param {object} [galleryImageVersion.storageProfile]
+ *
+ * @param {object} [galleryImageVersion.storageProfile.osDiskImage]
+ *
+ * @param {number} [galleryImageVersion.storageProfile.osDiskImage.sizedInGB]
+ * It indicates the size of the VHD to create.
+ *
+ * @param {string} [galleryImageVersion.storageProfile.osDiskImage.hostCaching]
+ * The host caching of the disk. Valid values are 'None', 'ReadOnly', and
+ * 'ReadWrite'. Possible values include: 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {array} [galleryImageVersion.storageProfile.dataDiskImages] A list of
+ * data disk images.
+ *
+ * @param {object} [galleryImageVersion.replicationStatus]
+ *
+ * @param {string} [galleryImageVersion.replicationStatus.aggregatedState] This
+ * is the aggregated replication status based on the regional replication
+ * status. Possible values include: 'Unknown', 'InProgress', 'Completed',
+ * 'Failed'
+ *
+ * @param {array} [galleryImageVersion.replicationStatus.summary] This is a
+ * summary of replication status for each region.
+ *
+ * @param {string} galleryImageVersion.location Resource location
+ *
+ * @param {object} [galleryImageVersion.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersion} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+
+ // Send request
+ this.beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, (err, parsedResult, httpRequest, response) => {
+ if (err) return callback(err);
+
+ let initialResult = new msRest.HttpOperationResponse();
+ initialResult.request = httpRequest;
+ initialResult.response = response;
+ initialResult.body = response.body;
+ client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => {
+ if (err) return callback(err);
+
+ // Create Result
+ let result = null;
+
+ httpRequest = pollingResult.request;
+ response = pollingResult.response;
+ let responseBody = pollingResult.body;
+ if (responseBody === '') responseBody = null;
+
+ // Deserialize Response
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImageVersion']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+ });
+}
+
+/**
+ * Retrieves information about a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {string} [options.expand] The expand expression to apply on the
+ * operation. Possible values include: 'ReplicationStatus'
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersion} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _get(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let expand = (options && options.expand !== undefined) ? options.expand : undefined;
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') {
+ throw new Error('galleryImageName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageVersionName === null || galleryImageVersionName === undefined || typeof galleryImageVersionName.valueOf() !== 'string') {
+ throw new Error('galleryImageVersionName cannot be null or undefined and it must be of type string.');
+ }
+ if (expand) {
+ let allowedValues = [ 'ReplicationStatus' ];
+ 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName));
+ requestUrl = requestUrl.replace('{galleryImageVersionName}', encodeURIComponent(galleryImageVersionName));
+ let queryParameters = [];
+ if (expand !== null && expand !== undefined) {
+ queryParameters.push('$expand=' + encodeURIComponent(expand));
+ }
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImageVersion']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+
+/**
+ * Delete a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link OperationStatusResponse} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _deleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+
+ // Send request
+ this.beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, (err, parsedResult, httpRequest, response) => {
+ if (err) return callback(err);
+
+ let initialResult = new msRest.HttpOperationResponse();
+ initialResult.request = httpRequest;
+ initialResult.response = response;
+ initialResult.body = response.body;
+ client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => {
+ if (err) return callback(err);
+
+ // Create Result
+ let result = null;
+
+ httpRequest = pollingResult.request;
+ response = pollingResult.response;
+ let responseBody = pollingResult.body;
+ if (responseBody === '') responseBody = null;
+
+ // Deserialize Response
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['OperationStatusResponse']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+ });
+}
+
+/**
+ * List gallery image versions under a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersionList} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _listGalleryImageVersionsByGalleryImage(resourceGroupName, galleryName, galleryImageName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') {
+ throw new Error('galleryImageName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImageVersionList']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Create or update a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} galleryImageVersion Parameters supplied to the create or
+ * update gallery image version operation.
+ *
+ * @param {object} [galleryImageVersion.publishingProfile]
+ *
+ * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest]
+ * The flag means that if it is set to true, people deploying VMs with 'latest'
+ * as version will not use this version.
+ *
+ * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end
+ * of life date of the gallery image version.
+ *
+ * @param {array} [galleryImageVersion.publishingProfile.regions] The regions
+ * where the artifact is going to be published.
+ *
+ * @param {object} [galleryImageVersion.publishingProfile.source]
+ *
+ * @param {object} [galleryImageVersion.publishingProfile.source.managedImage]
+ *
+ * @param {string}
+ * [galleryImageVersion.publishingProfile.source.managedImage.id] The managed
+ * artifact id.
+ *
+ * @param {object} [galleryImageVersion.storageProfile]
+ *
+ * @param {object} [galleryImageVersion.storageProfile.osDiskImage]
+ *
+ * @param {number} [galleryImageVersion.storageProfile.osDiskImage.sizedInGB]
+ * It indicates the size of the VHD to create.
+ *
+ * @param {string} [galleryImageVersion.storageProfile.osDiskImage.hostCaching]
+ * The host caching of the disk. Valid values are 'None', 'ReadOnly', and
+ * 'ReadWrite'. Possible values include: 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {array} [galleryImageVersion.storageProfile.dataDiskImages] A list of
+ * data disk images.
+ *
+ * @param {object} [galleryImageVersion.replicationStatus]
+ *
+ * @param {string} [galleryImageVersion.replicationStatus.aggregatedState] This
+ * is the aggregated replication status based on the regional replication
+ * status. Possible values include: 'Unknown', 'InProgress', 'Completed',
+ * 'Failed'
+ *
+ * @param {array} [galleryImageVersion.replicationStatus.summary] This is a
+ * summary of replication status for each region.
+ *
+ * @param {string} galleryImageVersion.location Resource location
+ *
+ * @param {object} [galleryImageVersion.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersion} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') {
+ throw new Error('galleryImageName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageVersionName === null || galleryImageVersionName === undefined || typeof galleryImageVersionName.valueOf() !== 'string') {
+ throw new Error('galleryImageVersionName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageVersion === null || galleryImageVersion === undefined) {
+ throw new Error('galleryImageVersion cannot be null or undefined.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName));
+ requestUrl = requestUrl.replace('{galleryImageVersionName}', encodeURIComponent(galleryImageVersionName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'PUT';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ // Serialize Request
+ let requestContent = null;
+ let requestModel = null;
+ try {
+ if (galleryImageVersion !== null && galleryImageVersion !== undefined) {
+ let requestModelMapper = new client.models['GalleryImageVersion']().mapper();
+ requestModel = client.serialize(requestModelMapper, galleryImageVersion, 'galleryImageVersion');
+ requestContent = JSON.stringify(requestModel);
+ }
+ } catch (error) {
+ let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
+ `payload - ${JSON.stringify(galleryImageVersion, null, 2)}.`);
+ return callback(serializationError);
+ }
+ httpRequest.body = requestContent;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200 && statusCode !== 201) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImageVersion']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+ // Deserialize Response
+ if (statusCode === 201) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImageVersion']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError1.request = msRest.stripRequest(httpRequest);
+ deserializationError1.response = msRest.stripResponse(response);
+ return callback(deserializationError1);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Delete a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link OperationStatusResponse} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') {
+ throw new Error('galleryImageName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageVersionName === null || galleryImageVersionName === undefined || typeof galleryImageVersionName.valueOf() !== 'string') {
+ throw new Error('galleryImageVersionName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName));
+ requestUrl = requestUrl.replace('{galleryImageVersionName}', encodeURIComponent(galleryImageVersionName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'DELETE';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['OperationStatusResponse']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * List gallery image versions under a gallery image.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersionList} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _listGalleryImageVersionsByGalleryImageNext(nextPageLink, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ // Validate
+ try {
+ if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
+ throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let requestUrl = '{nextLink}';
+ requestUrl = requestUrl.replace('{nextLink}', nextPageLink);
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImageVersionList']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/** Class representing a GalleryImageVersions. */
+class GalleryImageVersions {
+ /**
+ * Create a GalleryImageVersions.
+ * @param {ComputeManagementClient} client Reference to the service client.
+ */
+ constructor(client) {
+ this.client = client;
+ this._createOrUpdate = _createOrUpdate;
+ this._get = _get;
+ this._deleteMethod = _deleteMethod;
+ this._listGalleryImageVersionsByGalleryImage = _listGalleryImageVersionsByGalleryImage;
+ this._beginCreateOrUpdate = _beginCreateOrUpdate;
+ this._beginDeleteMethod = _beginDeleteMethod;
+ this._listGalleryImageVersionsByGalleryImageNext = _listGalleryImageVersionsByGalleryImageNext;
+ }
+
+ /**
+ * Create or update a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} galleryImageVersion Parameters supplied to the create or
+ * update gallery image version operation.
+ *
+ * @param {object} [galleryImageVersion.publishingProfile]
+ *
+ * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest]
+ * The flag means that if it is set to true, people deploying VMs with 'latest'
+ * as version will not use this version.
+ *
+ * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end
+ * of life date of the gallery image version.
+ *
+ * @param {array} [galleryImageVersion.publishingProfile.regions] The regions
+ * where the artifact is going to be published.
+ *
+ * @param {object} [galleryImageVersion.publishingProfile.source]
+ *
+ * @param {object} [galleryImageVersion.publishingProfile.source.managedImage]
+ *
+ * @param {string}
+ * [galleryImageVersion.publishingProfile.source.managedImage.id] The managed
+ * artifact id.
+ *
+ * @param {object} [galleryImageVersion.storageProfile]
+ *
+ * @param {object} [galleryImageVersion.storageProfile.osDiskImage]
+ *
+ * @param {number} [galleryImageVersion.storageProfile.osDiskImage.sizedInGB]
+ * It indicates the size of the VHD to create.
+ *
+ * @param {string} [galleryImageVersion.storageProfile.osDiskImage.hostCaching]
+ * The host caching of the disk. Valid values are 'None', 'ReadOnly', and
+ * 'ReadWrite'. Possible values include: 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {array} [galleryImageVersion.storageProfile.dataDiskImages] A list of
+ * data disk images.
+ *
+ * @param {object} [galleryImageVersion.replicationStatus]
+ *
+ * @param {string} [galleryImageVersion.replicationStatus.aggregatedState] This
+ * is the aggregated replication status based on the regional replication
+ * status. Possible values include: 'Unknown', 'InProgress', 'Completed',
+ * 'Failed'
+ *
+ * @param {array} [galleryImageVersion.replicationStatus.summary] This is a
+ * summary of replication status for each region.
+ *
+ * @param {string} galleryImageVersion.location Resource location
+ *
+ * @param {object} [galleryImageVersion.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ createOrUpdateWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Create or update a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} galleryImageVersion Parameters supplied to the create or
+ * update gallery image version operation.
+ *
+ * @param {object} [galleryImageVersion.publishingProfile]
+ *
+ * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest]
+ * The flag means that if it is set to true, people deploying VMs with 'latest'
+ * as version will not use this version.
+ *
+ * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end
+ * of life date of the gallery image version.
+ *
+ * @param {array} [galleryImageVersion.publishingProfile.regions] The regions
+ * where the artifact is going to be published.
+ *
+ * @param {object} [galleryImageVersion.publishingProfile.source]
+ *
+ * @param {object} [galleryImageVersion.publishingProfile.source.managedImage]
+ *
+ * @param {string}
+ * [galleryImageVersion.publishingProfile.source.managedImage.id] The managed
+ * artifact id.
+ *
+ * @param {object} [galleryImageVersion.storageProfile]
+ *
+ * @param {object} [galleryImageVersion.storageProfile.osDiskImage]
+ *
+ * @param {number} [galleryImageVersion.storageProfile.osDiskImage.sizedInGB]
+ * It indicates the size of the VHD to create.
+ *
+ * @param {string} [galleryImageVersion.storageProfile.osDiskImage.hostCaching]
+ * The host caching of the disk. Valid values are 'None', 'ReadOnly', and
+ * 'ReadWrite'. Possible values include: 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {array} [galleryImageVersion.storageProfile.dataDiskImages] A list of
+ * data disk images.
+ *
+ * @param {object} [galleryImageVersion.replicationStatus]
+ *
+ * @param {string} [galleryImageVersion.replicationStatus.aggregatedState] This
+ * is the aggregated replication status based on the regional replication
+ * status. Possible values include: 'Unknown', 'InProgress', 'Completed',
+ * 'Failed'
+ *
+ * @param {array} [galleryImageVersion.replicationStatus.summary] This is a
+ * summary of replication status for each region.
+ *
+ * @param {string} galleryImageVersion.location Resource location
+ *
+ * @param {object} [galleryImageVersion.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImageVersion} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersion} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Retrieves information about a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {string} [options.expand] The expand expression to apply on the
+ * operation. Possible values include: 'ReplicationStatus'
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ getWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._get(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Retrieves information about a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {string} [options.expand] The expand expression to apply on the
+ * operation. Possible values include: 'ReplicationStatus'
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImageVersion} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersion} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ get(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._get(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._get(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Delete a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ deleteMethodWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._deleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Delete a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {OperationStatusResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link OperationStatusResponse} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ deleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._deleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._deleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * List gallery image versions under a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listGalleryImageVersionsByGalleryImageWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listGalleryImageVersionsByGalleryImage(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * List gallery image versions under a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImageVersionList} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersionList} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listGalleryImageVersionsByGalleryImage(resourceGroupName, galleryName, galleryImageName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listGalleryImageVersionsByGalleryImage(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listGalleryImageVersionsByGalleryImage(resourceGroupName, galleryName, galleryImageName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Create or update a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} galleryImageVersion Parameters supplied to the create or
+ * update gallery image version operation.
+ *
+ * @param {object} [galleryImageVersion.publishingProfile]
+ *
+ * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest]
+ * The flag means that if it is set to true, people deploying VMs with 'latest'
+ * as version will not use this version.
+ *
+ * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end
+ * of life date of the gallery image version.
+ *
+ * @param {array} [galleryImageVersion.publishingProfile.regions] The regions
+ * where the artifact is going to be published.
+ *
+ * @param {object} [galleryImageVersion.publishingProfile.source]
+ *
+ * @param {object} [galleryImageVersion.publishingProfile.source.managedImage]
+ *
+ * @param {string}
+ * [galleryImageVersion.publishingProfile.source.managedImage.id] The managed
+ * artifact id.
+ *
+ * @param {object} [galleryImageVersion.storageProfile]
+ *
+ * @param {object} [galleryImageVersion.storageProfile.osDiskImage]
+ *
+ * @param {number} [galleryImageVersion.storageProfile.osDiskImage.sizedInGB]
+ * It indicates the size of the VHD to create.
+ *
+ * @param {string} [galleryImageVersion.storageProfile.osDiskImage.hostCaching]
+ * The host caching of the disk. Valid values are 'None', 'ReadOnly', and
+ * 'ReadWrite'. Possible values include: 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {array} [galleryImageVersion.storageProfile.dataDiskImages] A list of
+ * data disk images.
+ *
+ * @param {object} [galleryImageVersion.replicationStatus]
+ *
+ * @param {string} [galleryImageVersion.replicationStatus.aggregatedState] This
+ * is the aggregated replication status based on the regional replication
+ * status. Possible values include: 'Unknown', 'InProgress', 'Completed',
+ * 'Failed'
+ *
+ * @param {array} [galleryImageVersion.replicationStatus.summary] This is a
+ * summary of replication status for each region.
+ *
+ * @param {string} galleryImageVersion.location Resource location
+ *
+ * @param {object} [galleryImageVersion.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Create or update a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} galleryImageVersion Parameters supplied to the create or
+ * update gallery image version operation.
+ *
+ * @param {object} [galleryImageVersion.publishingProfile]
+ *
+ * @param {boolean} [galleryImageVersion.publishingProfile.excludeFromLatest]
+ * The flag means that if it is set to true, people deploying VMs with 'latest'
+ * as version will not use this version.
+ *
+ * @param {date} [galleryImageVersion.publishingProfile.endOfLifeDate] The end
+ * of life date of the gallery image version.
+ *
+ * @param {array} [galleryImageVersion.publishingProfile.regions] The regions
+ * where the artifact is going to be published.
+ *
+ * @param {object} [galleryImageVersion.publishingProfile.source]
+ *
+ * @param {object} [galleryImageVersion.publishingProfile.source.managedImage]
+ *
+ * @param {string}
+ * [galleryImageVersion.publishingProfile.source.managedImage.id] The managed
+ * artifact id.
+ *
+ * @param {object} [galleryImageVersion.storageProfile]
+ *
+ * @param {object} [galleryImageVersion.storageProfile.osDiskImage]
+ *
+ * @param {number} [galleryImageVersion.storageProfile.osDiskImage.sizedInGB]
+ * It indicates the size of the VHD to create.
+ *
+ * @param {string} [galleryImageVersion.storageProfile.osDiskImage.hostCaching]
+ * The host caching of the disk. Valid values are 'None', 'ReadOnly', and
+ * 'ReadWrite'. Possible values include: 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {array} [galleryImageVersion.storageProfile.dataDiskImages] A list of
+ * data disk images.
+ *
+ * @param {object} [galleryImageVersion.replicationStatus]
+ *
+ * @param {string} [galleryImageVersion.replicationStatus.aggregatedState] This
+ * is the aggregated replication status based on the regional replication
+ * status. Possible values include: 'Unknown', 'InProgress', 'Completed',
+ * 'Failed'
+ *
+ * @param {array} [galleryImageVersion.replicationStatus.summary] This is a
+ * summary of replication status for each region.
+ *
+ * @param {string} galleryImageVersion.location Resource location
+ *
+ * @param {object} [galleryImageVersion.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImageVersion} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersion} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Delete a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ beginDeleteMethodWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Delete a gallery image version.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {string} galleryImageVersionName The name of the gallery image
+ * version.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {OperationStatusResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link OperationStatusResponse} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * List gallery image versions under a gallery image.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listGalleryImageVersionsByGalleryImageNextWithHttpOperationResponse(nextPageLink, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listGalleryImageVersionsByGalleryImageNext(nextPageLink, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * List gallery image versions under a gallery image.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImageVersionList} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageVersionList} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listGalleryImageVersionsByGalleryImageNext(nextPageLink, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listGalleryImageVersionsByGalleryImageNext(nextPageLink, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listGalleryImageVersionsByGalleryImageNext(nextPageLink, options, optionalCallback);
+ }
+ }
+
+}
+
+module.exports = GalleryImageVersions;
diff --git a/lib/services/computeManagement2/lib/operations/galleryImages.js b/lib/services/computeManagement2/lib/operations/galleryImages.js
new file mode 100644
index 0000000000..43ddc1bc74
--- /dev/null
+++ b/lib/services/computeManagement2/lib/operations/galleryImages.js
@@ -0,0 +1,1949 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const msRest = require('ms-rest');
+const msRestAzure = require('ms-rest-azure');
+const WebResource = msRest.WebResource;
+
+
+/**
+ * Create or update a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} galleryImage Parameters supplied to the create or update
+ * gallery image operation.
+ *
+ * @param {string} [galleryImage.description] The description of this gallery
+ * image resource.
+ *
+ * @param {string} [galleryImage.eula] The Eula agreement for the gallery
+ * image.
+ *
+ * @param {string} [galleryImage.privacyStatementUri] The privacy statement
+ * uri.
+ *
+ * @param {string} [galleryImage.releaseNoteUri] The release note uri.
+ *
+ * @param {string} [galleryImage.osType] This property allows you to specify
+ * the type of the OS that is included in the disk if creating a VM from
+ * user-image or a specialized VHD.
Possible values are:
+ * **Windows**
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} [galleryImage.osState] The OS State. Possible values
+ * include: 'Generalized', 'Specialized'
+ *
+ * @param {date} [galleryImage.endOfLifeDate] The end of life of this gallery
+ * image.
+ *
+ * @param {object} [galleryImage.identifier]
+ *
+ * @param {string} [galleryImage.identifier.publisher] The gallery image
+ * publisher name.
+ *
+ * @param {string} [galleryImage.identifier.offer] The gallery image offer
+ * name.
+ *
+ * @param {string} [galleryImage.identifier.sku] The gallery image sku name.
+ *
+ * @param {object} [galleryImage.recommended]
+ *
+ * @param {object} [galleryImage.recommended.vCPUs]
+ *
+ * @param {object} [galleryImage.recommended.memory]
+ *
+ * @param {number} [galleryImage.recommended.memory.min] The minimum number of
+ * the resource.
+ *
+ * @param {number} [galleryImage.recommended.memory.max] The maximum number of
+ * the resource.
+ *
+ * @param {object} [galleryImage.disallowed]
+ *
+ * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types.
+ *
+ * @param {object} [galleryImage.purchasePlan]
+ *
+ * @param {string} [galleryImage.purchasePlan.name] The plan ID.
+ *
+ * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID.
+ *
+ * @param {string} [galleryImage.purchasePlan.product] The product ID.
+ *
+ * @param {string} galleryImage.location Resource location
+ *
+ * @param {object} [galleryImage.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImage} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+
+ // Send request
+ this.beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, (err, parsedResult, httpRequest, response) => {
+ if (err) return callback(err);
+
+ let initialResult = new msRest.HttpOperationResponse();
+ initialResult.request = httpRequest;
+ initialResult.response = response;
+ initialResult.body = response.body;
+ client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => {
+ if (err) return callback(err);
+
+ // Create Result
+ let result = null;
+
+ httpRequest = pollingResult.request;
+ response = pollingResult.response;
+ let responseBody = pollingResult.body;
+ if (responseBody === '') responseBody = null;
+
+ // Deserialize Response
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImage']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+ });
+}
+
+/**
+ * Retrieves information about a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImage} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _get(resourceGroupName, galleryName, galleryImageName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') {
+ throw new Error('galleryImageName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImage']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+
+/**
+ * Delete a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link OperationStatusResponse} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _deleteMethod(resourceGroupName, galleryName, galleryImageName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+
+ // Send request
+ this.beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, options, (err, parsedResult, httpRequest, response) => {
+ if (err) return callback(err);
+
+ let initialResult = new msRest.HttpOperationResponse();
+ initialResult.request = httpRequest;
+ initialResult.response = response;
+ initialResult.body = response.body;
+ client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => {
+ if (err) return callback(err);
+
+ // Create Result
+ let result = null;
+
+ httpRequest = pollingResult.request;
+ response = pollingResult.response;
+ let responseBody = pollingResult.body;
+ if (responseBody === '') responseBody = null;
+
+ // Deserialize Response
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['OperationStatusResponse']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+ });
+}
+
+/**
+ * List gallery images under a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _listGalleryImagesByGallery(resourceGroupName, galleryName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImageList']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Create or update a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} galleryImage Parameters supplied to the create or update
+ * gallery image operation.
+ *
+ * @param {string} [galleryImage.description] The description of this gallery
+ * image resource.
+ *
+ * @param {string} [galleryImage.eula] The Eula agreement for the gallery
+ * image.
+ *
+ * @param {string} [galleryImage.privacyStatementUri] The privacy statement
+ * uri.
+ *
+ * @param {string} [galleryImage.releaseNoteUri] The release note uri.
+ *
+ * @param {string} [galleryImage.osType] This property allows you to specify
+ * the type of the OS that is included in the disk if creating a VM from
+ * user-image or a specialized VHD.
Possible values are:
+ * **Windows**
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} [galleryImage.osState] The OS State. Possible values
+ * include: 'Generalized', 'Specialized'
+ *
+ * @param {date} [galleryImage.endOfLifeDate] The end of life of this gallery
+ * image.
+ *
+ * @param {object} [galleryImage.identifier]
+ *
+ * @param {string} [galleryImage.identifier.publisher] The gallery image
+ * publisher name.
+ *
+ * @param {string} [galleryImage.identifier.offer] The gallery image offer
+ * name.
+ *
+ * @param {string} [galleryImage.identifier.sku] The gallery image sku name.
+ *
+ * @param {object} [galleryImage.recommended]
+ *
+ * @param {object} [galleryImage.recommended.vCPUs]
+ *
+ * @param {object} [galleryImage.recommended.memory]
+ *
+ * @param {number} [galleryImage.recommended.memory.min] The minimum number of
+ * the resource.
+ *
+ * @param {number} [galleryImage.recommended.memory.max] The maximum number of
+ * the resource.
+ *
+ * @param {object} [galleryImage.disallowed]
+ *
+ * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types.
+ *
+ * @param {object} [galleryImage.purchasePlan]
+ *
+ * @param {string} [galleryImage.purchasePlan.name] The plan ID.
+ *
+ * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID.
+ *
+ * @param {string} [galleryImage.purchasePlan.product] The product ID.
+ *
+ * @param {string} galleryImage.location Resource location
+ *
+ * @param {object} [galleryImage.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImage} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') {
+ throw new Error('galleryImageName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImage === null || galleryImage === undefined) {
+ throw new Error('galleryImage cannot be null or undefined.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'PUT';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ // Serialize Request
+ let requestContent = null;
+ let requestModel = null;
+ try {
+ if (galleryImage !== null && galleryImage !== undefined) {
+ let requestModelMapper = new client.models['GalleryImage']().mapper();
+ requestModel = client.serialize(requestModelMapper, galleryImage, 'galleryImage');
+ requestContent = JSON.stringify(requestModel);
+ }
+ } catch (error) {
+ let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
+ `payload - ${JSON.stringify(galleryImage, null, 2)}.`);
+ return callback(serializationError);
+ }
+ httpRequest.body = requestContent;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200 && statusCode !== 201) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImage']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+ // Deserialize Response
+ if (statusCode === 201) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImage']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError1.request = msRest.stripRequest(httpRequest);
+ deserializationError1.response = msRest.stripResponse(response);
+ return callback(deserializationError1);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Delete a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link OperationStatusResponse} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryImageName === null || galleryImageName === undefined || typeof galleryImageName.valueOf() !== 'string') {
+ throw new Error('galleryImageName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ requestUrl = requestUrl.replace('{galleryImageName}', encodeURIComponent(galleryImageName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'DELETE';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['OperationStatusResponse']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * List gallery images under a gallery.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _listGalleryImagesByGalleryNext(nextPageLink, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ // Validate
+ try {
+ if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
+ throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let requestUrl = '{nextLink}';
+ requestUrl = requestUrl.replace('{nextLink}', nextPageLink);
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryImageList']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/** Class representing a GalleryImages. */
+class GalleryImages {
+ /**
+ * Create a GalleryImages.
+ * @param {ComputeManagementClient} client Reference to the service client.
+ */
+ constructor(client) {
+ this.client = client;
+ this._createOrUpdate = _createOrUpdate;
+ this._get = _get;
+ this._deleteMethod = _deleteMethod;
+ this._listGalleryImagesByGallery = _listGalleryImagesByGallery;
+ this._beginCreateOrUpdate = _beginCreateOrUpdate;
+ this._beginDeleteMethod = _beginDeleteMethod;
+ this._listGalleryImagesByGalleryNext = _listGalleryImagesByGalleryNext;
+ }
+
+ /**
+ * Create or update a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} galleryImage Parameters supplied to the create or update
+ * gallery image operation.
+ *
+ * @param {string} [galleryImage.description] The description of this gallery
+ * image resource.
+ *
+ * @param {string} [galleryImage.eula] The Eula agreement for the gallery
+ * image.
+ *
+ * @param {string} [galleryImage.privacyStatementUri] The privacy statement
+ * uri.
+ *
+ * @param {string} [galleryImage.releaseNoteUri] The release note uri.
+ *
+ * @param {string} [galleryImage.osType] This property allows you to specify
+ * the type of the OS that is included in the disk if creating a VM from
+ * user-image or a specialized VHD.
Possible values are:
+ * **Windows**
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} [galleryImage.osState] The OS State. Possible values
+ * include: 'Generalized', 'Specialized'
+ *
+ * @param {date} [galleryImage.endOfLifeDate] The end of life of this gallery
+ * image.
+ *
+ * @param {object} [galleryImage.identifier]
+ *
+ * @param {string} [galleryImage.identifier.publisher] The gallery image
+ * publisher name.
+ *
+ * @param {string} [galleryImage.identifier.offer] The gallery image offer
+ * name.
+ *
+ * @param {string} [galleryImage.identifier.sku] The gallery image sku name.
+ *
+ * @param {object} [galleryImage.recommended]
+ *
+ * @param {object} [galleryImage.recommended.vCPUs]
+ *
+ * @param {object} [galleryImage.recommended.memory]
+ *
+ * @param {number} [galleryImage.recommended.memory.min] The minimum number of
+ * the resource.
+ *
+ * @param {number} [galleryImage.recommended.memory.max] The maximum number of
+ * the resource.
+ *
+ * @param {object} [galleryImage.disallowed]
+ *
+ * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types.
+ *
+ * @param {object} [galleryImage.purchasePlan]
+ *
+ * @param {string} [galleryImage.purchasePlan.name] The plan ID.
+ *
+ * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID.
+ *
+ * @param {string} [galleryImage.purchasePlan.product] The product ID.
+ *
+ * @param {string} galleryImage.location Resource location
+ *
+ * @param {object} [galleryImage.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ createOrUpdateWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, galleryImage, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Create or update a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} galleryImage Parameters supplied to the create or update
+ * gallery image operation.
+ *
+ * @param {string} [galleryImage.description] The description of this gallery
+ * image resource.
+ *
+ * @param {string} [galleryImage.eula] The Eula agreement for the gallery
+ * image.
+ *
+ * @param {string} [galleryImage.privacyStatementUri] The privacy statement
+ * uri.
+ *
+ * @param {string} [galleryImage.releaseNoteUri] The release note uri.
+ *
+ * @param {string} [galleryImage.osType] This property allows you to specify
+ * the type of the OS that is included in the disk if creating a VM from
+ * user-image or a specialized VHD.
Possible values are:
+ * **Windows**
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} [galleryImage.osState] The OS State. Possible values
+ * include: 'Generalized', 'Specialized'
+ *
+ * @param {date} [galleryImage.endOfLifeDate] The end of life of this gallery
+ * image.
+ *
+ * @param {object} [galleryImage.identifier]
+ *
+ * @param {string} [galleryImage.identifier.publisher] The gallery image
+ * publisher name.
+ *
+ * @param {string} [galleryImage.identifier.offer] The gallery image offer
+ * name.
+ *
+ * @param {string} [galleryImage.identifier.sku] The gallery image sku name.
+ *
+ * @param {object} [galleryImage.recommended]
+ *
+ * @param {object} [galleryImage.recommended.vCPUs]
+ *
+ * @param {object} [galleryImage.recommended.memory]
+ *
+ * @param {number} [galleryImage.recommended.memory.min] The minimum number of
+ * the resource.
+ *
+ * @param {number} [galleryImage.recommended.memory.max] The maximum number of
+ * the resource.
+ *
+ * @param {object} [galleryImage.disallowed]
+ *
+ * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types.
+ *
+ * @param {object} [galleryImage.purchasePlan]
+ *
+ * @param {string} [galleryImage.purchasePlan.name] The plan ID.
+ *
+ * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID.
+ *
+ * @param {string} [galleryImage.purchasePlan.product] The product ID.
+ *
+ * @param {string} galleryImage.location Resource location
+ *
+ * @param {object} [galleryImage.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImage} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImage} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._createOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Retrieves information about a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ getWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._get(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Retrieves information about a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImage} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImage} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ get(resourceGroupName, galleryName, galleryImageName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._get(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._get(resourceGroupName, galleryName, galleryImageName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Delete a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ deleteMethodWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._deleteMethod(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Delete a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {OperationStatusResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link OperationStatusResponse} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ deleteMethod(resourceGroupName, galleryName, galleryImageName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._deleteMethod(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._deleteMethod(resourceGroupName, galleryName, galleryImageName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * List gallery images under a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listGalleryImagesByGalleryWithHttpOperationResponse(resourceGroupName, galleryName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listGalleryImagesByGallery(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * List gallery images under a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImageList} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listGalleryImagesByGallery(resourceGroupName, galleryName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listGalleryImagesByGallery(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listGalleryImagesByGallery(resourceGroupName, galleryName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Create or update a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} galleryImage Parameters supplied to the create or update
+ * gallery image operation.
+ *
+ * @param {string} [galleryImage.description] The description of this gallery
+ * image resource.
+ *
+ * @param {string} [galleryImage.eula] The Eula agreement for the gallery
+ * image.
+ *
+ * @param {string} [galleryImage.privacyStatementUri] The privacy statement
+ * uri.
+ *
+ * @param {string} [galleryImage.releaseNoteUri] The release note uri.
+ *
+ * @param {string} [galleryImage.osType] This property allows you to specify
+ * the type of the OS that is included in the disk if creating a VM from
+ * user-image or a specialized VHD.
Possible values are:
+ * **Windows**
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} [galleryImage.osState] The OS State. Possible values
+ * include: 'Generalized', 'Specialized'
+ *
+ * @param {date} [galleryImage.endOfLifeDate] The end of life of this gallery
+ * image.
+ *
+ * @param {object} [galleryImage.identifier]
+ *
+ * @param {string} [galleryImage.identifier.publisher] The gallery image
+ * publisher name.
+ *
+ * @param {string} [galleryImage.identifier.offer] The gallery image offer
+ * name.
+ *
+ * @param {string} [galleryImage.identifier.sku] The gallery image sku name.
+ *
+ * @param {object} [galleryImage.recommended]
+ *
+ * @param {object} [galleryImage.recommended.vCPUs]
+ *
+ * @param {object} [galleryImage.recommended.memory]
+ *
+ * @param {number} [galleryImage.recommended.memory.min] The minimum number of
+ * the resource.
+ *
+ * @param {number} [galleryImage.recommended.memory.max] The maximum number of
+ * the resource.
+ *
+ * @param {object} [galleryImage.disallowed]
+ *
+ * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types.
+ *
+ * @param {object} [galleryImage.purchasePlan]
+ *
+ * @param {string} [galleryImage.purchasePlan.name] The plan ID.
+ *
+ * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID.
+ *
+ * @param {string} [galleryImage.purchasePlan.product] The product ID.
+ *
+ * @param {string} galleryImage.location Resource location
+ *
+ * @param {object} [galleryImage.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, galleryImage, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Create or update a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} galleryImage Parameters supplied to the create or update
+ * gallery image operation.
+ *
+ * @param {string} [galleryImage.description] The description of this gallery
+ * image resource.
+ *
+ * @param {string} [galleryImage.eula] The Eula agreement for the gallery
+ * image.
+ *
+ * @param {string} [galleryImage.privacyStatementUri] The privacy statement
+ * uri.
+ *
+ * @param {string} [galleryImage.releaseNoteUri] The release note uri.
+ *
+ * @param {string} [galleryImage.osType] This property allows you to specify
+ * the type of the OS that is included in the disk if creating a VM from
+ * user-image or a specialized VHD.
Possible values are:
+ * **Windows**
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} [galleryImage.osState] The OS State. Possible values
+ * include: 'Generalized', 'Specialized'
+ *
+ * @param {date} [galleryImage.endOfLifeDate] The end of life of this gallery
+ * image.
+ *
+ * @param {object} [galleryImage.identifier]
+ *
+ * @param {string} [galleryImage.identifier.publisher] The gallery image
+ * publisher name.
+ *
+ * @param {string} [galleryImage.identifier.offer] The gallery image offer
+ * name.
+ *
+ * @param {string} [galleryImage.identifier.sku] The gallery image sku name.
+ *
+ * @param {object} [galleryImage.recommended]
+ *
+ * @param {object} [galleryImage.recommended.vCPUs]
+ *
+ * @param {object} [galleryImage.recommended.memory]
+ *
+ * @param {number} [galleryImage.recommended.memory.min] The minimum number of
+ * the resource.
+ *
+ * @param {number} [galleryImage.recommended.memory.max] The maximum number of
+ * the resource.
+ *
+ * @param {object} [galleryImage.disallowed]
+ *
+ * @param {array} [galleryImage.disallowed.diskTypes] A list of disk types.
+ *
+ * @param {object} [galleryImage.purchasePlan]
+ *
+ * @param {string} [galleryImage.purchasePlan.name] The plan ID.
+ *
+ * @param {string} [galleryImage.purchasePlan.publisher] The publisher ID.
+ *
+ * @param {string} [galleryImage.purchasePlan.product] The product ID.
+ *
+ * @param {string} galleryImage.location Resource location
+ *
+ * @param {object} [galleryImage.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImage} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImage} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._beginCreateOrUpdate(resourceGroupName, galleryName, galleryImageName, galleryImage, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Delete a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ beginDeleteMethodWithHttpOperationResponse(resourceGroupName, galleryName, galleryImageName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Delete a gallery image.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {string} galleryImageName The name of the gallery image.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {OperationStatusResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link OperationStatusResponse} for more
+ * information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._beginDeleteMethod(resourceGroupName, galleryName, galleryImageName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * List gallery images under a gallery.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listGalleryImagesByGalleryNextWithHttpOperationResponse(nextPageLink, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listGalleryImagesByGalleryNext(nextPageLink, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * List gallery images under a gallery.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryImageList} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryImageList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listGalleryImagesByGalleryNext(nextPageLink, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listGalleryImagesByGalleryNext(nextPageLink, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listGalleryImagesByGalleryNext(nextPageLink, options, optionalCallback);
+ }
+ }
+
+}
+
+module.exports = GalleryImages;
diff --git a/lib/services/computeManagement2/lib/operations/galleryOperations.js b/lib/services/computeManagement2/lib/operations/galleryOperations.js
new file mode 100644
index 0000000000..983c8a3208
--- /dev/null
+++ b/lib/services/computeManagement2/lib/operations/galleryOperations.js
@@ -0,0 +1,1550 @@
+/*
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+'use strict';
+
+const msRest = require('ms-rest');
+const msRestAzure = require('ms-rest-azure');
+const WebResource = msRest.WebResource;
+
+
+/**
+ * Create or update a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery operation.
+ *
+ * @param {string} [parameters.description] The description of this gallery
+ * resource.
+ *
+ * @param {object} [parameters.identifier]
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link Gallery} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _createOrUpdate(resourceGroupName, galleryName, parameters, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+
+ // Send request
+ this.beginCreateOrUpdate(resourceGroupName, galleryName, parameters, options, (err, parsedResult, httpRequest, response) => {
+ if (err) return callback(err);
+
+ let initialResult = new msRest.HttpOperationResponse();
+ initialResult.request = httpRequest;
+ initialResult.response = response;
+ initialResult.body = response.body;
+ client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => {
+ if (err) return callback(err);
+
+ // Create Result
+ let result = null;
+
+ httpRequest = pollingResult.request;
+ response = pollingResult.response;
+ let responseBody = pollingResult.body;
+ if (responseBody === '') responseBody = null;
+
+ // Deserialize Response
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['Gallery']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+ });
+}
+
+/**
+ * Retrieves information about a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link Gallery} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _get(resourceGroupName, galleryName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['Gallery']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+
+/**
+ * Delete a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {null} [result] - The deserialized result object if an error did not occur.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _deleteMethod(resourceGroupName, galleryName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+
+ // Send request
+ this.beginDeleteMethod(resourceGroupName, galleryName, options, (err, parsedResult, httpRequest, response) => {
+ if (err) return callback(err);
+
+ let initialResult = new msRest.HttpOperationResponse();
+ initialResult.request = httpRequest;
+ initialResult.response = response;
+ initialResult.body = response.body;
+ client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => {
+ if (err) return callback(err);
+
+ // Create Result
+ let result = null;
+
+ httpRequest = pollingResult.request;
+ response = pollingResult.response;
+ let responseBody = pollingResult.body;
+ if (responseBody === '') responseBody = null;
+
+ // Deserialize Response
+
+ return callback(null, result, httpRequest, response);
+ });
+ });
+}
+
+/**
+ * List galleries under a resource group.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _listGalleriesInResourceGroup(resourceGroupName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryList']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * List galleries under a subscription.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _listGalleriesInSubscription(options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'GET';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 200) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 200) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['GalleryList']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Create or update a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery operation.
+ *
+ * @param {string} [parameters.description] The description of this gallery
+ * resource.
+ *
+ * @param {object} [parameters.identifier]
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link Gallery} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _beginCreateOrUpdate(resourceGroupName, galleryName, parameters, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (parameters === null || parameters === undefined) {
+ throw new Error('parameters cannot be null or undefined.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'PUT';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ // Serialize Request
+ let requestContent = null;
+ let requestModel = null;
+ try {
+ if (parameters !== null && parameters !== undefined) {
+ let requestModelMapper = new client.models['Gallery']().mapper();
+ requestModel = client.serialize(requestModelMapper, parameters, 'parameters');
+ requestContent = JSON.stringify(requestModel);
+ }
+ } catch (error) {
+ let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
+ `payload - ${JSON.stringify(parameters, null, 2)}.`);
+ return callback(serializationError);
+ }
+ httpRequest.body = requestContent;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 201 && statusCode !== 202) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+ // Deserialize Response
+ if (statusCode === 201) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['Gallery']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError.request = msRest.stripRequest(httpRequest);
+ deserializationError.response = msRest.stripResponse(response);
+ return callback(deserializationError);
+ }
+ }
+ // Deserialize Response
+ if (statusCode === 202) {
+ let parsedResponse = null;
+ try {
+ parsedResponse = JSON.parse(responseBody);
+ result = JSON.parse(responseBody);
+ if (parsedResponse !== null && parsedResponse !== undefined) {
+ let resultMapper = new client.models['Gallery']().mapper();
+ result = client.deserialize(resultMapper, parsedResponse, 'result');
+ }
+ } catch (error) {
+ let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
+ deserializationError1.request = msRest.stripRequest(httpRequest);
+ deserializationError1.response = msRest.stripResponse(response);
+ return callback(deserializationError1);
+ }
+ }
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/**
+ * Delete a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} callback - The callback.
+ *
+ * @returns {function} callback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {null} [result] - The deserialized result object if an error did not occur.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+function _beginDeleteMethod(resourceGroupName, galleryName, options, callback) {
+ /* jshint validthis: true */
+ let client = this.client;
+ if(!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ if (!callback) {
+ throw new Error('callback cannot be null.');
+ }
+ let apiVersion = '2018-06-01';
+ // Validate
+ try {
+ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
+ throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
+ }
+ if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
+ throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
+ }
+ if (galleryName === null || galleryName === undefined || typeof galleryName.valueOf() !== 'string') {
+ throw new Error('galleryName cannot be null or undefined and it must be of type string.');
+ }
+ if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
+ throw new Error('this.client.acceptLanguage must be of type string.');
+ }
+ } catch (error) {
+ return callback(error);
+ }
+
+ // Construct URL
+ let baseUrl = this.client.baseUri;
+ let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}';
+ requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
+ requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
+ requestUrl = requestUrl.replace('{galleryName}', encodeURIComponent(galleryName));
+ let queryParameters = [];
+ queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
+ if (queryParameters.length > 0) {
+ requestUrl += '?' + queryParameters.join('&');
+ }
+
+ // Create HTTP transport objects
+ let httpRequest = new WebResource();
+ httpRequest.method = 'DELETE';
+ httpRequest.url = requestUrl;
+ httpRequest.headers = {};
+ // Set Headers
+ httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
+ if (this.client.generateClientRequestId) {
+ httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
+ }
+ if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
+ httpRequest.headers['accept-language'] = this.client.acceptLanguage;
+ }
+ if(options) {
+ for(let headerName in options['customHeaders']) {
+ if (options['customHeaders'].hasOwnProperty(headerName)) {
+ httpRequest.headers[headerName] = options['customHeaders'][headerName];
+ }
+ }
+ }
+ httpRequest.body = null;
+ // Send Request
+ return client.pipeline(httpRequest, (err, response, responseBody) => {
+ if (err) {
+ return callback(err);
+ }
+ let statusCode = response.statusCode;
+ if (statusCode !== 202 && statusCode !== 204) {
+ let error = new Error(responseBody);
+ error.statusCode = response.statusCode;
+ error.request = msRest.stripRequest(httpRequest);
+ error.response = msRest.stripResponse(response);
+ if (responseBody === '') responseBody = null;
+ let parsedErrorResponse;
+ try {
+ parsedErrorResponse = JSON.parse(responseBody);
+ if (parsedErrorResponse) {
+ if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
+ if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
+ if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
+ }
+ if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
+ let resultMapper = new client.models['CloudError']().mapper();
+ error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
+ }
+ } catch (defaultError) {
+ error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
+ `- "${responseBody}" for the default response.`;
+ return callback(error);
+ }
+ return callback(error);
+ }
+ // Create Result
+ let result = null;
+ if (responseBody === '') responseBody = null;
+
+ return callback(null, result, httpRequest, response);
+ });
+}
+
+/** Class representing a GalleryOperations. */
+class GalleryOperations {
+ /**
+ * Create a GalleryOperations.
+ * @param {ComputeManagementClient} client Reference to the service client.
+ */
+ constructor(client) {
+ this.client = client;
+ this._createOrUpdate = _createOrUpdate;
+ this._get = _get;
+ this._deleteMethod = _deleteMethod;
+ this._listGalleriesInResourceGroup = _listGalleriesInResourceGroup;
+ this._listGalleriesInSubscription = _listGalleriesInSubscription;
+ this._beginCreateOrUpdate = _beginCreateOrUpdate;
+ this._beginDeleteMethod = _beginDeleteMethod;
+ }
+
+ /**
+ * Create or update a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery operation.
+ *
+ * @param {string} [parameters.description] The description of this gallery
+ * resource.
+ *
+ * @param {object} [parameters.identifier]
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ createOrUpdateWithHttpOperationResponse(resourceGroupName, galleryName, parameters, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._createOrUpdate(resourceGroupName, galleryName, parameters, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Create or update a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery operation.
+ *
+ * @param {string} [parameters.description] The description of this gallery
+ * resource.
+ *
+ * @param {object} [parameters.identifier]
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {Gallery} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link Gallery} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ createOrUpdate(resourceGroupName, galleryName, parameters, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._createOrUpdate(resourceGroupName, galleryName, parameters, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._createOrUpdate(resourceGroupName, galleryName, parameters, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Retrieves information about a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ getWithHttpOperationResponse(resourceGroupName, galleryName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._get(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Retrieves information about a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {Gallery} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link Gallery} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ get(resourceGroupName, galleryName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._get(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._get(resourceGroupName, galleryName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Delete a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ deleteMethodWithHttpOperationResponse(resourceGroupName, galleryName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._deleteMethod(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Delete a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {null} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {null} [result] - The deserialized result object if an error did not occur.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ deleteMethod(resourceGroupName, galleryName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._deleteMethod(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._deleteMethod(resourceGroupName, galleryName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * List galleries under a resource group.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listGalleriesInResourceGroupWithHttpOperationResponse(resourceGroupName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listGalleriesInResourceGroup(resourceGroupName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * List galleries under a resource group.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryList} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listGalleriesInResourceGroup(resourceGroupName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listGalleriesInResourceGroup(resourceGroupName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listGalleriesInResourceGroup(resourceGroupName, options, optionalCallback);
+ }
+ }
+
+ /**
+ * List galleries under a subscription.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ listGalleriesInSubscriptionWithHttpOperationResponse(options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._listGalleriesInSubscription(options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * List galleries under a subscription.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {GalleryList} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link GalleryList} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listGalleriesInSubscription(options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._listGalleriesInSubscription(options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._listGalleriesInSubscription(options, optionalCallback);
+ }
+ }
+
+ /**
+ * Create or update a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery operation.
+ *
+ * @param {string} [parameters.description] The description of this gallery
+ * resource.
+ *
+ * @param {object} [parameters.identifier]
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, galleryName, parameters, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._beginCreateOrUpdate(resourceGroupName, galleryName, parameters, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Create or update a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} parameters Parameters supplied to the create or update
+ * gallery operation.
+ *
+ * @param {string} [parameters.description] The description of this gallery
+ * resource.
+ *
+ * @param {object} [parameters.identifier]
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {Gallery} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {object} [result] - The deserialized result object if an error did not occur.
+ * See {@link Gallery} for more information.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ beginCreateOrUpdate(resourceGroupName, galleryName, parameters, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._beginCreateOrUpdate(resourceGroupName, galleryName, parameters, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._beginCreateOrUpdate(resourceGroupName, galleryName, parameters, options, optionalCallback);
+ }
+ }
+
+ /**
+ * Delete a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ */
+ beginDeleteMethodWithHttpOperationResponse(resourceGroupName, galleryName, options) {
+ let client = this.client;
+ let self = this;
+ return new Promise((resolve, reject) => {
+ self._beginDeleteMethod(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
+ httpOperationResponse.body = result;
+ if (err) { reject(err); }
+ else { resolve(httpOperationResponse); }
+ return;
+ });
+ });
+ }
+
+ /**
+ * Delete a gallery.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} galleryName The name of the gallery.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {function} [optionalCallback] - The optional callback.
+ *
+ * @returns {function|Promise} If a callback was passed as the last parameter
+ * then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned
+ *
+ * @resolve {null} - The deserialized result object.
+ *
+ * @reject {Error} - The error object.
+ *
+ * {function} optionalCallback(err, result, request, response)
+ *
+ * {Error} err - The Error object if an error occurred, null otherwise.
+ *
+ * {null} [result] - The deserialized result object if an error did not occur.
+ *
+ * {object} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {stream} [response] - The HTTP Response stream if an error did not occur.
+ */
+ beginDeleteMethod(resourceGroupName, galleryName, options, optionalCallback) {
+ let client = this.client;
+ let self = this;
+ if (!optionalCallback && typeof options === 'function') {
+ optionalCallback = options;
+ options = null;
+ }
+ if (!optionalCallback) {
+ return new Promise((resolve, reject) => {
+ self._beginDeleteMethod(resourceGroupName, galleryName, options, (err, result, request, response) => {
+ if (err) { reject(err); }
+ else { resolve(result); }
+ return;
+ });
+ });
+ } else {
+ return self._beginDeleteMethod(resourceGroupName, galleryName, options, optionalCallback);
+ }
+ }
+
+}
+
+module.exports = GalleryOperations;
diff --git a/lib/services/computeManagement2/lib/operations/images.js b/lib/services/computeManagement2/lib/operations/images.js
index 27ee1a0181..536aac6b3f 100644
--- a/lib/services/computeManagement2/lib/operations/images.js
+++ b/lib/services/computeManagement2/lib/operations/images.js
@@ -68,8 +68,8 @@ const WebResource = msRest.WebResource;
*
* @param {string} [parameters.storageProfile.osDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [parameters.storageProfile.dataDisks] Specifies the
* parameters that are used to add a data disk to a virtual machine.
@@ -209,8 +209,8 @@ function _createOrUpdate(resourceGroupName, imageName, parameters, options, call
*
* @param {string} [parameters.storageProfile.osDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [parameters.storageProfile.dataDisks] Specifies the
* parameters that are used to add a data disk to a virtual machine.
@@ -313,9 +313,7 @@ function _update(resourceGroupName, imageName, parameters, options, callback) {
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
- * {object} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
@@ -353,20 +351,6 @@ function _deleteMethod(resourceGroupName, imageName, options, callback) {
if (responseBody === '') responseBody = null;
// Deserialize Response
- let parsedResponse = null;
- try {
- parsedResponse = JSON.parse(responseBody);
- result = JSON.parse(responseBody);
- if (parsedResponse !== null && parsedResponse !== undefined) {
- let resultMapper = new client.models['OperationStatusResponse']().mapper();
- result = client.deserialize(resultMapper, parsedResponse, 'result');
- }
- } catch (error) {
- let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
- deserializationError.request = msRest.stripRequest(httpRequest);
- deserializationError.response = msRest.stripResponse(response);
- return callback(deserializationError);
- }
return callback(null, result, httpRequest, response);
});
@@ -412,7 +396,7 @@ function _get(resourceGroupName, imageName, options, callback) {
throw new Error('callback cannot be null.');
}
let expand = (options && options.expand !== undefined) ? options.expand : undefined;
- let apiVersion = '2017-12-01';
+ let apiVersion = '2018-06-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
@@ -559,7 +543,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) {
if (!callback) {
throw new Error('callback cannot be null.');
}
- let apiVersion = '2017-12-01';
+ let apiVersion = '2018-06-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
@@ -696,7 +680,7 @@ function _list(options, callback) {
if (!callback) {
throw new Error('callback cannot be null.');
}
- let apiVersion = '2017-12-01';
+ let apiVersion = '2018-06-01';
// Validate
try {
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
@@ -849,8 +833,8 @@ function _list(options, callback) {
*
* @param {string} [parameters.storageProfile.osDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [parameters.storageProfile.dataDisks] Specifies the
* parameters that are used to add a data disk to a virtual machine.
@@ -894,7 +878,7 @@ function _beginCreateOrUpdate(resourceGroupName, imageName, parameters, options,
if (!callback) {
throw new Error('callback cannot be null.');
}
- let apiVersion = '2017-12-01';
+ let apiVersion = '2018-06-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
@@ -1089,8 +1073,8 @@ function _beginCreateOrUpdate(resourceGroupName, imageName, parameters, options,
*
* @param {string} [parameters.storageProfile.osDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [parameters.storageProfile.dataDisks] Specifies the
* parameters that are used to add a data disk to a virtual machine.
@@ -1132,7 +1116,7 @@ function _beginUpdate(resourceGroupName, imageName, parameters, options, callbac
if (!callback) {
throw new Error('callback cannot be null.');
}
- let apiVersion = '2017-12-01';
+ let apiVersion = '2018-06-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
@@ -1292,9 +1276,7 @@ function _beginUpdate(resourceGroupName, imageName, parameters, options, callbac
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
- * {object} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
@@ -1310,7 +1292,7 @@ function _beginDeleteMethod(resourceGroupName, imageName, options, callback) {
if (!callback) {
throw new Error('callback cannot be null.');
}
- let apiVersion = '2017-12-01';
+ let apiVersion = '2018-06-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
@@ -1396,23 +1378,6 @@ function _beginDeleteMethod(resourceGroupName, imageName, options, callback) {
// Create Result
let result = null;
if (responseBody === '') responseBody = null;
- // Deserialize Response
- if (statusCode === 200) {
- let parsedResponse = null;
- try {
- parsedResponse = JSON.parse(responseBody);
- result = JSON.parse(responseBody);
- if (parsedResponse !== null && parsedResponse !== undefined) {
- let resultMapper = new client.models['OperationStatusResponse']().mapper();
- result = client.deserialize(resultMapper, parsedResponse, 'result');
- }
- } catch (error) {
- let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
- deserializationError.request = msRest.stripRequest(httpRequest);
- deserializationError.response = msRest.stripResponse(response);
- return callback(deserializationError);
- }
- }
return callback(null, result, httpRequest, response);
});
@@ -1748,8 +1713,8 @@ class Images {
*
* @param {string} [parameters.storageProfile.osDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [parameters.storageProfile.dataDisks] Specifies the
* parameters that are used to add a data disk to a virtual machine.
@@ -1843,8 +1808,8 @@ class Images {
*
* @param {string} [parameters.storageProfile.osDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [parameters.storageProfile.dataDisks] Specifies the
* parameters that are used to add a data disk to a virtual machine.
@@ -1960,8 +1925,8 @@ class Images {
*
* @param {string} [parameters.storageProfile.osDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [parameters.storageProfile.dataDisks] Specifies the
* parameters that are used to add a data disk to a virtual machine.
@@ -2053,8 +2018,8 @@ class Images {
*
* @param {string} [parameters.storageProfile.osDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [parameters.storageProfile.dataDisks] Specifies the
* parameters that are used to add a data disk to a virtual machine.
@@ -2129,7 +2094,7 @@ class Images {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
@@ -2166,7 +2131,7 @@ class Images {
*
* {Promise} A promise is returned
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error} - The error object.
*
@@ -2174,9 +2139,7 @@ class Images {
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
- * {object} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
@@ -2511,8 +2474,8 @@ class Images {
*
* @param {string} [parameters.storageProfile.osDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [parameters.storageProfile.dataDisks] Specifies the
* parameters that are used to add a data disk to a virtual machine.
@@ -2606,8 +2569,8 @@ class Images {
*
* @param {string} [parameters.storageProfile.osDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [parameters.storageProfile.dataDisks] Specifies the
* parameters that are used to add a data disk to a virtual machine.
@@ -2723,8 +2686,8 @@ class Images {
*
* @param {string} [parameters.storageProfile.osDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [parameters.storageProfile.dataDisks] Specifies the
* parameters that are used to add a data disk to a virtual machine.
@@ -2816,8 +2779,8 @@ class Images {
*
* @param {string} [parameters.storageProfile.osDisk.storageAccountType]
* Specifies the storage account type for the managed disk. Possible values
- * are: Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [parameters.storageProfile.dataDisks] Specifies the
* parameters that are used to add a data disk to a virtual machine.
@@ -2892,7 +2855,7 @@ class Images {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
@@ -2929,7 +2892,7 @@ class Images {
*
* {Promise} A promise is returned
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error} - The error object.
*
@@ -2937,9 +2900,7 @@ class Images {
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
- * {object} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
diff --git a/lib/services/computeManagement2/lib/operations/index.d.ts b/lib/services/computeManagement2/lib/operations/index.d.ts
index e625011837..c9d18fa3e7 100644
--- a/lib/services/computeManagement2/lib/operations/index.d.ts
+++ b/lib/services/computeManagement2/lib/operations/index.d.ts
@@ -310,11 +310,11 @@ export interface AvailabilitySets {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
- deleteMethodWithHttpOperationResponse(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ deleteMethodWithHttpOperationResponse(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* Delete an availability set.
@@ -335,7 +335,7 @@ export interface AvailabilitySets {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -343,17 +343,15 @@ export interface AvailabilitySets {
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
- deleteMethod(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- deleteMethod(resourceGroupName: string, availabilitySetName: string, callback: ServiceCallback): void;
- deleteMethod(resourceGroupName: string, availabilitySetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ deleteMethod(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ deleteMethod(resourceGroupName: string, availabilitySetName: string, callback: ServiceCallback): void;
+ deleteMethod(resourceGroupName: string, availabilitySetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -415,6 +413,58 @@ export interface AvailabilitySets {
get(resourceGroupName: string, availabilitySetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ /**
+ * Lists all availability sets in a subscription.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error|ServiceError} - The error object.
+ */
+ listBySubscriptionWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+
+ /**
+ * Lists all availability sets in a subscription.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {ServiceCallback} [optionalCallback] - The optional callback.
+ *
+ * @returns {ServiceCallback|Promise} If a callback was passed as the last
+ * parameter then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned.
+ *
+ * @resolve {AvailabilitySetListResult} - The deserialized result object.
+ *
+ * @reject {Error|ServiceError} - The error object.
+ *
+ * {ServiceCallback} optionalCallback(err, result, request, response)
+ *
+ * {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
+ *
+ * {AvailabilitySetListResult} [result] - The deserialized result object if an error did not occur.
+ * See {@link AvailabilitySetListResult} for more
+ * information.
+ *
+ * {WebResource} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listBySubscription(options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ listBySubscription(callback: ServiceCallback): void;
+ listBySubscription(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+
+
/**
* Lists all availability sets in a resource group.
*
@@ -531,6 +581,122 @@ export interface AvailabilitySets {
listAvailableSizes(resourceGroupName: string, availabilitySetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
listAvailableSizes(resourceGroupName: string, availabilitySetName: string, callback: ServiceCallback): void;
listAvailableSizes(resourceGroupName: string, availabilitySetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+
+
+ /**
+ * Lists all availability sets in a subscription.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error|ServiceError} - The error object.
+ */
+ listBySubscriptionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+
+ /**
+ * Lists all availability sets in a subscription.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {ServiceCallback} [optionalCallback] - The optional callback.
+ *
+ * @returns {ServiceCallback|Promise} If a callback was passed as the last
+ * parameter then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned.
+ *
+ * @resolve {AvailabilitySetListResult} - The deserialized result object.
+ *
+ * @reject {Error|ServiceError} - The error object.
+ *
+ * {ServiceCallback} optionalCallback(err, result, request, response)
+ *
+ * {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
+ *
+ * {AvailabilitySetListResult} [result] - The deserialized result object if an error did not occur.
+ * See {@link AvailabilitySetListResult} for more
+ * information.
+ *
+ * {WebResource} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listBySubscriptionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ listBySubscriptionNext(nextPageLink: string, callback: ServiceCallback): void;
+ listBySubscriptionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+
+
+ /**
+ * Lists all availability sets in a resource group.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error|ServiceError} - The error object.
+ */
+ listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+
+ /**
+ * Lists all availability sets in a resource group.
+ *
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {ServiceCallback} [optionalCallback] - The optional callback.
+ *
+ * @returns {ServiceCallback|Promise} If a callback was passed as the last
+ * parameter then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned.
+ *
+ * @resolve {AvailabilitySetListResult} - The deserialized result object.
+ *
+ * @reject {Error|ServiceError} - The error object.
+ *
+ * {ServiceCallback} optionalCallback(err, result, request, response)
+ *
+ * {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
+ *
+ * {AvailabilitySetListResult} [result] - The deserialized result object if an error did not occur.
+ * See {@link AvailabilitySetListResult} for more
+ * information.
+ *
+ * {WebResource} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ listNext(nextPageLink: string, callback: ServiceCallback): void;
+ listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
}
/**
@@ -1060,11 +1226,11 @@ export interface VirtualMachineExtensions {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
- deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* The operation to delete the extension.
@@ -1088,7 +1254,7 @@ export interface VirtualMachineExtensions {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -1096,17 +1262,15 @@ export interface VirtualMachineExtensions {
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
- deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void;
- deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void;
+ deleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -1181,6 +1345,74 @@ export interface VirtualMachineExtensions {
get(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ /**
+ * The operation to get all extensions of a Virtual Machine.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} vmName The name of the virtual machine containing the
+ * extension.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {string} [options.expand] The expand expression to apply on the
+ * operation.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error|ServiceError} - The error object.
+ */
+ listWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>;
+
+ /**
+ * The operation to get all extensions of a Virtual Machine.
+ *
+ * @param {string} resourceGroupName The name of the resource group.
+ *
+ * @param {string} vmName The name of the virtual machine containing the
+ * extension.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {string} [options.expand] The expand expression to apply on the
+ * operation.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @param {ServiceCallback} [optionalCallback] - The optional callback.
+ *
+ * @returns {ServiceCallback|Promise} If a callback was passed as the last
+ * parameter then it returns the callback else returns a Promise.
+ *
+ * {Promise} A promise is returned.
+ *
+ * @resolve {VirtualMachineExtensionsListResult} - The deserialized result object.
+ *
+ * @reject {Error|ServiceError} - The error object.
+ *
+ * {ServiceCallback} optionalCallback(err, result, request, response)
+ *
+ * {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
+ *
+ * {VirtualMachineExtensionsListResult} [result] - The deserialized result object if an error did not occur.
+ * See {@link VirtualMachineExtensionsListResult} for more
+ * information.
+ *
+ * {WebResource} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
+ */
+ list(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise;
+ list(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
+ list(resourceGroupName: string, vmName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+
+
/**
* The operation to create or update the extension.
*
@@ -1490,11 +1722,11 @@ export interface VirtualMachineExtensions {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
- beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* The operation to delete the extension.
@@ -1518,7 +1750,7 @@ export interface VirtualMachineExtensions {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -1526,64 +1758,66 @@ export interface VirtualMachineExtensions {
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
- beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void;
- beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, callback: ServiceCallback): void;
+ beginDeleteMethod(resourceGroupName: string, vmName: string, vmExtensionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
}
/**
* @class
- * VirtualMachines
+ * VirtualMachineImages
* __NOTE__: An instance of this class is automatically created for an
* instance of the ComputeManagementClient.
*/
-export interface VirtualMachines {
+export interface VirtualMachineImages {
/**
- * The operation to get all extensions of a Virtual Machine.
+ * Gets a virtual machine image.
*
- * @param {string} resourceGroupName The name of the resource group.
+ * @param {string} location The name of a supported Azure region.
*
- * @param {string} vmName The name of the virtual machine containing the
- * extension.
+ * @param {string} publisherName A valid image publisher.
*
- * @param {object} [options] Optional Parameters.
+ * @param {string} offer A valid image publisher offer.
*
- * @param {string} [options.expand] The expand expression to apply on the
- * operation.
+ * @param {string} skus A valid image SKU.
+ *
+ * @param {string} version A valid image SKU version.
+ *
+ * @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
- getExtensionsWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>;
+ getWithHttpOperationResponse(location: string, publisherName: string, offer: string, skus: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
- * The operation to get all extensions of a Virtual Machine.
+ * Gets a virtual machine image.
*
- * @param {string} resourceGroupName The name of the resource group.
+ * @param {string} location The name of a supported Azure region.
*
- * @param {string} vmName The name of the virtual machine containing the
- * extension.
+ * @param {string} publisherName A valid image publisher.
*
- * @param {object} [options] Optional Parameters.
+ * @param {string} offer A valid image publisher offer.
*
- * @param {string} [options.expand] The expand expression to apply on the
- * operation.
+ * @param {string} skus A valid image SKU.
+ *
+ * @param {string} version A valid image SKU version.
+ *
+ * @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
@@ -1595,7 +1829,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {VirtualMachineExtensionsListResult} - The deserialized result object.
+ * @resolve {VirtualMachineImage} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -1603,73 +1837,68 @@ export interface VirtualMachines {
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * {VirtualMachineExtensionsListResult} [result] - The deserialized result object if an error did not occur.
- * See {@link VirtualMachineExtensionsListResult} for more
- * information.
+ * {VirtualMachineImage} [result] - The deserialized result object if an error did not occur.
+ * See {@link VirtualMachineImage} for more information.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
- getExtensions(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise;
- getExtensions(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- getExtensions(resourceGroupName: string, vmName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ get(location: string, publisherName: string, offer: string, skus: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ get(location: string, publisherName: string, offer: string, skus: string, version: string, callback: ServiceCallback): void;
+ get(location: string, publisherName: string, offer: string, skus: string, version: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
- * Captures the VM by copying virtual hard disks of the VM and outputs a
- * template that can be used to create similar VMs.
+ * Gets a list of all virtual machine image versions for the specified
+ * location, publisher, offer, and SKU.
*
- * @param {string} resourceGroupName The name of the resource group.
+ * @param {string} location The name of a supported Azure region.
*
- * @param {string} vmName The name of the virtual machine.
+ * @param {string} publisherName A valid image publisher.
*
- * @param {object} parameters Parameters supplied to the Capture Virtual
- * Machine operation.
+ * @param {string} offer A valid image publisher offer.
*
- * @param {string} parameters.vhdPrefix The captured virtual hard disk's name
- * prefix.
+ * @param {string} skus A valid image SKU.
*
- * @param {string} parameters.destinationContainerName The destination
- * container name.
+ * @param {object} [options] Optional Parameters.
*
- * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the
- * destination virtual hard disk, in case of conflict.
+ * @param {string} [options.filter] The filter to apply on the operation.
*
- * @param {object} [options] Optional Parameters.
+ * @param {number} [options.top]
+ *
+ * @param {string} [options.orderby]
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
- captureWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ listWithHttpOperationResponse(location: string, publisherName: string, offer: string, skus: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
- * Captures the VM by copying virtual hard disks of the VM and outputs a
- * template that can be used to create similar VMs.
+ * Gets a list of all virtual machine image versions for the specified
+ * location, publisher, offer, and SKU.
*
- * @param {string} resourceGroupName The name of the resource group.
+ * @param {string} location The name of a supported Azure region.
*
- * @param {string} vmName The name of the virtual machine.
+ * @param {string} publisherName A valid image publisher.
*
- * @param {object} parameters Parameters supplied to the Capture Virtual
- * Machine operation.
+ * @param {string} offer A valid image publisher offer.
*
- * @param {string} parameters.vhdPrefix The captured virtual hard disk's name
- * prefix.
+ * @param {string} skus A valid image SKU.
*
- * @param {string} parameters.destinationContainerName The destination
- * container name.
+ * @param {object} [options] Optional Parameters.
*
- * @param {boolean} parameters.overwriteVhds Specifies whether to overwrite the
- * destination virtual hard disk, in case of conflict.
+ * @param {string} [options.filter] The filter to apply on the operation.
*
- * @param {object} [options] Optional Parameters.
+ * @param {number} [options.top]
+ *
+ * @param {string} [options.orderby]
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
@@ -1681,7 +1910,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {VirtualMachineCaptureResult} - The deserialized result object.
+ * @resolve {Array} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -1689,1216 +1918,272 @@ export interface VirtualMachines {
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * {VirtualMachineCaptureResult} [result] - The deserialized result object if an error did not occur.
- * See {@link VirtualMachineCaptureResult} for more
- * information.
+ * {Array} [result] - The deserialized result object if an error did not occur.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
- capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, callback: ServiceCallback): void;
- capture(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineCaptureParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ list(location: string, publisherName: string, offer: string, skus: string, options?: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }): Promise;
+ list(location: string, publisherName: string, offer: string, skus: string, callback: ServiceCallback): void;
+ list(location: string, publisherName: string, offer: string, skus: string, options: { filter? : string, top? : number, orderby? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
- * The operation to create or update a virtual machine.
+ * Gets a list of virtual machine image offers for the specified location and
+ * publisher.
*
- * @param {string} resourceGroupName The name of the resource group.
+ * @param {string} location The name of a supported Azure region.
*
- * @param {string} vmName The name of the virtual machine.
+ * @param {string} publisherName A valid image publisher.
*
- * @param {object} parameters Parameters supplied to the Create Virtual Machine
- * operation.
+ * @param {object} [options] Optional Parameters.
*
- * @param {object} [parameters.plan] Specifies information about the
- * marketplace image used to create the virtual machine. This element is only
- * used for marketplace images. Before you can use a marketplace image from an
- * API, you must enable the image for programmatic use. In the Azure portal,
- * find the marketplace image that you want to use and then click **Want to
- * deploy programmatically, Get Started ->**. Enter any required information
- * and then click **Save**.
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
*
- * @param {string} [parameters.plan.name] The plan ID.
+ * @returns {Promise} A promise is returned
*
- * @param {string} [parameters.plan.publisher] The publisher ID.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
- * @param {string} [parameters.plan.product] Specifies the product of the image
- * from the marketplace. This is the same value as Offer under the
- * imageReference element.
+ * @reject {Error|ServiceError} - The error object.
+ */
+ listOffersWithHttpOperationResponse(location: string, publisherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+
+ /**
+ * Gets a list of virtual machine image offers for the specified location and
+ * publisher.
*
- * @param {string} [parameters.plan.promotionCode] The promotion code.
+ * @param {string} location The name of a supported Azure region.
*
- * @param {object} [parameters.hardwareProfile] Specifies the hardware settings
- * for the virtual machine.
+ * @param {string} publisherName A valid image publisher.
*
- * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of
- * the virtual machine. For more information about virtual machine sizes, see
- * [Sizes for virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- *
The available VM sizes depend on region and availability set. For a
- * list of available sizes use these APIs:
[List all available
- * virtual machine sizes in an availability
- * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes)
- *
[List all available virtual machine sizes in a
- * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list)
- *
[List all available virtual machine sizes for
- * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes).
- * Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3',
- * 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3',
- * 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8',
- * 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2',
- * 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2',
- * 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms',
- * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms',
- * 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11',
- * 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2',
- * 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2',
- * 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3',
- * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3',
- * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3',
- * 'Standard_D64s_v3', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2',
- * 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2',
- * 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12',
- * 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2',
- * 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2',
- * 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2',
- * 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2',
- * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3',
- * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3',
- * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3',
- * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3',
- * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3',
- * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4',
- * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s',
- * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2',
- * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2',
- * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1',
- * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1',
- * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5',
- * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8',
- * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m',
- * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s',
- * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms',
- * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms',
- * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms',
- * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r',
- * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2',
- * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3',
- * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s',
- * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6',
- * 'Standard_NV12', 'Standard_NV24'
+ * @param {object} [options] Optional Parameters.
*
- * @param {object} [parameters.storageProfile] Specifies the storage settings
- * for the virtual machine disks.
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
*
- * @param {object} [parameters.storageProfile.imageReference] Specifies
- * information about the image to use. You can specify information about
- * platform images, marketplace images, or virtual machine images. This element
- * is required when you want to use a platform image, marketplace image, or
- * virtual machine image, but is not used in other creation operations.
+ * @param {ServiceCallback} [optionalCallback] - The optional callback.
*
- * @param {string} [parameters.storageProfile.imageReference.publisher] The
- * image publisher.
+ * @returns {ServiceCallback|Promise} If a callback was passed as the last
+ * parameter then it returns the callback else returns a Promise.
*
- * @param {string} [parameters.storageProfile.imageReference.offer] Specifies
- * the offer of the platform image or marketplace image used to create the
- * virtual machine.
+ * {Promise} A promise is returned.
*
- * @param {string} [parameters.storageProfile.imageReference.sku] The image
- * SKU.
+ * @resolve {Array} - The deserialized result object.
*
- * @param {string} [parameters.storageProfile.imageReference.version] Specifies
- * the version of the platform image or marketplace image used to create the
- * virtual machine. The allowed formats are Major.Minor.Build or 'latest'.
- * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the
- * latest version of an image available at deploy time. Even if you use
- * 'latest', the VM image will not automatically update after deploy time even
- * if a new version becomes available.
+ * @reject {Error|ServiceError} - The error object.
*
- * @param {string} [parameters.storageProfile.imageReference.id] Resource Id
+ * {ServiceCallback} optionalCallback(err, result, request, response)
*
- * @param {object} [parameters.storageProfile.osDisk] Specifies information
- * about the operating system disk used by the virtual machine.
For
- * more information about disks, see [About disks and VHDs for Azure virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
+ * {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * @param {string} [parameters.storageProfile.osDisk.osType] This property
- * allows you to specify the type of the OS that is included in the disk if
- * creating a VM from user-image or a specialized VHD.
Possible values
- * are:
**Windows**
**Linux**. Possible values include:
- * 'Windows', 'Linux'
+ * {Array} [result] - The deserialized result object if an error did not occur.
*
- * @param {object} [parameters.storageProfile.osDisk.encryptionSettings]
- * Specifies the encryption settings for the OS Disk.
Minimum
- * api-version: 2015-06-15
+ * {WebResource} [request] - The HTTP Request object if an error did not occur.
*
- * @param {object}
- * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey]
- * Specifies the location of the disk encryption key, which is a Key Vault
- * Secret.
+ * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listOffers(location: string, publisherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ listOffers(location: string, publisherName: string, callback: ServiceCallback): void;
+ listOffers(location: string, publisherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+
+
+ /**
+ * Gets a list of virtual machine image publishers for the specified Azure
+ * location.
*
- * @param {string}
- * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl
- * The URL referencing a secret in a Key Vault.
+ * @param {string} location The name of a supported Azure region.
*
- * @param {object}
- * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault
- * The relative URL of the Key Vault containing the secret.
+ * @param {object} [options] Optional Parameters.
*
- * @param {object}
- * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey]
- * Specifies the location of the key encryption key in Key Vault.
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
*
- * @param {string}
- * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl
- * The URL referencing a key encryption key in Key Vault.
- *
- * @param {object}
- * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault
- * The relative URL of the Key Vault containing the key.
- *
- * @param {boolean}
- * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies
- * whether disk encryption should be enabled on the virtual machine.
- *
- * @param {string} [parameters.storageProfile.osDisk.name] The disk name.
- *
- * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard
- * disk.
- *
- * @param {object} [parameters.storageProfile.osDisk.image] The source user
- * image virtual hard disk. The virtual hard disk will be copied before being
- * attached to the virtual machine. If SourceImage is provided, the destination
- * virtual hard drive must not exist.
- *
- * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the
- * virtual hard disk's uri.
- *
- * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the
- * caching requirements.
Possible values are:
**None**
- *
**ReadOnly**
**ReadWrite**
Default: **None for
- * Standard storage. ReadOnly for Premium storage**. Possible values include:
- * 'None', 'ReadOnly', 'ReadWrite'
- *
- * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled]
- * Specifies whether writeAccelerator should be enabled or disabled on the
- * disk.
- *
- * @param {string} parameters.storageProfile.osDisk.createOption Specifies how
- * the virtual machine should be created.
Possible values are:
- * **Attach** \u2013 This value is used when you are using a specialized disk
- * to create the virtual machine.
**FromImage** \u2013 This value is
- * used when you are using an image to create the virtual machine. If you are
- * using a platform image, you also use the imageReference element described
- * above. If you are using a marketplace image, you also use the plan element
- * previously described. Possible values include: 'FromImage', 'Empty',
- * 'Attach'
- *
- * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the
- * size of an empty data disk in gigabytes. This element can be used to
- * overwrite the name of the disk in a virtual machine image.
This
- * value cannot be larger than 1023 GB
- *
- * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed
- * disk parameters.
- *
- * @param {string}
- * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies
- * the storage account type for the managed disk. Possible values are:
- * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
- *
- * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource
- * Id
- *
- * @param {array} [parameters.storageProfile.dataDisks] Specifies the
- * parameters that are used to add a data disk to a virtual machine.
- * For more information about disks, see [About disks and VHDs for Azure
- * virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- *
- * @param {object} [parameters.osProfile] Specifies the operating system
- * settings for the virtual machine.
- *
- * @param {string} [parameters.osProfile.computerName] Specifies the host OS
- * name of the virtual machine.
**Max-length (Windows):** 15
- * characters
**Max-length (Linux):** 64 characters.
For
- * naming conventions and restrictions see [Azure infrastructure services
- * implementation
- * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions).
- *
- * @param {string} [parameters.osProfile.adminUsername] Specifies the name of
- * the administrator account.
**Windows-only restriction:** Cannot end
- * in "."
**Disallowed values:** "administrator", "admin", "user",
- * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a",
- * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest",
- * "john", "owner", "root", "server", "sql", "support", "support_388945a0",
- * "sys", "test2", "test3", "user4", "user5".
**Minimum-length
- * (Linux):** 1 character
**Max-length (Linux):** 64 characters
- *
**Max-length (Windows):** 20 characters
For root
- * access to the Linux VM, see [Using root privileges on Linux virtual machines
- * in
- * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- * For a list of built-in system users on Linux that should not be used in this
- * field, see [Selecting User Names for Linux on
- * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- *
- * @param {string} [parameters.osProfile.adminPassword] Specifies the password
- * of the administrator account.
**Minimum-length (Windows):** 8
- * characters
**Minimum-length (Linux):** 6 characters
- * **Max-length (Windows):** 123 characters
**Max-length (Linux):** 72
- * characters
**Complexity requirements:** 3 out of 4 conditions below
- * need to be fulfilled
Has lower characters
Has upper characters
- * Has a digit
Has a special character (Regex match [\W_])
- * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123",
- * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22",
- * "iloveyou!"
For resetting the password, see [How to reset the
- * Remote Desktop service or its login password in a Windows
- * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
- *
For resetting root password, see [Manage users, SSH, and check or
- * repair disks on Azure Linux VMs using the VMAccess
- * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password)
- *
- * @param {string} [parameters.osProfile.customData] Specifies a base-64
- * encoded string of custom data. The base-64 encoded string is decoded to a
- * binary array that is saved as a file on the Virtual Machine. The maximum
- * length of the binary array is 65535 bytes.
For using cloud-init for
- * your VM, see [Using cloud-init to customize a Linux VM during
- * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- *
- * @param {object} [parameters.osProfile.windowsConfiguration] Specifies
- * Windows operating system settings on the virtual machine.
- *
- * @param {boolean}
- * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates
- * whether virtual machine agent should be provisioned on the virtual machine.
- *
When this property is not specified in the request body, default
- * behavior is to set it to true. This will ensure that VM Agent is installed
- * on the VM so that extensions can be added to the VM later.
- *
- * @param {boolean}
- * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates
- * whether virtual machine is enabled for automatic updates.
- *
- * @param {string} [parameters.osProfile.windowsConfiguration.timeZone]
- * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time"
- *
- * @param {array}
- * [parameters.osProfile.windowsConfiguration.additionalUnattendContent]
- * Specifies additional base-64 encoded XML formatted information that can be
- * included in the Unattend.xml file, which is used by Windows Setup.
- *
- * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies
- * the Windows Remote Management listeners. This enables remote Windows
- * PowerShell.
- *
- * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners]
- * The list of Windows Remote Management listeners
- *
- * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the
- * Linux operating system settings on the virtual machine.
For a list
- * of supported Linux distributions, see [Linux on Azure-Endorsed
- * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- *
For running non-endorsed distributions, see [Information for
- * Non-Endorsed
- * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).
- *
- * @param {boolean}
- * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication]
- * Specifies whether password authentication should be disabled.
- *
- * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the
- * ssh key configuration for a Linux OS.
- *
- * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The
- * list of SSH public keys used to authenticate with linux based VMs.
- *
- * @param {array} [parameters.osProfile.secrets] Specifies set of certificates
- * that should be installed onto the virtual machine.
- *
- * @param {object} [parameters.networkProfile] Specifies the network interfaces
- * of the virtual machine.
- *
- * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the
- * list of resource Ids for the network interfaces associated with the virtual
- * machine.
- *
- * @param {object} [parameters.diagnosticsProfile] Specifies the boot
- * diagnostic settings state.
Minimum api-version: 2015-06-15.
- *
- * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot
- * Diagnostics is a debugging feature which allows you to view Console Output
- * and Screenshot to diagnose VM status.
For Linux Virtual Machines,
- * you can easily view the output of your console log.
For both
- * Windows and Linux virtual machines, Azure also enables you to see a
- * screenshot of the VM from the hypervisor.
- *
- * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled]
- * Whether boot diagnostics should be enabled on the Virtual Machine.
- *
- * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri]
- * Uri of the storage account to use for placing the console output and
- * screenshot.
- *
- * @param {object} [parameters.availabilitySet] Specifies information about the
- * availability set that the virtual machine should be assigned to. Virtual
- * machines specified in the same availability set are allocated to different
- * nodes to maximize availability. For more information about availability
- * sets, see [Manage the availability of virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- *
For more information on Azure planned maintainance, see [Planned
- * maintenance for virtual machines in
- * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
- *
Currently, a VM can only be added to availability set at creation
- * time. An existing VM cannot be added to an availability set.
- *
- * @param {string} [parameters.availabilitySet.id] Resource Id
- *
- * @param {string} [parameters.licenseType] Specifies that the image or disk
- * that is being used was licensed on-premises. This element is only used for
- * images that contain the Windows Server operating system.
Possible
- * values are:
Windows_Client
Windows_Server
If this
- * element is included in a request for an update, the value must match the
- * initial value. This value cannot be updated.
For more information,
- * see [Azure Hybrid Use Benefit for Windows
- * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
- *
Minimum api-version: 2015-06-15
- *
- * @param {object} [parameters.identity] The identity of the virtual machine,
- * if configured.
- *
- * @param {string} [parameters.identity.type] The type of identity used for the
- * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an
- * implicitly created identity and a set of user assigned identities. The type
- * 'None' will remove any identities from the virtual machine. Possible values
- * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned',
- * 'None'
- *
- * @param {array} [parameters.identity.identityIds] The list of user identities
- * associated with the Virtual Machine. The user identity references will be
- * ARM resource ids in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
- *
- * @param {array} [parameters.zones] The virtual machine zones.
- *
- * @param {string} parameters.location Resource location
- *
- * @param {object} [parameters.tags] Resource tags
- *
- * @param {object} [options] Optional Parameters.
- *
- * @param {object} [options.customHeaders] Headers that will be added to the
- * request
- *
- * @returns {Promise} A promise is returned
- *
- * @resolve {HttpOperationResponse} - The deserialized result object.
- *
- * @reject {Error|ServiceError} - The error object.
- */
- createOrUpdateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
-
- /**
- * The operation to create or update a virtual machine.
- *
- * @param {string} resourceGroupName The name of the resource group.
- *
- * @param {string} vmName The name of the virtual machine.
- *
- * @param {object} parameters Parameters supplied to the Create Virtual Machine
- * operation.
- *
- * @param {object} [parameters.plan] Specifies information about the
- * marketplace image used to create the virtual machine. This element is only
- * used for marketplace images. Before you can use a marketplace image from an
- * API, you must enable the image for programmatic use. In the Azure portal,
- * find the marketplace image that you want to use and then click **Want to
- * deploy programmatically, Get Started ->**. Enter any required information
- * and then click **Save**.
- *
- * @param {string} [parameters.plan.name] The plan ID.
- *
- * @param {string} [parameters.plan.publisher] The publisher ID.
- *
- * @param {string} [parameters.plan.product] Specifies the product of the image
- * from the marketplace. This is the same value as Offer under the
- * imageReference element.
- *
- * @param {string} [parameters.plan.promotionCode] The promotion code.
- *
- * @param {object} [parameters.hardwareProfile] Specifies the hardware settings
- * for the virtual machine.
- *
- * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of
- * the virtual machine. For more information about virtual machine sizes, see
- * [Sizes for virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- *
The available VM sizes depend on region and availability set. For a
- * list of available sizes use these APIs:
[List all available
- * virtual machine sizes in an availability
- * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes)
- *
[List all available virtual machine sizes in a
- * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list)
- *
[List all available virtual machine sizes for
- * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes).
- * Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3',
- * 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3',
- * 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8',
- * 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2',
- * 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2',
- * 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms',
- * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms',
- * 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11',
- * 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2',
- * 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2',
- * 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3',
- * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3',
- * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3',
- * 'Standard_D64s_v3', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2',
- * 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2',
- * 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12',
- * 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2',
- * 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2',
- * 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2',
- * 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2',
- * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3',
- * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3',
- * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3',
- * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3',
- * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3',
- * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4',
- * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s',
- * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2',
- * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2',
- * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1',
- * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1',
- * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5',
- * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8',
- * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m',
- * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s',
- * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms',
- * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms',
- * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms',
- * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r',
- * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2',
- * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3',
- * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s',
- * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6',
- * 'Standard_NV12', 'Standard_NV24'
- *
- * @param {object} [parameters.storageProfile] Specifies the storage settings
- * for the virtual machine disks.
- *
- * @param {object} [parameters.storageProfile.imageReference] Specifies
- * information about the image to use. You can specify information about
- * platform images, marketplace images, or virtual machine images. This element
- * is required when you want to use a platform image, marketplace image, or
- * virtual machine image, but is not used in other creation operations.
- *
- * @param {string} [parameters.storageProfile.imageReference.publisher] The
- * image publisher.
- *
- * @param {string} [parameters.storageProfile.imageReference.offer] Specifies
- * the offer of the platform image or marketplace image used to create the
- * virtual machine.
- *
- * @param {string} [parameters.storageProfile.imageReference.sku] The image
- * SKU.
- *
- * @param {string} [parameters.storageProfile.imageReference.version] Specifies
- * the version of the platform image or marketplace image used to create the
- * virtual machine. The allowed formats are Major.Minor.Build or 'latest'.
- * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the
- * latest version of an image available at deploy time. Even if you use
- * 'latest', the VM image will not automatically update after deploy time even
- * if a new version becomes available.
- *
- * @param {string} [parameters.storageProfile.imageReference.id] Resource Id
- *
- * @param {object} [parameters.storageProfile.osDisk] Specifies information
- * about the operating system disk used by the virtual machine.
For
- * more information about disks, see [About disks and VHDs for Azure virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- *
- * @param {string} [parameters.storageProfile.osDisk.osType] This property
- * allows you to specify the type of the OS that is included in the disk if
- * creating a VM from user-image or a specialized VHD.
Possible values
- * are:
**Windows**
**Linux**. Possible values include:
- * 'Windows', 'Linux'
- *
- * @param {object} [parameters.storageProfile.osDisk.encryptionSettings]
- * Specifies the encryption settings for the OS Disk.
Minimum
- * api-version: 2015-06-15
- *
- * @param {object}
- * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey]
- * Specifies the location of the disk encryption key, which is a Key Vault
- * Secret.
- *
- * @param {string}
- * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl
- * The URL referencing a secret in a Key Vault.
- *
- * @param {object}
- * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault
- * The relative URL of the Key Vault containing the secret.
- *
- * @param {object}
- * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey]
- * Specifies the location of the key encryption key in Key Vault.
- *
- * @param {string}
- * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl
- * The URL referencing a key encryption key in Key Vault.
- *
- * @param {object}
- * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault
- * The relative URL of the Key Vault containing the key.
- *
- * @param {boolean}
- * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies
- * whether disk encryption should be enabled on the virtual machine.
- *
- * @param {string} [parameters.storageProfile.osDisk.name] The disk name.
- *
- * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard
- * disk.
- *
- * @param {object} [parameters.storageProfile.osDisk.image] The source user
- * image virtual hard disk. The virtual hard disk will be copied before being
- * attached to the virtual machine. If SourceImage is provided, the destination
- * virtual hard drive must not exist.
- *
- * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the
- * virtual hard disk's uri.
- *
- * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the
- * caching requirements.
Possible values are:
**None**
- *
**ReadOnly**
**ReadWrite**
Default: **None for
- * Standard storage. ReadOnly for Premium storage**. Possible values include:
- * 'None', 'ReadOnly', 'ReadWrite'
- *
- * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled]
- * Specifies whether writeAccelerator should be enabled or disabled on the
- * disk.
- *
- * @param {string} parameters.storageProfile.osDisk.createOption Specifies how
- * the virtual machine should be created.
Possible values are:
- * **Attach** \u2013 This value is used when you are using a specialized disk
- * to create the virtual machine.
**FromImage** \u2013 This value is
- * used when you are using an image to create the virtual machine. If you are
- * using a platform image, you also use the imageReference element described
- * above. If you are using a marketplace image, you also use the plan element
- * previously described. Possible values include: 'FromImage', 'Empty',
- * 'Attach'
- *
- * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the
- * size of an empty data disk in gigabytes. This element can be used to
- * overwrite the name of the disk in a virtual machine image.
This
- * value cannot be larger than 1023 GB
- *
- * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed
- * disk parameters.
- *
- * @param {string}
- * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies
- * the storage account type for the managed disk. Possible values are:
- * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
- *
- * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource
- * Id
- *
- * @param {array} [parameters.storageProfile.dataDisks] Specifies the
- * parameters that are used to add a data disk to a virtual machine.
- * For more information about disks, see [About disks and VHDs for Azure
- * virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- *
- * @param {object} [parameters.osProfile] Specifies the operating system
- * settings for the virtual machine.
- *
- * @param {string} [parameters.osProfile.computerName] Specifies the host OS
- * name of the virtual machine.
**Max-length (Windows):** 15
- * characters
**Max-length (Linux):** 64 characters.
For
- * naming conventions and restrictions see [Azure infrastructure services
- * implementation
- * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions).
- *
- * @param {string} [parameters.osProfile.adminUsername] Specifies the name of
- * the administrator account.
**Windows-only restriction:** Cannot end
- * in "."
**Disallowed values:** "administrator", "admin", "user",
- * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a",
- * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest",
- * "john", "owner", "root", "server", "sql", "support", "support_388945a0",
- * "sys", "test2", "test3", "user4", "user5".
**Minimum-length
- * (Linux):** 1 character
**Max-length (Linux):** 64 characters
- *
**Max-length (Windows):** 20 characters
For root
- * access to the Linux VM, see [Using root privileges on Linux virtual machines
- * in
- * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- * For a list of built-in system users on Linux that should not be used in this
- * field, see [Selecting User Names for Linux on
- * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- *
- * @param {string} [parameters.osProfile.adminPassword] Specifies the password
- * of the administrator account.
**Minimum-length (Windows):** 8
- * characters
**Minimum-length (Linux):** 6 characters
- * **Max-length (Windows):** 123 characters
**Max-length (Linux):** 72
- * characters
**Complexity requirements:** 3 out of 4 conditions below
- * need to be fulfilled
Has lower characters
Has upper characters
- * Has a digit
Has a special character (Regex match [\W_])
- * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123",
- * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22",
- * "iloveyou!"
For resetting the password, see [How to reset the
- * Remote Desktop service or its login password in a Windows
- * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
- *
For resetting root password, see [Manage users, SSH, and check or
- * repair disks on Azure Linux VMs using the VMAccess
- * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password)
- *
- * @param {string} [parameters.osProfile.customData] Specifies a base-64
- * encoded string of custom data. The base-64 encoded string is decoded to a
- * binary array that is saved as a file on the Virtual Machine. The maximum
- * length of the binary array is 65535 bytes.
For using cloud-init for
- * your VM, see [Using cloud-init to customize a Linux VM during
- * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- *
- * @param {object} [parameters.osProfile.windowsConfiguration] Specifies
- * Windows operating system settings on the virtual machine.
- *
- * @param {boolean}
- * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates
- * whether virtual machine agent should be provisioned on the virtual machine.
- *
When this property is not specified in the request body, default
- * behavior is to set it to true. This will ensure that VM Agent is installed
- * on the VM so that extensions can be added to the VM later.
- *
- * @param {boolean}
- * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates
- * whether virtual machine is enabled for automatic updates.
- *
- * @param {string} [parameters.osProfile.windowsConfiguration.timeZone]
- * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time"
- *
- * @param {array}
- * [parameters.osProfile.windowsConfiguration.additionalUnattendContent]
- * Specifies additional base-64 encoded XML formatted information that can be
- * included in the Unattend.xml file, which is used by Windows Setup.
- *
- * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies
- * the Windows Remote Management listeners. This enables remote Windows
- * PowerShell.
- *
- * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners]
- * The list of Windows Remote Management listeners
- *
- * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the
- * Linux operating system settings on the virtual machine.
For a list
- * of supported Linux distributions, see [Linux on Azure-Endorsed
- * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- *
For running non-endorsed distributions, see [Information for
- * Non-Endorsed
- * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).
- *
- * @param {boolean}
- * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication]
- * Specifies whether password authentication should be disabled.
- *
- * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the
- * ssh key configuration for a Linux OS.
- *
- * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The
- * list of SSH public keys used to authenticate with linux based VMs.
- *
- * @param {array} [parameters.osProfile.secrets] Specifies set of certificates
- * that should be installed onto the virtual machine.
- *
- * @param {object} [parameters.networkProfile] Specifies the network interfaces
- * of the virtual machine.
- *
- * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the
- * list of resource Ids for the network interfaces associated with the virtual
- * machine.
- *
- * @param {object} [parameters.diagnosticsProfile] Specifies the boot
- * diagnostic settings state.
Minimum api-version: 2015-06-15.
- *
- * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot
- * Diagnostics is a debugging feature which allows you to view Console Output
- * and Screenshot to diagnose VM status.
For Linux Virtual Machines,
- * you can easily view the output of your console log.
For both
- * Windows and Linux virtual machines, Azure also enables you to see a
- * screenshot of the VM from the hypervisor.
- *
- * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled]
- * Whether boot diagnostics should be enabled on the Virtual Machine.
- *
- * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri]
- * Uri of the storage account to use for placing the console output and
- * screenshot.
- *
- * @param {object} [parameters.availabilitySet] Specifies information about the
- * availability set that the virtual machine should be assigned to. Virtual
- * machines specified in the same availability set are allocated to different
- * nodes to maximize availability. For more information about availability
- * sets, see [Manage the availability of virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- *
For more information on Azure planned maintainance, see [Planned
- * maintenance for virtual machines in
- * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
- *
Currently, a VM can only be added to availability set at creation
- * time. An existing VM cannot be added to an availability set.
- *
- * @param {string} [parameters.availabilitySet.id] Resource Id
- *
- * @param {string} [parameters.licenseType] Specifies that the image or disk
- * that is being used was licensed on-premises. This element is only used for
- * images that contain the Windows Server operating system.
Possible
- * values are:
Windows_Client
Windows_Server
If this
- * element is included in a request for an update, the value must match the
- * initial value. This value cannot be updated.
For more information,
- * see [Azure Hybrid Use Benefit for Windows
- * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
- *
Minimum api-version: 2015-06-15
- *
- * @param {object} [parameters.identity] The identity of the virtual machine,
- * if configured.
- *
- * @param {string} [parameters.identity.type] The type of identity used for the
- * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an
- * implicitly created identity and a set of user assigned identities. The type
- * 'None' will remove any identities from the virtual machine. Possible values
- * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned',
- * 'None'
- *
- * @param {array} [parameters.identity.identityIds] The list of user identities
- * associated with the Virtual Machine. The user identity references will be
- * ARM resource ids in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
- *
- * @param {array} [parameters.zones] The virtual machine zones.
- *
- * @param {string} parameters.location Resource location
- *
- * @param {object} [parameters.tags] Resource tags
- *
- * @param {object} [options] Optional Parameters.
- *
- * @param {object} [options.customHeaders] Headers that will be added to the
- * request
- *
- * @param {ServiceCallback} [optionalCallback] - The optional callback.
- *
- * @returns {ServiceCallback|Promise} If a callback was passed as the last
- * parameter then it returns the callback else returns a Promise.
- *
- * {Promise} A promise is returned.
- *
- * @resolve {VirtualMachine} - The deserialized result object.
- *
- * @reject {Error|ServiceError} - The error object.
- *
- * {ServiceCallback} optionalCallback(err, result, request, response)
- *
- * {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
- *
- * {VirtualMachine} [result] - The deserialized result object if an error did not occur.
- * See {@link VirtualMachine} for more information.
- *
- * {WebResource} [request] - The HTTP Request object if an error did not occur.
- *
- * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
- */
- createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, callback: ServiceCallback): void;
- createOrUpdate(resourceGroupName: string, vmName: string, parameters: models.VirtualMachine, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
-
-
- /**
- * The operation to update a virtual machine.
- *
- * @param {string} resourceGroupName The name of the resource group.
- *
- * @param {string} vmName The name of the virtual machine.
- *
- * @param {object} parameters Parameters supplied to the Update Virtual Machine
- * operation.
- *
- * @param {object} [parameters.plan] Specifies information about the
- * marketplace image used to create the virtual machine. This element is only
- * used for marketplace images. Before you can use a marketplace image from an
- * API, you must enable the image for programmatic use. In the Azure portal,
- * find the marketplace image that you want to use and then click **Want to
- * deploy programmatically, Get Started ->**. Enter any required information
- * and then click **Save**.
- *
- * @param {string} [parameters.plan.name] The plan ID.
- *
- * @param {string} [parameters.plan.publisher] The publisher ID.
- *
- * @param {string} [parameters.plan.product] Specifies the product of the image
- * from the marketplace. This is the same value as Offer under the
- * imageReference element.
- *
- * @param {string} [parameters.plan.promotionCode] The promotion code.
- *
- * @param {object} [parameters.hardwareProfile] Specifies the hardware settings
- * for the virtual machine.
- *
- * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of
- * the virtual machine. For more information about virtual machine sizes, see
- * [Sizes for virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- *
The available VM sizes depend on region and availability set. For a
- * list of available sizes use these APIs:
[List all available
- * virtual machine sizes in an availability
- * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes)
- *
[List all available virtual machine sizes in a
- * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list)
- *
[List all available virtual machine sizes for
- * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes).
- * Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3',
- * 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3',
- * 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8',
- * 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2',
- * 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2',
- * 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms',
- * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms',
- * 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11',
- * 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2',
- * 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2',
- * 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3',
- * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3',
- * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3',
- * 'Standard_D64s_v3', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2',
- * 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2',
- * 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12',
- * 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2',
- * 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2',
- * 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2',
- * 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2',
- * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3',
- * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3',
- * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3',
- * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3',
- * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3',
- * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4',
- * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s',
- * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2',
- * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2',
- * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1',
- * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1',
- * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5',
- * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8',
- * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m',
- * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s',
- * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms',
- * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms',
- * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms',
- * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r',
- * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2',
- * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3',
- * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s',
- * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6',
- * 'Standard_NV12', 'Standard_NV24'
- *
- * @param {object} [parameters.storageProfile] Specifies the storage settings
- * for the virtual machine disks.
- *
- * @param {object} [parameters.storageProfile.imageReference] Specifies
- * information about the image to use. You can specify information about
- * platform images, marketplace images, or virtual machine images. This element
- * is required when you want to use a platform image, marketplace image, or
- * virtual machine image, but is not used in other creation operations.
+ * @returns {Promise} A promise is returned
*
- * @param {string} [parameters.storageProfile.imageReference.publisher] The
- * image publisher.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
- * @param {string} [parameters.storageProfile.imageReference.offer] Specifies
- * the offer of the platform image or marketplace image used to create the
- * virtual machine.
+ * @reject {Error|ServiceError} - The error object.
+ */
+ listPublishersWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+
+ /**
+ * Gets a list of virtual machine image publishers for the specified Azure
+ * location.
*
- * @param {string} [parameters.storageProfile.imageReference.sku] The image
- * SKU.
+ * @param {string} location The name of a supported Azure region.
*
- * @param {string} [parameters.storageProfile.imageReference.version] Specifies
- * the version of the platform image or marketplace image used to create the
- * virtual machine. The allowed formats are Major.Minor.Build or 'latest'.
- * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the
- * latest version of an image available at deploy time. Even if you use
- * 'latest', the VM image will not automatically update after deploy time even
- * if a new version becomes available.
+ * @param {object} [options] Optional Parameters.
*
- * @param {string} [parameters.storageProfile.imageReference.id] Resource Id
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
*
- * @param {object} [parameters.storageProfile.osDisk] Specifies information
- * about the operating system disk used by the virtual machine.
For
- * more information about disks, see [About disks and VHDs for Azure virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
+ * @param {ServiceCallback} [optionalCallback] - The optional callback.
*
- * @param {string} [parameters.storageProfile.osDisk.osType] This property
- * allows you to specify the type of the OS that is included in the disk if
- * creating a VM from user-image or a specialized VHD.
Possible values
- * are:
**Windows**
**Linux**. Possible values include:
- * 'Windows', 'Linux'
+ * @returns {ServiceCallback|Promise} If a callback was passed as the last
+ * parameter then it returns the callback else returns a Promise.
*
- * @param {object} [parameters.storageProfile.osDisk.encryptionSettings]
- * Specifies the encryption settings for the OS Disk.
Minimum
- * api-version: 2015-06-15
+ * {Promise} A promise is returned.
*
- * @param {object}
- * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey]
- * Specifies the location of the disk encryption key, which is a Key Vault
- * Secret.
+ * @resolve {Array} - The deserialized result object.
*
- * @param {string}
- * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl
- * The URL referencing a secret in a Key Vault.
+ * @reject {Error|ServiceError} - The error object.
*
- * @param {object}
- * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault
- * The relative URL of the Key Vault containing the secret.
+ * {ServiceCallback} optionalCallback(err, result, request, response)
*
- * @param {object}
- * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey]
- * Specifies the location of the key encryption key in Key Vault.
+ * {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * @param {string}
- * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl
- * The URL referencing a key encryption key in Key Vault.
+ * {Array} [result] - The deserialized result object if an error did not occur.
*
- * @param {object}
- * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault
- * The relative URL of the Key Vault containing the key.
+ * {WebResource} [request] - The HTTP Request object if an error did not occur.
*
- * @param {boolean}
- * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies
- * whether disk encryption should be enabled on the virtual machine.
+ * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listPublishers(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ listPublishers(location: string, callback: ServiceCallback): void;
+ listPublishers(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+
+
+ /**
+ * Gets a list of virtual machine image SKUs for the specified location,
+ * publisher, and offer.
*
- * @param {string} [parameters.storageProfile.osDisk.name] The disk name.
+ * @param {string} location The name of a supported Azure region.
*
- * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard
- * disk.
+ * @param {string} publisherName A valid image publisher.
*
- * @param {object} [parameters.storageProfile.osDisk.image] The source user
- * image virtual hard disk. The virtual hard disk will be copied before being
- * attached to the virtual machine. If SourceImage is provided, the destination
- * virtual hard drive must not exist.
+ * @param {string} offer A valid image publisher offer.
*
- * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the
- * virtual hard disk's uri.
+ * @param {object} [options] Optional Parameters.
*
- * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the
- * caching requirements.
Possible values are:
**None**
- *
**ReadOnly**
**ReadWrite**
Default: **None for
- * Standard storage. ReadOnly for Premium storage**. Possible values include:
- * 'None', 'ReadOnly', 'ReadWrite'
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
*
- * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled]
- * Specifies whether writeAccelerator should be enabled or disabled on the
- * disk.
+ * @returns {Promise} A promise is returned
*
- * @param {string} parameters.storageProfile.osDisk.createOption Specifies how
- * the virtual machine should be created.
Possible values are:
- * **Attach** \u2013 This value is used when you are using a specialized disk
- * to create the virtual machine.
**FromImage** \u2013 This value is
- * used when you are using an image to create the virtual machine. If you are
- * using a platform image, you also use the imageReference element described
- * above. If you are using a marketplace image, you also use the plan element
- * previously described. Possible values include: 'FromImage', 'Empty',
- * 'Attach'
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
- * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the
- * size of an empty data disk in gigabytes. This element can be used to
- * overwrite the name of the disk in a virtual machine image.
This
- * value cannot be larger than 1023 GB
+ * @reject {Error|ServiceError} - The error object.
+ */
+ listSkusWithHttpOperationResponse(location: string, publisherName: string, offer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+
+ /**
+ * Gets a list of virtual machine image SKUs for the specified location,
+ * publisher, and offer.
*
- * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed
- * disk parameters.
+ * @param {string} location The name of a supported Azure region.
*
- * @param {string}
- * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies
- * the storage account type for the managed disk. Possible values are:
- * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * @param {string} publisherName A valid image publisher.
*
- * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource
- * Id
+ * @param {string} offer A valid image publisher offer.
*
- * @param {array} [parameters.storageProfile.dataDisks] Specifies the
- * parameters that are used to add a data disk to a virtual machine.
- * For more information about disks, see [About disks and VHDs for Azure
- * virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
+ * @param {object} [options] Optional Parameters.
*
- * @param {object} [parameters.osProfile] Specifies the operating system
- * settings for the virtual machine.
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
*
- * @param {string} [parameters.osProfile.computerName] Specifies the host OS
- * name of the virtual machine.
**Max-length (Windows):** 15
- * characters
**Max-length (Linux):** 64 characters.
For
- * naming conventions and restrictions see [Azure infrastructure services
- * implementation
- * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions).
+ * @param {ServiceCallback} [optionalCallback] - The optional callback.
*
- * @param {string} [parameters.osProfile.adminUsername] Specifies the name of
- * the administrator account.
**Windows-only restriction:** Cannot end
- * in "."
**Disallowed values:** "administrator", "admin", "user",
- * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a",
- * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest",
- * "john", "owner", "root", "server", "sql", "support", "support_388945a0",
- * "sys", "test2", "test3", "user4", "user5".
**Minimum-length
- * (Linux):** 1 character
**Max-length (Linux):** 64 characters
- *
**Max-length (Windows):** 20 characters
For root
- * access to the Linux VM, see [Using root privileges on Linux virtual machines
- * in
- * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- * For a list of built-in system users on Linux that should not be used in this
- * field, see [Selecting User Names for Linux on
- * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
+ * @returns {ServiceCallback|Promise} If a callback was passed as the last
+ * parameter then it returns the callback else returns a Promise.
*
- * @param {string} [parameters.osProfile.adminPassword] Specifies the password
- * of the administrator account.
**Minimum-length (Windows):** 8
- * characters
**Minimum-length (Linux):** 6 characters
- * **Max-length (Windows):** 123 characters
**Max-length (Linux):** 72
- * characters
**Complexity requirements:** 3 out of 4 conditions below
- * need to be fulfilled
Has lower characters
Has upper characters
- * Has a digit
Has a special character (Regex match [\W_])
- * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123",
- * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22",
- * "iloveyou!"
For resetting the password, see [How to reset the
- * Remote Desktop service or its login password in a Windows
- * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
- *
For resetting root password, see [Manage users, SSH, and check or
- * repair disks on Azure Linux VMs using the VMAccess
- * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password)
+ * {Promise} A promise is returned.
*
- * @param {string} [parameters.osProfile.customData] Specifies a base-64
- * encoded string of custom data. The base-64 encoded string is decoded to a
- * binary array that is saved as a file on the Virtual Machine. The maximum
- * length of the binary array is 65535 bytes.
For using cloud-init for
- * your VM, see [Using cloud-init to customize a Linux VM during
- * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
+ * @resolve {Array} - The deserialized result object.
*
- * @param {object} [parameters.osProfile.windowsConfiguration] Specifies
- * Windows operating system settings on the virtual machine.
+ * @reject {Error|ServiceError} - The error object.
*
- * @param {boolean}
- * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates
- * whether virtual machine agent should be provisioned on the virtual machine.
- *
When this property is not specified in the request body, default
- * behavior is to set it to true. This will ensure that VM Agent is installed
- * on the VM so that extensions can be added to the VM later.
+ * {ServiceCallback} optionalCallback(err, result, request, response)
*
- * @param {boolean}
- * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates
- * whether virtual machine is enabled for automatic updates.
+ * {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * @param {string} [parameters.osProfile.windowsConfiguration.timeZone]
- * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time"
+ * {Array} [result] - The deserialized result object if an error did not occur.
*
- * @param {array}
- * [parameters.osProfile.windowsConfiguration.additionalUnattendContent]
- * Specifies additional base-64 encoded XML formatted information that can be
- * included in the Unattend.xml file, which is used by Windows Setup.
+ * {WebResource} [request] - The HTTP Request object if an error did not occur.
*
- * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies
- * the Windows Remote Management listeners. This enables remote Windows
- * PowerShell.
+ * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listSkus(location: string, publisherName: string, offer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ listSkus(location: string, publisherName: string, offer: string, callback: ServiceCallback): void;
+ listSkus(location: string, publisherName: string, offer: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+}
+
+/**
+ * @class
+ * UsageOperations
+ * __NOTE__: An instance of this class is automatically created for an
+ * instance of the ComputeManagementClient.
+ */
+export interface UsageOperations {
+
+
+ /**
+ * Gets, for the specified location, the current compute resource usage
+ * information as well as the limits for compute resources under the
+ * subscription.
*
- * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners]
- * The list of Windows Remote Management listeners
+ * @param {string} location The location for which resource usage is queried.
*
- * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the
- * Linux operating system settings on the virtual machine.
For a list
- * of supported Linux distributions, see [Linux on Azure-Endorsed
- * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- *
For running non-endorsed distributions, see [Information for
- * Non-Endorsed
- * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).
+ * @param {object} [options] Optional Parameters.
*
- * @param {boolean}
- * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication]
- * Specifies whether password authentication should be disabled.
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
*
- * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the
- * ssh key configuration for a Linux OS.
+ * @returns {Promise} A promise is returned
*
- * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The
- * list of SSH public keys used to authenticate with linux based VMs.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
- * @param {array} [parameters.osProfile.secrets] Specifies set of certificates
- * that should be installed onto the virtual machine.
+ * @reject {Error|ServiceError} - The error object.
+ */
+ listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+
+ /**
+ * Gets, for the specified location, the current compute resource usage
+ * information as well as the limits for compute resources under the
+ * subscription.
*
- * @param {object} [parameters.networkProfile] Specifies the network interfaces
- * of the virtual machine.
+ * @param {string} location The location for which resource usage is queried.
*
- * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the
- * list of resource Ids for the network interfaces associated with the virtual
- * machine.
+ * @param {object} [options] Optional Parameters.
*
- * @param {object} [parameters.diagnosticsProfile] Specifies the boot
- * diagnostic settings state.
Minimum api-version: 2015-06-15.
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
*
- * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot
- * Diagnostics is a debugging feature which allows you to view Console Output
- * and Screenshot to diagnose VM status.
For Linux Virtual Machines,
- * you can easily view the output of your console log.
For both
- * Windows and Linux virtual machines, Azure also enables you to see a
- * screenshot of the VM from the hypervisor.
+ * @param {ServiceCallback} [optionalCallback] - The optional callback.
*
- * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled]
- * Whether boot diagnostics should be enabled on the Virtual Machine.
+ * @returns {ServiceCallback|Promise} If a callback was passed as the last
+ * parameter then it returns the callback else returns a Promise.
*
- * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri]
- * Uri of the storage account to use for placing the console output and
- * screenshot.
+ * {Promise} A promise is returned.
*
- * @param {object} [parameters.availabilitySet] Specifies information about the
- * availability set that the virtual machine should be assigned to. Virtual
- * machines specified in the same availability set are allocated to different
- * nodes to maximize availability. For more information about availability
- * sets, see [Manage the availability of virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- *
For more information on Azure planned maintainance, see [Planned
- * maintenance for virtual machines in
- * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
- *
Currently, a VM can only be added to availability set at creation
- * time. An existing VM cannot be added to an availability set.
+ * @resolve {ListUsagesResult} - The deserialized result object.
*
- * @param {string} [parameters.availabilitySet.id] Resource Id
+ * @reject {Error|ServiceError} - The error object.
*
- * @param {string} [parameters.licenseType] Specifies that the image or disk
- * that is being used was licensed on-premises. This element is only used for
- * images that contain the Windows Server operating system.
Possible
- * values are:
Windows_Client
Windows_Server
If this
- * element is included in a request for an update, the value must match the
- * initial value. This value cannot be updated.
For more information,
- * see [Azure Hybrid Use Benefit for Windows
- * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
- *
Minimum api-version: 2015-06-15
+ * {ServiceCallback} optionalCallback(err, result, request, response)
*
- * @param {object} [parameters.identity] The identity of the virtual machine,
- * if configured.
+ * {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * @param {string} [parameters.identity.type] The type of identity used for the
- * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an
- * implicitly created identity and a set of user assigned identities. The type
- * 'None' will remove any identities from the virtual machine. Possible values
- * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned',
- * 'None'
+ * {ListUsagesResult} [result] - The deserialized result object if an error did not occur.
+ * See {@link ListUsagesResult} for more information.
*
- * @param {array} [parameters.identity.identityIds] The list of user identities
- * associated with the Virtual Machine. The user identity references will be
- * ARM resource ids in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
+ * {WebResource} [request] - The HTTP Request object if an error did not occur.
*
- * @param {array} [parameters.zones] The virtual machine zones.
+ * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
+ */
+ list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ list(location: string, callback: ServiceCallback): void;
+ list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+
+
+ /**
+ * Gets, for the specified location, the current compute resource usage
+ * information as well as the limits for compute resources under the
+ * subscription.
*
- * @param {object} [parameters.tags] Resource tags
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
*
* @param {object} [options] Optional Parameters.
*
@@ -2907,185 +2192,169 @@ export interface VirtualMachines {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
- updateWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
- * The operation to update a virtual machine.
+ * Gets, for the specified location, the current compute resource usage
+ * information as well as the limits for compute resources under the
+ * subscription.
*
- * @param {string} resourceGroupName The name of the resource group.
+ * @param {string} nextPageLink The NextLink from the previous successful call
+ * to List operation.
*
- * @param {string} vmName The name of the virtual machine.
+ * @param {object} [options] Optional Parameters.
*
- * @param {object} parameters Parameters supplied to the Update Virtual Machine
- * operation.
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
*
- * @param {object} [parameters.plan] Specifies information about the
- * marketplace image used to create the virtual machine. This element is only
- * used for marketplace images. Before you can use a marketplace image from an
- * API, you must enable the image for programmatic use. In the Azure portal,
- * find the marketplace image that you want to use and then click **Want to
- * deploy programmatically, Get Started ->**. Enter any required information
- * and then click **Save**.
+ * @param {ServiceCallback} [optionalCallback] - The optional callback.
*
- * @param {string} [parameters.plan.name] The plan ID.
+ * @returns {ServiceCallback|Promise} If a callback was passed as the last
+ * parameter then it returns the callback else returns a Promise.
*
- * @param {string} [parameters.plan.publisher] The publisher ID.
+ * {Promise} A promise is returned.
*
- * @param {string} [parameters.plan.product] Specifies the product of the image
- * from the marketplace. This is the same value as Offer under the
- * imageReference element.
+ * @resolve {ListUsagesResult} - The deserialized result object.
*
- * @param {string} [parameters.plan.promotionCode] The promotion code.
+ * @reject {Error|ServiceError} - The error object.
*
- * @param {object} [parameters.hardwareProfile] Specifies the hardware settings
- * for the virtual machine.
+ * {ServiceCallback} optionalCallback(err, result, request, response)
*
- * @param {string} [parameters.hardwareProfile.vmSize] Specifies the size of
- * the virtual machine. For more information about virtual machine sizes, see
- * [Sizes for virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- *
The available VM sizes depend on region and availability set. For a
- * list of available sizes use these APIs:
[List all available
- * virtual machine sizes in an availability
- * set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes)
- *
[List all available virtual machine sizes in a
- * region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list)
- *
[List all available virtual machine sizes for
- * resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes).
- * Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3',
- * 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3',
- * 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8',
- * 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2',
- * 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2',
- * 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms',
- * 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms',
- * 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11',
- * 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2',
- * 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2',
- * 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3',
- * 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', 'Standard_D4s_v3',
- * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3',
- * 'Standard_D64s_v3', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2',
- * 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2',
- * 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12',
- * 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2',
- * 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2',
- * 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2',
- * 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2',
- * 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3',
- * 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3',
- * 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', 'Standard_E8s_v3',
- * 'Standard_E16s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3',
- * 'Standard_E32-16_v3', 'Standard_E32-8s_v3', 'Standard_E64-32s_v3',
- * 'Standard_E64-16s_v3', 'Standard_F1', 'Standard_F2', 'Standard_F4',
- * 'Standard_F8', 'Standard_F16', 'Standard_F1s', 'Standard_F2s',
- * 'Standard_F4s', 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2',
- * 'Standard_F4s_v2', 'Standard_F8s_v2', 'Standard_F16s_v2',
- * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1',
- * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1',
- * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5',
- * 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8',
- * 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m',
- * 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s',
- * 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms',
- * 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms',
- * 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms',
- * 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r',
- * 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2',
- * 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3',
- * 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s',
- * 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6',
- * 'Standard_NV12', 'Standard_NV24'
+ * {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
+ *
+ * {ListUsagesResult} [result] - The deserialized result object if an error did not occur.
+ * See {@link ListUsagesResult} for more information.
+ *
+ * {WebResource} [request] - The HTTP Request object if an error did not occur.
+ *
+ * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
+ */
+ listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ listNext(nextPageLink: string, callback: ServiceCallback): void;
+ listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+}
+
+/**
+ * @class
+ * VirtualMachineSizes
+ * __NOTE__: An instance of this class is automatically created for an
+ * instance of the ComputeManagementClient.
+ */
+export interface VirtualMachineSizes {
+
+
+ /**
+ * This API is deprecated. Use [Resources
+ * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list)
+ *
+ * @param {string} location The location upon which virtual-machine-sizes is
+ * queried.
+ *
+ * @param {object} [options] Optional Parameters.
+ *
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
+ *
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
- * @param {object} [parameters.storageProfile] Specifies the storage settings
- * for the virtual machine disks.
+ * @reject {Error|ServiceError} - The error object.
+ */
+ listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+
+ /**
+ * This API is deprecated. Use [Resources
+ * Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list)
*
- * @param {object} [parameters.storageProfile.imageReference] Specifies
- * information about the image to use. You can specify information about
- * platform images, marketplace images, or virtual machine images. This element
- * is required when you want to use a platform image, marketplace image, or
- * virtual machine image, but is not used in other creation operations.
+ * @param {string} location The location upon which virtual-machine-sizes is
+ * queried.
*
- * @param {string} [parameters.storageProfile.imageReference.publisher] The
- * image publisher.
+ * @param {object} [options] Optional Parameters.
*
- * @param {string} [parameters.storageProfile.imageReference.offer] Specifies
- * the offer of the platform image or marketplace image used to create the
- * virtual machine.
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
*
- * @param {string} [parameters.storageProfile.imageReference.sku] The image
- * SKU.
+ * @param {ServiceCallback} [optionalCallback] - The optional callback.
*
- * @param {string} [parameters.storageProfile.imageReference.version] Specifies
- * the version of the platform image or marketplace image used to create the
- * virtual machine. The allowed formats are Major.Minor.Build or 'latest'.
- * Major, Minor, and Build are decimal numbers. Specify 'latest' to use the
- * latest version of an image available at deploy time. Even if you use
- * 'latest', the VM image will not automatically update after deploy time even
- * if a new version becomes available.
+ * @returns {ServiceCallback|Promise} If a callback was passed as the last
+ * parameter then it returns the callback else returns a Promise.
*
- * @param {string} [parameters.storageProfile.imageReference.id] Resource Id
+ * {Promise} A promise is returned.
*
- * @param {object} [parameters.storageProfile.osDisk] Specifies information
- * about the operating system disk used by the virtual machine.
For
- * more information about disks, see [About disks and VHDs for Azure virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
+ * @resolve {VirtualMachineSizeListResult} - The deserialized result object.
*
- * @param {string} [parameters.storageProfile.osDisk.osType] This property
- * allows you to specify the type of the OS that is included in the disk if
- * creating a VM from user-image or a specialized VHD.
Possible values
- * are:
**Windows**
**Linux**. Possible values include:
- * 'Windows', 'Linux'
+ * @reject {Error|ServiceError} - The error object.
*
- * @param {object} [parameters.storageProfile.osDisk.encryptionSettings]
- * Specifies the encryption settings for the OS Disk.
Minimum
- * api-version: 2015-06-15
+ * {ServiceCallback} optionalCallback(err, result, request, response)
*
- * @param {object}
- * [parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey]
- * Specifies the location of the disk encryption key, which is a Key Vault
- * Secret.
+ * {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * @param {string}
- * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.secretUrl
- * The URL referencing a secret in a Key Vault.
+ * {VirtualMachineSizeListResult} [result] - The deserialized result object if an error did not occur.
+ * See {@link VirtualMachineSizeListResult} for more
+ * information.
*
- * @param {object}
- * parameters.storageProfile.osDisk.encryptionSettings.diskEncryptionKey.sourceVault
- * The relative URL of the Key Vault containing the secret.
+ * {WebResource} [request] - The HTTP Request object if an error did not occur.
*
- * @param {object}
- * [parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey]
- * Specifies the location of the key encryption key in Key Vault.
+ * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
+ */
+ list(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ list(location: string, callback: ServiceCallback): void;
+ list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+}
+
+/**
+ * @class
+ * Images
+ * __NOTE__: An instance of this class is automatically created for an
+ * instance of the ComputeManagementClient.
+ */
+export interface Images {
+
+
+ /**
+ * Create or update an image.
*
- * @param {string}
- * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.keyUrl
- * The URL referencing a key encryption key in Key Vault.
+ * @param {string} resourceGroupName The name of the resource group.
*
- * @param {object}
- * parameters.storageProfile.osDisk.encryptionSettings.keyEncryptionKey.sourceVault
- * The relative URL of the Key Vault containing the key.
+ * @param {string} imageName The name of the image.
*
- * @param {boolean}
- * [parameters.storageProfile.osDisk.encryptionSettings.enabled] Specifies
- * whether disk encryption should be enabled on the virtual machine.
+ * @param {object} parameters Parameters supplied to the Create Image
+ * operation.
*
- * @param {string} [parameters.storageProfile.osDisk.name] The disk name.
+ * @param {object} [parameters.sourceVirtualMachine] The source virtual machine
+ * from which Image is created.
*
- * @param {object} [parameters.storageProfile.osDisk.vhd] The virtual hard
- * disk.
+ * @param {object} [parameters.storageProfile] Specifies the storage settings
+ * for the virtual machine disks.
*
- * @param {object} [parameters.storageProfile.osDisk.image] The source user
- * image virtual hard disk. The virtual hard disk will be copied before being
- * attached to the virtual machine. If SourceImage is provided, the destination
- * virtual hard drive must not exist.
+ * @param {object} [parameters.storageProfile.osDisk] Specifies information
+ * about the operating system disk used by the virtual machine.
For
+ * more information about disks, see [About disks and VHDs for Azure virtual
+ * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
*
- * @param {string} [parameters.storageProfile.osDisk.image.uri] Specifies the
- * virtual hard disk's uri.
+ * @param {string} parameters.storageProfile.osDisk.osType This property allows
+ * you to specify the type of the OS that is included in the disk if creating a
+ * VM from a custom image.
Possible values are:
**Windows**
+ *
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} parameters.storageProfile.osDisk.osState The OS State.
+ * Possible values include: 'Generalized', 'Specialized'
+ *
+ * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot.
+ *
+ * @param {object} [parameters.storageProfile.osDisk.managedDisk] The
+ * managedDisk.
+ *
+ * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource
+ * Id
+ *
+ * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard
+ * Disk.
*
* @param {string} [parameters.storageProfile.osDisk.caching] Specifies the
* caching requirements.
Possible values are:
**None**
@@ -3093,36 +2362,15 @@ export interface VirtualMachines {
* Standard storage. ReadOnly for Premium storage**. Possible values include:
* 'None', 'ReadOnly', 'ReadWrite'
*
- * @param {boolean} [parameters.storageProfile.osDisk.writeAcceleratorEnabled]
- * Specifies whether writeAccelerator should be enabled or disabled on the
- * disk.
- *
- * @param {string} parameters.storageProfile.osDisk.createOption Specifies how
- * the virtual machine should be created.
Possible values are:
- * **Attach** \u2013 This value is used when you are using a specialized disk
- * to create the virtual machine.
**FromImage** \u2013 This value is
- * used when you are using an image to create the virtual machine. If you are
- * using a platform image, you also use the imageReference element described
- * above. If you are using a marketplace image, you also use the plan element
- * previously described. Possible values include: 'FromImage', 'Empty',
- * 'Attach'
- *
* @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the
- * size of an empty data disk in gigabytes. This element can be used to
- * overwrite the name of the disk in a virtual machine image.
This
- * value cannot be larger than 1023 GB
- *
- * @param {object} [parameters.storageProfile.osDisk.managedDisk] The managed
- * disk parameters.
- *
- * @param {string}
- * [parameters.storageProfile.osDisk.managedDisk.storageAccountType] Specifies
- * the storage account type for the managed disk. Possible values are:
- * Standard_LRS or Premium_LRS. Possible values include: 'Standard_LRS',
- * 'Premium_LRS'
+ * size of empty data disks in gigabytes. This element can be used to overwrite
+ * the name of the disk in a virtual machine image.
This value cannot
+ * be larger than 1023 GB
*
- * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource
- * Id
+ * @param {string} [parameters.storageProfile.osDisk.storageAccountType]
+ * Specifies the storage account type for the managed disk. Possible values
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
* @param {array} [parameters.storageProfile.dataDisks] Specifies the
* parameters that are used to add a data disk to a virtual machine.
@@ -3130,169 +2378,94 @@ export interface VirtualMachines {
* virtual
* machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
*
- * @param {object} [parameters.osProfile] Specifies the operating system
- * settings for the virtual machine.
- *
- * @param {string} [parameters.osProfile.computerName] Specifies the host OS
- * name of the virtual machine.
**Max-length (Windows):** 15
- * characters
**Max-length (Linux):** 64 characters.
For
- * naming conventions and restrictions see [Azure infrastructure services
- * implementation
- * guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions).
- *
- * @param {string} [parameters.osProfile.adminUsername] Specifies the name of
- * the administrator account.
**Windows-only restriction:** Cannot end
- * in "."
**Disallowed values:** "administrator", "admin", "user",
- * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a",
- * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest",
- * "john", "owner", "root", "server", "sql", "support", "support_388945a0",
- * "sys", "test2", "test3", "user4", "user5".
**Minimum-length
- * (Linux):** 1 character
**Max-length (Linux):** 64 characters
- *
**Max-length (Windows):** 20 characters
For root
- * access to the Linux VM, see [Using root privileges on Linux virtual machines
- * in
- * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- * For a list of built-in system users on Linux that should not be used in this
- * field, see [Selecting User Names for Linux on
- * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- *
- * @param {string} [parameters.osProfile.adminPassword] Specifies the password
- * of the administrator account.
**Minimum-length (Windows):** 8
- * characters
**Minimum-length (Linux):** 6 characters
- * **Max-length (Windows):** 123 characters
**Max-length (Linux):** 72
- * characters
**Complexity requirements:** 3 out of 4 conditions below
- * need to be fulfilled
Has lower characters
Has upper characters
- * Has a digit
Has a special character (Regex match [\W_])
- * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123",
- * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22",
- * "iloveyou!"
For resetting the password, see [How to reset the
- * Remote Desktop service or its login password in a Windows
- * VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
- *
For resetting root password, see [Manage users, SSH, and check or
- * repair disks on Azure Linux VMs using the VMAccess
- * Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password)
- *
- * @param {string} [parameters.osProfile.customData] Specifies a base-64
- * encoded string of custom data. The base-64 encoded string is decoded to a
- * binary array that is saved as a file on the Virtual Machine. The maximum
- * length of the binary array is 65535 bytes.
For using cloud-init for
- * your VM, see [Using cloud-init to customize a Linux VM during
- * creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- *
- * @param {object} [parameters.osProfile.windowsConfiguration] Specifies
- * Windows operating system settings on the virtual machine.
+ * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether
+ * an image is zone resilient or not. Default is false. Zone resilient images
+ * can be created only in regions that provide Zone Redundant Storage (ZRS).
*
- * @param {boolean}
- * [parameters.osProfile.windowsConfiguration.provisionVMAgent] Indicates
- * whether virtual machine agent should be provisioned on the virtual machine.
- *
When this property is not specified in the request body, default
- * behavior is to set it to true. This will ensure that VM Agent is installed
- * on the VM so that extensions can be added to the VM later.
+ * @param {string} parameters.location Resource location
*
- * @param {boolean}
- * [parameters.osProfile.windowsConfiguration.enableAutomaticUpdates] Indicates
- * whether virtual machine is enabled for automatic updates.
+ * @param {object} [parameters.tags] Resource tags
*
- * @param {string} [parameters.osProfile.windowsConfiguration.timeZone]
- * Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time"
+ * @param {object} [options] Optional Parameters.
*
- * @param {array}
- * [parameters.osProfile.windowsConfiguration.additionalUnattendContent]
- * Specifies additional base-64 encoded XML formatted information that can be
- * included in the Unattend.xml file, which is used by Windows Setup.
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
*
- * @param {object} [parameters.osProfile.windowsConfiguration.winRM] Specifies
- * the Windows Remote Management listeners. This enables remote Windows
- * PowerShell.
+ * @returns {Promise} A promise is returned
*
- * @param {array} [parameters.osProfile.windowsConfiguration.winRM.listeners]
- * The list of Windows Remote Management listeners
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
- * @param {object} [parameters.osProfile.linuxConfiguration] Specifies the
- * Linux operating system settings on the virtual machine.
For a list
- * of supported Linux distributions, see [Linux on Azure-Endorsed
- * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- *
For running non-endorsed distributions, see [Information for
- * Non-Endorsed
- * Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).
+ * @reject {Error|ServiceError} - The error object.
+ */
+ createOrUpdateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+
+ /**
+ * Create or update an image.
*
- * @param {boolean}
- * [parameters.osProfile.linuxConfiguration.disablePasswordAuthentication]
- * Specifies whether password authentication should be disabled.
+ * @param {string} resourceGroupName The name of the resource group.
*
- * @param {object} [parameters.osProfile.linuxConfiguration.ssh] Specifies the
- * ssh key configuration for a Linux OS.
+ * @param {string} imageName The name of the image.
*
- * @param {array} [parameters.osProfile.linuxConfiguration.ssh.publicKeys] The
- * list of SSH public keys used to authenticate with linux based VMs.
+ * @param {object} parameters Parameters supplied to the Create Image
+ * operation.
*
- * @param {array} [parameters.osProfile.secrets] Specifies set of certificates
- * that should be installed onto the virtual machine.
+ * @param {object} [parameters.sourceVirtualMachine] The source virtual machine
+ * from which Image is created.
*
- * @param {object} [parameters.networkProfile] Specifies the network interfaces
- * of the virtual machine.
+ * @param {object} [parameters.storageProfile] Specifies the storage settings
+ * for the virtual machine disks.
*
- * @param {array} [parameters.networkProfile.networkInterfaces] Specifies the
- * list of resource Ids for the network interfaces associated with the virtual
- * machine.
+ * @param {object} [parameters.storageProfile.osDisk] Specifies information
+ * about the operating system disk used by the virtual machine.
For
+ * more information about disks, see [About disks and VHDs for Azure virtual
+ * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
*
- * @param {object} [parameters.diagnosticsProfile] Specifies the boot
- * diagnostic settings state.
Minimum api-version: 2015-06-15.
+ * @param {string} parameters.storageProfile.osDisk.osType This property allows
+ * you to specify the type of the OS that is included in the disk if creating a
+ * VM from a custom image.
Possible values are:
**Windows**
+ *
**Linux**. Possible values include: 'Windows', 'Linux'
*
- * @param {object} [parameters.diagnosticsProfile.bootDiagnostics] Boot
- * Diagnostics is a debugging feature which allows you to view Console Output
- * and Screenshot to diagnose VM status.
For Linux Virtual Machines,
- * you can easily view the output of your console log.
For both
- * Windows and Linux virtual machines, Azure also enables you to see a
- * screenshot of the VM from the hypervisor.
+ * @param {string} parameters.storageProfile.osDisk.osState The OS State.
+ * Possible values include: 'Generalized', 'Specialized'
*
- * @param {boolean} [parameters.diagnosticsProfile.bootDiagnostics.enabled]
- * Whether boot diagnostics should be enabled on the Virtual Machine.
+ * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot.
*
- * @param {string} [parameters.diagnosticsProfile.bootDiagnostics.storageUri]
- * Uri of the storage account to use for placing the console output and
- * screenshot.
+ * @param {object} [parameters.storageProfile.osDisk.managedDisk] The
+ * managedDisk.
*
- * @param {object} [parameters.availabilitySet] Specifies information about the
- * availability set that the virtual machine should be assigned to. Virtual
- * machines specified in the same availability set are allocated to different
- * nodes to maximize availability. For more information about availability
- * sets, see [Manage the availability of virtual
- * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- *
For more information on Azure planned maintainance, see [Planned
- * maintenance for virtual machines in
- * Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
- *
Currently, a VM can only be added to availability set at creation
- * time. An existing VM cannot be added to an availability set.
+ * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource
+ * Id
*
- * @param {string} [parameters.availabilitySet.id] Resource Id
+ * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard
+ * Disk.
*
- * @param {string} [parameters.licenseType] Specifies that the image or disk
- * that is being used was licensed on-premises. This element is only used for
- * images that contain the Windows Server operating system.
Possible
- * values are:
Windows_Client
Windows_Server
If this
- * element is included in a request for an update, the value must match the
- * initial value. This value cannot be updated.
For more information,
- * see [Azure Hybrid Use Benefit for Windows
- * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
- *
Minimum api-version: 2015-06-15
+ * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the
+ * caching requirements.
Possible values are:
**None**
+ *
**ReadOnly**
**ReadWrite**
Default: **None for
+ * Standard storage. ReadOnly for Premium storage**. Possible values include:
+ * 'None', 'ReadOnly', 'ReadWrite'
*
- * @param {object} [parameters.identity] The identity of the virtual machine,
- * if configured.
+ * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the
+ * size of empty data disks in gigabytes. This element can be used to overwrite
+ * the name of the disk in a virtual machine image.
This value cannot
+ * be larger than 1023 GB
*
- * @param {string} [parameters.identity.type] The type of identity used for the
- * virtual machine. The type 'SystemAssigned, UserAssigned' includes both an
- * implicitly created identity and a set of user assigned identities. The type
- * 'None' will remove any identities from the virtual machine. Possible values
- * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned',
- * 'None'
+ * @param {string} [parameters.storageProfile.osDisk.storageAccountType]
+ * Specifies the storage account type for the managed disk. Possible values
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
- * @param {array} [parameters.identity.identityIds] The list of user identities
- * associated with the Virtual Machine. The user identity references will be
- * ARM resource ids in the form:
- * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
+ * @param {array} [parameters.storageProfile.dataDisks] Specifies the
+ * parameters that are used to add a data disk to a virtual machine.
+ * For more information about disks, see [About disks and VHDs for Azure
+ * virtual
+ * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
*
- * @param {array} [parameters.zones] The virtual machine zones.
+ * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether
+ * an image is zone resilient or not. Default is false. Zone resilient images
+ * can be created only in regions that provide Zone Redundant Storage (ZRS).
+ *
+ * @param {string} parameters.location Resource location
*
* @param {object} [parameters.tags] Resource tags
*
@@ -3308,7 +2481,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {VirtualMachine} - The deserialized result object.
+ * @resolve {Image} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -3316,114 +2489,168 @@ export interface VirtualMachines {
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * {VirtualMachine} [result] - The deserialized result object if an error did not occur.
- * See {@link VirtualMachine} for more information.
+ * {Image} [result] - The deserialized result object if an error did not occur.
+ * See {@link Image} for more information.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
- update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, callback: ServiceCallback): void;
- update(resourceGroupName: string, vmName: string, parameters: models.VirtualMachineUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, callback: ServiceCallback): void;
+ createOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
- * The operation to delete a virtual machine.
+ * Update an image.
*
* @param {string} resourceGroupName The name of the resource group.
*
- * @param {string} vmName The name of the virtual machine.
+ * @param {string} imageName The name of the image.
*
- * @param {object} [options] Optional Parameters.
+ * @param {object} parameters Parameters supplied to the Update Image
+ * operation.
*
- * @param {object} [options.customHeaders] Headers that will be added to the
- * request
+ * @param {object} [parameters.sourceVirtualMachine] The source virtual machine
+ * from which Image is created.
*
- * @returns {Promise} A promise is returned
+ * @param {object} [parameters.storageProfile] Specifies the storage settings
+ * for the virtual machine disks.
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @param {object} [parameters.storageProfile.osDisk] Specifies information
+ * about the operating system disk used by the virtual machine.
For
+ * more information about disks, see [About disks and VHDs for Azure virtual
+ * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
*
- * @reject {Error|ServiceError} - The error object.
- */
- deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
-
- /**
- * The operation to delete a virtual machine.
+ * @param {string} parameters.storageProfile.osDisk.osType This property allows
+ * you to specify the type of the OS that is included in the disk if creating a
+ * VM from a custom image.
Possible values are:
**Windows**
+ *
**Linux**. Possible values include: 'Windows', 'Linux'
*
- * @param {string} resourceGroupName The name of the resource group.
+ * @param {string} parameters.storageProfile.osDisk.osState The OS State.
+ * Possible values include: 'Generalized', 'Specialized'
*
- * @param {string} vmName The name of the virtual machine.
+ * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot.
*
- * @param {object} [options] Optional Parameters.
+ * @param {object} [parameters.storageProfile.osDisk.managedDisk] The
+ * managedDisk.
*
- * @param {object} [options.customHeaders] Headers that will be added to the
- * request
+ * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource
+ * Id
*
- * @param {ServiceCallback} [optionalCallback] - The optional callback.
+ * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard
+ * Disk.
*
- * @returns {ServiceCallback|Promise} If a callback was passed as the last
- * parameter then it returns the callback else returns a Promise.
+ * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the
+ * caching requirements.
Possible values are:
**None**
+ *
**ReadOnly**
**ReadWrite**
Default: **None for
+ * Standard storage. ReadOnly for Premium storage**. Possible values include:
+ * 'None', 'ReadOnly', 'ReadWrite'
*
- * {Promise} A promise is returned.
+ * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the
+ * size of empty data disks in gigabytes. This element can be used to overwrite
+ * the name of the disk in a virtual machine image.
This value cannot
+ * be larger than 1023 GB
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @param {string} [parameters.storageProfile.osDisk.storageAccountType]
+ * Specifies the storage account type for the managed disk. Possible values
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
- * @reject {Error|ServiceError} - The error object.
+ * @param {array} [parameters.storageProfile.dataDisks] Specifies the
+ * parameters that are used to add a data disk to a virtual machine.
+ * For more information about disks, see [About disks and VHDs for Azure
+ * virtual
+ * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
*
- * {ServiceCallback} optionalCallback(err, result, request, response)
+ * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether
+ * an image is zone resilient or not. Default is false. Zone resilient images
+ * can be created only in regions that provide Zone Redundant Storage (ZRS).
*
- * {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
+ * @param {object} [parameters.tags] Resource tags
*
- * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * @param {object} [options] Optional Parameters.
*
- * {WebResource} [request] - The HTTP Request object if an error did not occur.
+ * @param {object} [options.customHeaders] Headers that will be added to the
+ * request
*
- * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
+ * @returns {Promise} A promise is returned
+ *
+ * @resolve {HttpOperationResponse} - The deserialized result object.
+ *
+ * @reject {Error|ServiceError} - The error object.
*/
- deleteMethod(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- deleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- deleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
-
+ updateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
- * Retrieves information about the model view or the instance view of a virtual
- * machine.
+ * Update an image.
*
* @param {string} resourceGroupName The name of the resource group.
*
- * @param {string} vmName The name of the virtual machine.
+ * @param {string} imageName The name of the image.
*
- * @param {object} [options] Optional Parameters.
+ * @param {object} parameters Parameters supplied to the Update Image
+ * operation.
*
- * @param {string} [options.expand] The expand expression to apply on the
- * operation. Possible values include: 'instanceView'
+ * @param {object} [parameters.sourceVirtualMachine] The source virtual machine
+ * from which Image is created.
*
- * @param {object} [options.customHeaders] Headers that will be added to the
- * request
+ * @param {object} [parameters.storageProfile] Specifies the storage settings
+ * for the virtual machine disks.
*
- * @returns {Promise} A promise is returned
+ * @param {object} [parameters.storageProfile.osDisk] Specifies information
+ * about the operating system disk used by the virtual machine.
For
+ * more information about disks, see [About disks and VHDs for Azure virtual
+ * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @param {string} parameters.storageProfile.osDisk.osType This property allows
+ * you to specify the type of the OS that is included in the disk if creating a
+ * VM from a custom image.
Possible values are:
**Windows**
+ *
**Linux**. Possible values include: 'Windows', 'Linux'
*
- * @reject {Error|ServiceError} - The error object.
- */
- getWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>;
-
- /**
- * Retrieves information about the model view or the instance view of a virtual
- * machine.
+ * @param {string} parameters.storageProfile.osDisk.osState The OS State.
+ * Possible values include: 'Generalized', 'Specialized'
+ *
+ * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot.
+ *
+ * @param {object} [parameters.storageProfile.osDisk.managedDisk] The
+ * managedDisk.
+ *
+ * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource
+ * Id
+ *
+ * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard
+ * Disk.
+ *
+ * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the
+ * caching requirements.
Possible values are:
**None**
+ *
**ReadOnly**
**ReadWrite**
Default: **None for
+ * Standard storage. ReadOnly for Premium storage**. Possible values include:
+ * 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the
+ * size of empty data disks in gigabytes. This element can be used to overwrite
+ * the name of the disk in a virtual machine image.
This value cannot
+ * be larger than 1023 GB
*
- * @param {string} resourceGroupName The name of the resource group.
+ * @param {string} [parameters.storageProfile.osDisk.storageAccountType]
+ * Specifies the storage account type for the managed disk. Possible values
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
*
- * @param {string} vmName The name of the virtual machine.
+ * @param {array} [parameters.storageProfile.dataDisks] Specifies the
+ * parameters that are used to add a data disk to a virtual machine.
+ * For more information about disks, see [About disks and VHDs for Azure
+ * virtual
+ * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
*
- * @param {object} [options] Optional Parameters.
+ * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether
+ * an image is zone resilient or not. Default is false. Zone resilient images
+ * can be created only in regions that provide Zone Redundant Storage (ZRS).
*
- * @param {string} [options.expand] The expand expression to apply on the
- * operation. Possible values include: 'instanceView'
+ * @param {object} [parameters.tags] Resource tags
+ *
+ * @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
@@ -3435,7 +2662,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {VirtualMachine} - The deserialized result object.
+ * @resolve {Image} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -3443,24 +2670,24 @@ export interface VirtualMachines {
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * {VirtualMachine} [result] - The deserialized result object if an error did not occur.
- * See {@link VirtualMachine} for more information.
+ * {Image} [result] - The deserialized result object if an error did not occur.
+ * See {@link Image} for more information.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
- get(resourceGroupName: string, vmName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise;
- get(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- get(resourceGroupName: string, vmName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, callback: ServiceCallback): void;
+ update(resourceGroupName: string, imageName: string, parameters: models.ImageUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
- * Retrieves information about the run-time state of a virtual machine.
+ * Deletes an Image.
*
* @param {string} resourceGroupName The name of the resource group.
*
- * @param {string} vmName The name of the virtual machine.
+ * @param {string} imageName The name of the image.
*
* @param {object} [options] Optional Parameters.
*
@@ -3469,18 +2696,18 @@ export interface VirtualMachines {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
- instanceViewWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ deleteMethodWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
- * Retrieves information about the run-time state of a virtual machine.
+ * Deletes an Image.
*
* @param {string} resourceGroupName The name of the resource group.
*
- * @param {string} vmName The name of the virtual machine.
+ * @param {string} imageName The name of the image.
*
* @param {object} [options] Optional Parameters.
*
@@ -3494,7 +2721,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {VirtualMachineInstanceView} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -3502,50 +2729,52 @@ export interface VirtualMachines {
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * {VirtualMachineInstanceView} [result] - The deserialized result object if an error did not occur.
- * See {@link VirtualMachineInstanceView} for more
- * information.
+ * {null} [result] - The deserialized result object if an error did not occur.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
- instanceView(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- instanceView(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- instanceView(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ deleteMethod(resourceGroupName: string, imageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ deleteMethod(resourceGroupName: string, imageName: string, callback: ServiceCallback): void;
+ deleteMethod(resourceGroupName: string, imageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
- * Converts virtual machine disks from blob-based to managed disks. Virtual
- * machine must be stop-deallocated before invoking this operation.
+ * Gets an image.
*
* @param {string} resourceGroupName The name of the resource group.
*
- * @param {string} vmName The name of the virtual machine.
+ * @param {string} imageName The name of the image.
*
* @param {object} [options] Optional Parameters.
*
+ * @param {string} [options.expand] The expand expression to apply on the
+ * operation.
+ *
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
- convertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ getWithHttpOperationResponse(resourceGroupName: string, imageName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
- * Converts virtual machine disks from blob-based to managed disks. Virtual
- * machine must be stop-deallocated before invoking this operation.
+ * Gets an image.
*
* @param {string} resourceGroupName The name of the resource group.
*
- * @param {string} vmName The name of the virtual machine.
+ * @param {string} imageName The name of the image.
*
* @param {object} [options] Optional Parameters.
*
+ * @param {string} [options.expand] The expand expression to apply on the
+ * operation.
+ *
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
@@ -3556,7 +2785,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {Image} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -3564,27 +2793,23 @@ export interface VirtualMachines {
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {Image} [result] - The deserialized result object if an error did not occur.
+ * See {@link Image} for more information.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
- convertToManagedDisks(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- convertToManagedDisks(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- convertToManagedDisks(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ get(resourceGroupName: string, imageName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise;
+ get(resourceGroupName: string, imageName: string, callback: ServiceCallback): void;
+ get(resourceGroupName: string, imageName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
- * Shuts down the virtual machine and releases the compute resources. You are
- * not billed for the compute resources that this virtual machine uses.
+ * Gets the list of images under a resource group.
*
* @param {string} resourceGroupName The name of the resource group.
*
- * @param {string} vmName The name of the virtual machine.
- *
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
@@ -3592,20 +2817,17 @@ export interface VirtualMachines {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
- deallocateWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
- * Shuts down the virtual machine and releases the compute resources. You are
- * not billed for the compute resources that this virtual machine uses.
+ * Gets the list of images under a resource group.
*
* @param {string} resourceGroupName The name of the resource group.
*
- * @param {string} vmName The name of the virtual machine.
- *
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
@@ -3618,7 +2840,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {ImageListResult} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -3626,25 +2848,22 @@ export interface VirtualMachines {
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {ImageListResult} [result] - The deserialized result object if an error did not occur.
+ * See {@link ImageListResult} for more information.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
- deallocate(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- deallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- deallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void;
+ listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
- * Sets the state of the virtual machine to generalized.
- *
- * @param {string} resourceGroupName The name of the resource group.
- *
- * @param {string} vmName The name of the virtual machine.
+ * Gets the list of Images in the subscription. Use nextLink property in the
+ * response to get the next page of Images. Do this till nextLink is null to
+ * fetch all the Images.
*
* @param {object} [options] Optional Parameters.
*
@@ -3653,18 +2872,16 @@ export interface VirtualMachines {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
- generalizeWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
- * Sets the state of the virtual machine to generalized.
- *
- * @param {string} resourceGroupName The name of the resource group.
- *
- * @param {string} vmName The name of the virtual machine.
+ * Gets the list of Images in the subscription. Use nextLink property in the
+ * response to get the next page of Images. Do this till nextLink is null to
+ * fetch all the Images.
*
* @param {object} [options] Optional Parameters.
*
@@ -3678,7 +2895,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {ImageListResult} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -3686,25 +2903,88 @@ export interface VirtualMachines {
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * {OperationStatusResponse} [result] - The deserialized result object if an error did not occur.
- * See {@link OperationStatusResponse} for more
- * information.
+ * {ImageListResult} [result] - The deserialized result object if an error did not occur.
+ * See {@link ImageListResult} for more information.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
- generalize(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- generalize(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- generalize(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ list(callback: ServiceCallback): void;
+ list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
- * Lists all of the virtual machines in the specified resource group. Use the
- * nextLink property in the response to get the next page of virtual machines.
+ * Create or update an image.
*
* @param {string} resourceGroupName The name of the resource group.
*
+ * @param {string} imageName The name of the image.
+ *
+ * @param {object} parameters Parameters supplied to the Create Image
+ * operation.
+ *
+ * @param {object} [parameters.sourceVirtualMachine] The source virtual machine
+ * from which Image is created.
+ *
+ * @param {object} [parameters.storageProfile] Specifies the storage settings
+ * for the virtual machine disks.
+ *
+ * @param {object} [parameters.storageProfile.osDisk] Specifies information
+ * about the operating system disk used by the virtual machine.
For
+ * more information about disks, see [About disks and VHDs for Azure virtual
+ * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
+ *
+ * @param {string} parameters.storageProfile.osDisk.osType This property allows
+ * you to specify the type of the OS that is included in the disk if creating a
+ * VM from a custom image.
Possible values are:
**Windows**
+ *
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} parameters.storageProfile.osDisk.osState The OS State.
+ * Possible values include: 'Generalized', 'Specialized'
+ *
+ * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot.
+ *
+ * @param {object} [parameters.storageProfile.osDisk.managedDisk] The
+ * managedDisk.
+ *
+ * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource
+ * Id
+ *
+ * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard
+ * Disk.
+ *
+ * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the
+ * caching requirements.
Possible values are:
**None**
+ *
**ReadOnly**
**ReadWrite**
Default: **None for
+ * Standard storage. ReadOnly for Premium storage**. Possible values include:
+ * 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the
+ * size of empty data disks in gigabytes. This element can be used to overwrite
+ * the name of the disk in a virtual machine image.
This value cannot
+ * be larger than 1023 GB
+ *
+ * @param {string} [parameters.storageProfile.osDisk.storageAccountType]
+ * Specifies the storage account type for the managed disk. Possible values
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
+ *
+ * @param {array} [parameters.storageProfile.dataDisks] Specifies the
+ * parameters that are used to add a data disk to a virtual machine.
+ * For more information about disks, see [About disks and VHDs for Azure
+ * virtual
+ * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
+ *
+ * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether
+ * an image is zone resilient or not. Default is false. Zone resilient images
+ * can be created only in regions that provide Zone Redundant Storage (ZRS).
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
@@ -3712,18 +2992,82 @@ export interface VirtualMachines {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
- listWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
- * Lists all of the virtual machines in the specified resource group. Use the
- * nextLink property in the response to get the next page of virtual machines.
+ * Create or update an image.
*
* @param {string} resourceGroupName The name of the resource group.
*
+ * @param {string} imageName The name of the image.
+ *
+ * @param {object} parameters Parameters supplied to the Create Image
+ * operation.
+ *
+ * @param {object} [parameters.sourceVirtualMachine] The source virtual machine
+ * from which Image is created.
+ *
+ * @param {object} [parameters.storageProfile] Specifies the storage settings
+ * for the virtual machine disks.
+ *
+ * @param {object} [parameters.storageProfile.osDisk] Specifies information
+ * about the operating system disk used by the virtual machine.
For
+ * more information about disks, see [About disks and VHDs for Azure virtual
+ * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
+ *
+ * @param {string} parameters.storageProfile.osDisk.osType This property allows
+ * you to specify the type of the OS that is included in the disk if creating a
+ * VM from a custom image.
Possible values are:
**Windows**
+ *
**Linux**. Possible values include: 'Windows', 'Linux'
+ *
+ * @param {string} parameters.storageProfile.osDisk.osState The OS State.
+ * Possible values include: 'Generalized', 'Specialized'
+ *
+ * @param {object} [parameters.storageProfile.osDisk.snapshot] The snapshot.
+ *
+ * @param {object} [parameters.storageProfile.osDisk.managedDisk] The
+ * managedDisk.
+ *
+ * @param {string} [parameters.storageProfile.osDisk.managedDisk.id] Resource
+ * Id
+ *
+ * @param {string} [parameters.storageProfile.osDisk.blobUri] The Virtual Hard
+ * Disk.
+ *
+ * @param {string} [parameters.storageProfile.osDisk.caching] Specifies the
+ * caching requirements.
Possible values are:
**None**
+ *
**ReadOnly**
**ReadWrite**
Default: **None for
+ * Standard storage. ReadOnly for Premium storage**. Possible values include:
+ * 'None', 'ReadOnly', 'ReadWrite'
+ *
+ * @param {number} [parameters.storageProfile.osDisk.diskSizeGB] Specifies the
+ * size of empty data disks in gigabytes. This element can be used to overwrite
+ * the name of the disk in a virtual machine image.
This value cannot
+ * be larger than 1023 GB
+ *
+ * @param {string} [parameters.storageProfile.osDisk.storageAccountType]
+ * Specifies the storage account type for the managed disk. Possible values
+ * are: Standard_LRS, Premium_LRS, and StandardSSD_LRS. Possible values
+ * include: 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS'
+ *
+ * @param {array} [parameters.storageProfile.dataDisks] Specifies the
+ * parameters that are used to add a data disk to a virtual machine.
+ * For more information about disks, see [About disks and VHDs for Azure
+ * virtual
+ * machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
+ *
+ * @param {boolean} [parameters.storageProfile.zoneResilient] Specifies whether
+ * an image is zone resilient or not. Default is false. Zone resilient images
+ * can be created only in regions that provide Zone Redundant Storage (ZRS).
+ *
+ * @param {string} parameters.location Resource location
+ *
+ * @param {object} [parameters.tags] Resource tags
+ *
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
@@ -3736,7 +3080,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {VirtualMachineListResult} - The deserialized result object.
+ * @resolve {Image} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -3744,80 +3088,85 @@ export interface VirtualMachines {
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * {VirtualMachineListResult} [result] - The deserialized result object if an error did not occur.
- * See {@link VirtualMachineListResult} for more
- * information.
+ * {Image} [result] - The deserialized result object if an error did not occur.
+ * See {@link Image} for more information.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
- list(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- list(resourceGroupName: string, callback: ServiceCallback): void;
- list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ beginCreateOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ beginCreateOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, callback: ServiceCallback): void;
+ beginCreateOrUpdate(resourceGroupName: string, imageName: string, parameters: models.Image, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback