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/dataDisk.js b/lib/services/computeManagement2/lib/models/dataDisk.js
index 35ad8c7602..5a4e36bacb 100644
--- a/lib/services/computeManagement2/lib/models/dataDisk.js
+++ b/lib/services/computeManagement2/lib/models/dataDisk.js
@@ -38,13 +38,13 @@ class DataDisk {
* @member {boolean} [writeAcceleratorEnabled] Specifies whether
* writeAccelerator should be enabled or disabled on the disk.
* @member {string} createOption Specifies how the virtual machine should be
- * created.
Possible values are:
**Attach** This value is
- * used when you are using a specialized disk to create the virtual
- * machine.
**FromImage** 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'
+ * created.
Possible values are:
**Attach** \u2013 This value
+ * is used when you are using a specialized disk to create the virtual
+ * machine.
**FromImage** \u2013 This value is used when you are
+ * using an image to create the virtual machine. If you are using a platform
+ * image, you also use the imageReference element described above. If you are
+ * using a marketplace image, you also use the plan element previously
+ * described. Possible values include: 'FromImage', 'Empty', 'Attach'
* @member {number} [diskSizeGB] Specifies the size of an empty data disk in
* gigabytes. This element can be used to overwrite the name of the disk in a
* virtual machine image.
This value cannot be larger than 1023 GB
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/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/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/index.d.ts b/lib/services/computeManagement2/lib/models/index.d.ts
index 948ab3d639..48d4654c66 100644
--- a/lib/services/computeManagement2/lib/models/index.d.ts
+++ b/lib/services/computeManagement2/lib/models/index.d.ts
@@ -493,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[];
}
/**
@@ -756,13 +763,13 @@ export interface ManagedDiskParameters extends SubResource {
* @member {boolean} [writeAcceleratorEnabled] Specifies whether
* writeAccelerator should be enabled or disabled on the disk.
* @member {string} createOption Specifies how the virtual machine should be
- * created.
Possible values are:
**Attach** This value is used
- * when you are using a specialized disk to create the virtual machine.
- * **FromImage** 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'
+ * created.
Possible values are:
**Attach** \u2013 This value
+ * is used when you are using a specialized disk to create the virtual
+ * machine.
**FromImage** \u2013 This value is used when you are using
+ * an image to create the virtual machine. If you are using a platform image,
+ * you also use the imageReference element described above. If you are using a
+ * marketplace image, you also use the plan element previously described.
+ * Possible values include: 'FromImage', 'Empty', 'Attach'
* @member {number} [diskSizeGB] Specifies the size of an empty data disk in
* gigabytes. This element can be used to overwrite the name of the disk in a
* virtual machine image.
This value cannot be larger than 1023 GB
@@ -808,13 +815,13 @@ export interface OSDisk {
* @member {boolean} [writeAcceleratorEnabled] Specifies whether
* writeAccelerator should be enabled or disabled on the disk.
* @member {string} createOption Specifies how the virtual machine should be
- * created.
Possible values are:
**Attach** This value is used
- * when you are using a specialized disk to create the virtual machine.
- * **FromImage** 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'
+ * created.
Possible values are:
**Attach** \u2013 This value
+ * is used when you are using a specialized disk to create the virtual
+ * machine.
**FromImage** \u2013 This value is used when you are using
+ * an image to create the virtual machine. If you are using a platform image,
+ * you also use the imageReference element described above. If you are using a
+ * marketplace image, you also use the plan element previously described.
+ * Possible values include: 'FromImage', 'Empty', 'Attach'
* @member {number} [diskSizeGB] Specifies the size of an empty data disk in
* gigabytes. This element can be used to overwrite the name of the disk in a
* virtual machine image.
This value cannot be larger than 1023 GB
@@ -901,13 +908,13 @@ export interface DataDisk {
* @member {boolean} [osDisk.writeAcceleratorEnabled] Specifies whether
* writeAccelerator should be enabled or disabled on the disk.
* @member {string} [osDisk.createOption] Specifies how the virtual machine
- * should be created.
Possible values are:
**Attach** This
- * value is used when you are using a specialized disk to create the virtual
- * machine.
**FromImage** 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'
+ * should be created.
Possible values are:
**Attach** \u2013
+ * This value is used when you are using a specialized disk to create the
+ * virtual machine.
**FromImage** \u2013 This value is used when you
+ * are using an image to create the virtual machine. If you are using a
+ * platform image, you also use the imageReference element described above. If
+ * you are using a marketplace image, you also use the plan element previously
+ * described. Possible values include: 'FromImage', 'Empty', 'Attach'
* @member {number} [osDisk.diskSizeGB] Specifies the size of an empty data
* disk in gigabytes. This element can be used to overwrite the name of the
* disk in a virtual machine image.
This value cannot be larger than
@@ -1634,12 +1641,13 @@ export interface VirtualMachineInstanceView {
* whether writeAccelerator should be enabled or disabled on the disk.
* @member {string} [storageProfile.osDisk.createOption] Specifies how the
* virtual machine should be created.
Possible values are:
- * **Attach** This value is used when you are using a specialized disk to
- * create the virtual machine.
**FromImage** 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'
+ * **Attach** \u2013 This value is used when you are using a specialized disk
+ * to create the virtual machine.
**FromImage** \u2013 This value is
+ * used when you are using an image to create the virtual machine. If you are
+ * using a platform image, you also use the imageReference element described
+ * above. If you are using a marketplace image, you also use the plan element
+ * previously described. Possible values include: 'FromImage', 'Empty',
+ * 'Attach'
* @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of an
* empty data disk in gigabytes. This element can be used to overwrite the name
* of the disk in a virtual machine image.
This value cannot be larger
@@ -2020,12 +2028,13 @@ export interface VirtualMachine extends Resource {
* whether writeAccelerator should be enabled or disabled on the disk.
* @member {string} [storageProfile.osDisk.createOption] Specifies how the
* virtual machine should be created.
Possible values are:
- * **Attach** This value is used when you are using a specialized disk to
- * create the virtual machine.
**FromImage** 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'
+ * **Attach** \u2013 This value is used when you are using a specialized disk
+ * to create the virtual machine.
**FromImage** \u2013 This value is
+ * used when you are using an image to create the virtual machine. If you are
+ * using a platform image, you also use the imageReference element described
+ * above. If you are using a marketplace image, you also use the plan element
+ * previously described. Possible values include: 'FromImage', 'Empty',
+ * 'Attach'
* @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of an
* empty data disk in gigabytes. This element can be used to overwrite the name
* of the disk in a virtual machine image.
This value cannot be larger
@@ -2768,9 +2777,9 @@ export interface VirtualMachineScaleSetManagedDiskParameters {
* writeAccelerator should be enabled or disabled on the disk.
* @member {string} createOption Specifies how the virtual machines in the
* scale set should be created.
The only allowed value is:
- * **FromImage** 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
+ * **FromImage** \u2013 This value is used when you are using an image to
+ * create the virtual machine. If you are using a platform image, you also use
+ * the imageReference element described above. If you are using a marketplace
* image, you also use the plan element previously described. Possible values
* include: 'FromImage', 'Empty', 'Attach'
* @member {string} [osType] This property allows you to specify the type of
@@ -2901,9 +2910,9 @@ export interface VirtualMachineScaleSetDataDisk {
* writeAccelerator should be enabled or disabled on the disk.
* @member {string} [osDisk.createOption] Specifies how the virtual machines in
* the scale set should be created.
The only allowed value is:
- * **FromImage** 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
+ * **FromImage** \u2013 This value is used when you are using an image to
+ * create the virtual machine. If you are using a platform image, you also use
+ * the imageReference element described above. If you are using a marketplace
* image, you also use the plan element previously described. Possible values
* include: 'FromImage', 'Empty', 'Attach'
* @member {string} [osDisk.osType] This property allows you to specify the
@@ -3430,9 +3439,9 @@ export interface VirtualMachineScaleSetExtensionProfile {
* whether writeAccelerator should be enabled or disabled on the disk.
* @member {string} [storageProfile.osDisk.createOption] Specifies how the
* virtual machines in the scale set should be created.
The only
- * allowed value is: **FromImage** 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
+ * allowed value is: **FromImage** \u2013 This value is used when you are using
+ * an image to create the virtual machine. If you are using a platform image,
+ * you also use the imageReference element described above. If you are using a
* marketplace image, you also use the plan element previously described.
* Possible values include: 'FromImage', 'Empty', 'Attach'
* @member {string} [storageProfile.osDisk.osType] This property allows you to
@@ -3813,12 +3822,12 @@ export interface VirtualMachineScaleSetUpdateVMProfile {
* disk.
* @member {string} [virtualMachineProfile.storageProfile.osDisk.createOption]
* Specifies how the virtual machines in the scale set should be
- * created.
The only allowed value is: **FromImage** 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'
+ * created.
The only allowed value is: **FromImage** \u2013 This value
+ * is used when you are using an image to create the virtual machine. If you
+ * are using a platform image, you also use the imageReference element
+ * described above. If you are using a marketplace image, you also use the
+ * plan element previously described. Possible values include: 'FromImage',
+ * 'Empty', 'Attach'
* @member {string} [virtualMachineProfile.storageProfile.osDisk.osType] This
* property allows you to specify the type of the OS that is included in the
* disk if creating a VM from user-image or a specialized VHD.
@@ -4771,12 +4780,13 @@ export interface UpgradeOperationHistoricalStatusInfo {
* whether writeAccelerator should be enabled or disabled on the disk.
* @member {string} [storageProfile.osDisk.createOption] Specifies how the
* virtual machine should be created.
Possible values are:
- * **Attach** This value is used when you are using a specialized disk to
- * create the virtual machine.
**FromImage** 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'
+ * **Attach** \u2013 This value is used when you are using a specialized disk
+ * to create the virtual machine.
**FromImage** \u2013 This value is
+ * used when you are using an image to create the virtual machine. If you are
+ * using a platform image, you also use the imageReference element described
+ * above. If you are using a marketplace image, you also use the plan element
+ * previously described. Possible values include: 'FromImage', 'Empty',
+ * 'Attach'
* @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of an
* empty data disk in gigabytes. This element can be used to overwrite the name
* of the disk in a virtual machine image.
This value cannot be larger
@@ -5118,18 +5128,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.
@@ -5146,34 +5144,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.
@@ -5244,7 +5214,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;
}
@@ -5342,7 +5312,7 @@ export interface RunCommandDocument extends RunCommandDocumentBase {
*
* @member {object} [output] Operation output data (raw JSON)
*/
-export interface RunCommandResult extends OperationStatusResponse {
+export interface RunCommandResult {
output?: any;
}
diff --git a/lib/services/computeManagement2/lib/models/index.js b/lib/services/computeManagement2/lib/models/index.js
index bf67f6aaed..8a8cb4a449 100644
--- a/lib/services/computeManagement2/lib/models/index.js
+++ b/lib/services/computeManagement2/lib/models/index.js
@@ -131,9 +131,7 @@ exports.VirtualMachineHealthStatus = require('./virtualMachineHealthStatus');
exports.VirtualMachineScaleSetVMInstanceView = require('./virtualMachineScaleSetVMInstanceView');
exports.RollingUpgradeRunningStatus = require('./rollingUpgradeRunningStatus');
exports.RollingUpgradeStatusInfo = require('./rollingUpgradeStatusInfo');
-exports.ComputeLongRunningOperationProperties = require('./computeLongRunningOperationProperties');
exports.RecoveryWalkResponse = require('./recoveryWalkResponse');
-exports.OperationStatusResponse = require('./operationStatusResponse');
exports.LogAnalyticsInputBase = require('./logAnalyticsInputBase');
exports.RequestRateByIntervalInput = require('./requestRateByIntervalInput');
exports.ThrottledRequestsInput = require('./throttledRequestsInput');
diff --git a/lib/services/computeManagement2/lib/models/logAnalyticsOperationResult.js b/lib/services/computeManagement2/lib/models/logAnalyticsOperationResult.js
index 0bc73509e1..74be807688 100644
--- a/lib/services/computeManagement2/lib/models/logAnalyticsOperationResult.js
+++ b/lib/services/computeManagement2/lib/models/logAnalyticsOperationResult.js
@@ -15,9 +15,8 @@ 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 +24,6 @@ class LogAnalyticsOperationResult extends models['OperationStatusResponse'] {
* container.
*/
constructor() {
- super();
}
/**
@@ -42,47 +40,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/oSDisk.js b/lib/services/computeManagement2/lib/models/oSDisk.js
index ef1de61c3a..bf576f1740 100644
--- a/lib/services/computeManagement2/lib/models/oSDisk.js
+++ b/lib/services/computeManagement2/lib/models/oSDisk.js
@@ -62,13 +62,13 @@ class OSDisk {
* @member {boolean} [writeAcceleratorEnabled] Specifies whether
* writeAccelerator should be enabled or disabled on the disk.
* @member {string} createOption Specifies how the virtual machine should be
- * created.
Possible values are:
**Attach** This value is
- * used when you are using a specialized disk to create the virtual
- * machine.
**FromImage** 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'
+ * created.
Possible values are:
**Attach** \u2013 This value
+ * is used when you are using a specialized disk to create the virtual
+ * machine.
**FromImage** \u2013 This value is used when you are
+ * using an image to create the virtual machine. If you are using a platform
+ * image, you also use the imageReference element described above. If you are
+ * using a marketplace image, you also use the plan element previously
+ * described. Possible values include: 'FromImage', 'Empty', 'Attach'
* @member {number} [diskSizeGB] Specifies the size of an empty data disk in
* gigabytes. This element can be used to overwrite the name of the disk in a
* virtual machine image.
This value cannot be larger than 1023 GB
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/runCommandResult.js b/lib/services/computeManagement2/lib/models/runCommandResult.js
index f23a7d1b8c..e279a76461 100644
--- a/lib/services/computeManagement2/lib/models/runCommandResult.js
+++ b/lib/services/computeManagement2/lib/models/runCommandResult.js
@@ -10,20 +10,16 @@
'use strict';
-const models = require('./index');
-
/**
* Run command operation response.
*
- * @extends models['OperationStatusResponse']
*/
-class RunCommandResult extends models['OperationStatusResponse'] {
+class RunCommandResult {
/**
* Create a RunCommandResult.
* @member {object} [output] Operation output data (raw JSON)
*/
constructor() {
- super();
}
/**
@@ -40,47 +36,6 @@ 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: {
required: false,
serializedName: 'properties.output',
diff --git a/lib/services/computeManagement2/lib/models/storageProfile.js b/lib/services/computeManagement2/lib/models/storageProfile.js
index 1d7cde3559..38b108fcd0 100644
--- a/lib/services/computeManagement2/lib/models/storageProfile.js
+++ b/lib/services/computeManagement2/lib/models/storageProfile.js
@@ -80,13 +80,14 @@ class StorageProfile {
* @member {boolean} [osDisk.writeAcceleratorEnabled] Specifies whether
* writeAccelerator should be enabled or disabled on the disk.
* @member {string} [osDisk.createOption] Specifies how the virtual machine
- * should be created.
Possible values are:
**Attach** This
- * value is used when you are using a specialized disk to create the virtual
- * machine.
**FromImage** 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'
+ * should be created.
Possible values are:
**Attach** \u2013
+ * This value is used when you are using a specialized disk to create the
+ * virtual machine.
**FromImage** \u2013 This value is used when you
+ * are using an image to create the virtual machine. If you are using a
+ * platform image, you also use the imageReference element described above.
+ * If you are using a marketplace image, you also use the plan element
+ * previously described. Possible values include: 'FromImage', 'Empty',
+ * 'Attach'
* @member {number} [osDisk.diskSizeGB] Specifies the size of an empty data
* disk in gigabytes. This element can be used to overwrite the name of the
* disk in a virtual machine image.
This value cannot be larger than
diff --git a/lib/services/computeManagement2/lib/models/virtualMachine.js b/lib/services/computeManagement2/lib/models/virtualMachine.js
index 021ab3369e..dfb237a362 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachine.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachine.js
@@ -172,13 +172,13 @@ class VirtualMachine extends models['Resource'] {
* disk.
* @member {string} [storageProfile.osDisk.createOption] Specifies how the
* virtual machine should be created.
Possible values are:
- * **Attach** This value is used when you are using a specialized disk to
- * create the virtual machine.
**FromImage** 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'
+ * **Attach** \u2013 This value is used when you are using a specialized disk
+ * to create the virtual machine.
**FromImage** \u2013 This value is
+ * used when you are using an image to create the virtual machine. If you are
+ * using a platform image, you also use the imageReference element described
+ * above. If you are using a marketplace image, you also use the plan
+ * element previously described. Possible values include: 'FromImage',
+ * 'Empty', 'Attach'
* @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of
* an empty data disk in gigabytes. This element can be used to overwrite the
* name of the disk in a virtual machine image.
This value cannot be
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/virtualMachineScaleSet.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js
index ec71b2c23b..601e8f504c 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSet.js
@@ -217,11 +217,11 @@ class VirtualMachineScaleSet extends models['Resource'] {
* @member {string}
* [virtualMachineProfile.storageProfile.osDisk.createOption] Specifies how
* the virtual machines in the scale set should be created.
The only
- * allowed value is: **FromImage** 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'
+ * allowed value is: **FromImage** \u2013 This value is used when you are
+ * using an image to create the virtual machine. If you are using a platform
+ * image, you also use the imageReference element described above. If you are
+ * using a marketplace image, you also use the plan element previously
+ * described. Possible values include: 'FromImage', 'Empty', 'Attach'
* @member {string} [virtualMachineProfile.storageProfile.osDisk.osType] This
* property allows you to specify the type of the OS that is included in the
* disk if creating a VM from user-image or a specialized VHD.
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js
index f53cfd7fe7..737b7c9db1 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetOSDisk.js
@@ -29,11 +29,11 @@ class VirtualMachineScaleSetOSDisk {
* writeAccelerator should be enabled or disabled on the disk.
* @member {string} createOption Specifies how the virtual machines in the
* scale set should be created.
The only allowed value is:
- * **FromImage** 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'
+ * **FromImage** \u2013 This value is used when you are using an image to
+ * create the virtual machine. If you are using a platform image, you also
+ * use the imageReference element described above. If you are using a
+ * marketplace image, you also use the plan element previously described.
+ * Possible values include: 'FromImage', 'Empty', 'Attach'
* @member {string} [osType] This property allows you to specify the type of
* the OS that is included in the disk if creating a VM from user-image or a
* specialized VHD.
Possible values are:
**Windows**
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js
index d10d24ff7f..b8ab9a175b 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetStorageProfile.js
@@ -49,11 +49,11 @@ class VirtualMachineScaleSetStorageProfile {
* writeAccelerator should be enabled or disabled on the disk.
* @member {string} [osDisk.createOption] Specifies how the virtual machines
* in the scale set should be created.
The only allowed value is:
- * **FromImage** 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'
+ * **FromImage** \u2013 This value is used when you are using an image to
+ * create the virtual machine. If you are using a platform image, you also
+ * use the imageReference element described above. If you are using a
+ * marketplace image, you also use the plan element previously described.
+ * Possible values include: 'FromImage', 'Empty', 'Attach'
* @member {string} [osDisk.osType] This property allows you to specify the
* type of the OS that is included in the disk if creating a VM from
* user-image or a specialized VHD.
Possible values are:
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js
index 74cfa7f752..7b9e19dea1 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVM.js
@@ -228,13 +228,13 @@ class VirtualMachineScaleSetVM extends models['Resource'] {
* disk.
* @member {string} [storageProfile.osDisk.createOption] Specifies how the
* virtual machine should be created.
Possible values are:
- * **Attach** This value is used when you are using a specialized disk to
- * create the virtual machine.
**FromImage** 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'
+ * **Attach** \u2013 This value is used when you are using a specialized disk
+ * to create the virtual machine.
**FromImage** \u2013 This value is
+ * used when you are using an image to create the virtual machine. If you are
+ * using a platform image, you also use the imageReference element described
+ * above. If you are using a marketplace image, you also use the plan
+ * element previously described. Possible values include: 'FromImage',
+ * 'Empty', 'Attach'
* @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of
* an empty data disk in gigabytes. This element can be used to overwrite the
* name of the disk in a virtual machine image.
This value cannot be
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js
index 22bedcae0e..c0ee43dd34 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineScaleSetVMProfile.js
@@ -132,11 +132,11 @@ class VirtualMachineScaleSetVMProfile {
* disk.
* @member {string} [storageProfile.osDisk.createOption] Specifies how the
* virtual machines in the scale set should be created.
The only
- * allowed value is: **FromImage** 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'
+ * allowed value is: **FromImage** \u2013 This value is used when you are
+ * using an image to create the virtual machine. If you are using a platform
+ * image, you also use the imageReference element described above. If you are
+ * using a marketplace image, you also use the plan element previously
+ * described. Possible values include: 'FromImage', 'Empty', 'Attach'
* @member {string} [storageProfile.osDisk.osType] This property allows you
* to specify the type of the OS that is included in the disk if creating a
* VM from user-image or a specialized VHD.
Possible values are:
diff --git a/lib/services/computeManagement2/lib/models/virtualMachineUpdate.js b/lib/services/computeManagement2/lib/models/virtualMachineUpdate.js
index a04666a880..c3aa49a406 100644
--- a/lib/services/computeManagement2/lib/models/virtualMachineUpdate.js
+++ b/lib/services/computeManagement2/lib/models/virtualMachineUpdate.js
@@ -172,13 +172,13 @@ class VirtualMachineUpdate extends models['UpdateResource'] {
* disk.
* @member {string} [storageProfile.osDisk.createOption] Specifies how the
* virtual machine should be created.
Possible values are:
- * **Attach** This value is used when you are using a specialized disk to
- * create the virtual machine.
**FromImage** 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'
+ * **Attach** \u2013 This value is used when you are using a specialized disk
+ * to create the virtual machine.
**FromImage** \u2013 This value is
+ * used when you are using an image to create the virtual machine. If you are
+ * using a platform image, you also use the imageReference element described
+ * above. If you are using a marketplace image, you also use the plan
+ * element previously described. Possible values include: 'FromImage',
+ * 'Empty', 'Attach'
* @member {number} [storageProfile.osDisk.diskSizeGB] Specifies the size of
* an empty data disk in gigabytes. This element can be used to overwrite the
* name of the disk in a virtual machine image.
This value cannot be
diff --git a/lib/services/computeManagement2/lib/operations/availabilitySets.js b/lib/services/computeManagement2/lib/operations/availabilitySets.js
index 292da5c63a..d2d6a7b712 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-04-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-04-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-04-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
@@ -504,23 +502,6 @@ function _deleteMethod(resourceGroupName, availabilitySetName, 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);
});
@@ -561,7 +542,7 @@ function _get(resourceGroupName, availabilitySetName, options, callback) {
if (!callback) {
throw new Error('callback cannot be null.');
}
- let apiVersion = '2017-12-01';
+ let apiVersion = '2018-04-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
@@ -703,7 +684,7 @@ function _list(resourceGroupName, options, callback) {
if (!callback) {
throw new Error('callback cannot be null.');
}
- let apiVersion = '2017-12-01';
+ let apiVersion = '2018-04-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
@@ -844,7 +825,7 @@ function _listAvailableSizes(resourceGroupName, availabilitySetName, options, ca
if (!callback) {
throw new Error('callback cannot be null.');
}
- let apiVersion = '2017-12-01';
+ let apiVersion = '2018-04-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
@@ -1250,7 +1231,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 +1268,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 +1276,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.
*
diff --git a/lib/services/computeManagement2/lib/operations/disks.js b/lib/services/computeManagement2/lib/operations/disks.js
index aeb9e01a49..436ad19155 100644
--- a/lib/services/computeManagement2/lib/operations/disks.js
+++ b/lib/services/computeManagement2/lib/operations/disks.js
@@ -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);
});
@@ -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);
});
@@ -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.
*
@@ -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..cc3a456cba 100644
--- a/lib/services/computeManagement2/lib/operations/images.js
+++ b/lib/services/computeManagement2/lib/operations/images.js
@@ -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-04-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-04-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-04-01';
// Validate
try {
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
@@ -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-04-01';
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
@@ -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-04-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-04-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);
});
@@ -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.
*
@@ -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 6d4d9fcd7b..dd345e1f9b 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;
/**
@@ -1060,11 +1058,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 +1086,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 +1094,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;
/**
@@ -1490,11 +1486,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 +1514,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,17 +1522,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.
*/
- 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;
}
/**
@@ -1888,12 +1882,13 @@ export interface VirtualMachines {
*
* @param {string} parameters.storageProfile.osDisk.createOption Specifies how
* the virtual machine should be created.
Possible values are:
- * **Attach** This value is used when you are using a specialized disk to
- * create the virtual machine.
**FromImage** 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'
+ * **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
@@ -2285,12 +2280,13 @@ export interface VirtualMachines {
*
* @param {string} parameters.storageProfile.osDisk.createOption Specifies how
* the virtual machine should be created.
Possible values are:
- * **Attach** This value is used when you are using a specialized disk to
- * create the virtual machine.
**FromImage** 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'
+ * **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
@@ -2701,12 +2697,13 @@ export interface VirtualMachines {
*
* @param {string} parameters.storageProfile.osDisk.createOption Specifies how
* the virtual machine should be created.
Possible values are:
- * **Attach** This value is used when you are using a specialized disk to
- * create the virtual machine.
**FromImage** 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'
+ * **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
@@ -3096,12 +3093,13 @@ export interface VirtualMachines {
*
* @param {string} parameters.storageProfile.osDisk.createOption Specifies how
* the virtual machine should be created.
Possible values are:
- * **Attach** This value is used when you are using a specialized disk to
- * create the virtual machine.
**FromImage** 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'
+ * **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
@@ -3338,11 +3336,11 @@ 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.
*/
- deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ deleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* The operation to delete a virtual machine.
@@ -3363,7 +3361,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -3371,17 +3369,15 @@ 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.
+ * {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, 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;
+ 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;
/**
@@ -3526,11 +3522,11 @@ 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.
*/
- convertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ convertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* Converts virtual machine disks from blob-based to managed disks. Virtual
@@ -3552,7 +3548,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -3560,17 +3556,15 @@ 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.
+ * {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.
*/
- 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;
+ 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;
/**
@@ -3588,11 +3582,11 @@ 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>;
+ deallocateWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* Shuts down the virtual machine and releases the compute resources. You are
@@ -3614,7 +3608,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -3622,17 +3616,15 @@ 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.
+ * {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.
*/
- 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;
+ 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;
/**
@@ -3649,11 +3641,11 @@ 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>;
+ generalizeWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* Sets the state of the virtual machine to generalized.
@@ -3674,7 +3666,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -3682,17 +3674,15 @@ 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.
+ * {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.
*/
- 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;
+ 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;
/**
@@ -3885,11 +3875,11 @@ 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.
*/
- powerOffWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ powerOffWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* The operation to power off (stop) a virtual machine. The virtual machine can
@@ -3912,7 +3902,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -3920,17 +3910,15 @@ 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.
+ * {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.
*/
- powerOff(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- powerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- powerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ powerOff(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ powerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
+ powerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -3947,11 +3935,11 @@ 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.
*/
- restartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ restartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* The operation to restart a virtual machine.
@@ -3972,7 +3960,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -3980,17 +3968,15 @@ 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.
+ * {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.
*/
- restart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- restart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- restart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ restart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ restart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
+ restart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -4007,11 +3993,11 @@ 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.
*/
- startWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ startWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* The operation to start a virtual machine.
@@ -4032,7 +4018,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -4040,17 +4026,15 @@ 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.
+ * {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.
*/
- start(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- start(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- start(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ start(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ start(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
+ start(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -4067,11 +4051,11 @@ 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.
*/
- redeployWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ redeployWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* The operation to redeploy a virtual machine.
@@ -4092,7 +4076,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -4100,17 +4084,15 @@ 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.
+ * {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.
*/
- redeploy(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- redeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- redeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ redeploy(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ redeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
+ redeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -4127,11 +4109,11 @@ 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.
*/
- performMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ performMaintenanceWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* The operation to perform maintenance on a virtual machine.
@@ -4152,7 +4134,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -4160,17 +4142,15 @@ 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.
+ * {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.
*/
- performMaintenance(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- performMaintenance(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- performMaintenance(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ performMaintenance(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ performMaintenance(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
+ performMaintenance(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -4197,11 +4177,11 @@ 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.
*/
- runCommandWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ runCommandWithHttpOperationResponse(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* Run command on the VM.
@@ -4232,7 +4212,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {RunCommandResult} - The deserialized result object.
+ * @resolve {Array} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -4240,16 +4220,15 @@ export interface VirtualMachines {
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
- * {RunCommandResult} [result] - The deserialized result object if an error did not occur.
- * See {@link RunCommandResult} for more information.
+ * {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.
*/
- runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, callback: ServiceCallback): void;
- runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, callback: ServiceCallback): void;
+ runCommand(resourceGroupName: string, vmName: string, parameters: models.RunCommandInput, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -4524,12 +4503,13 @@ export interface VirtualMachines {
*
* @param {string} parameters.storageProfile.osDisk.createOption Specifies how
* the virtual machine should be created.
Possible values are:
- * **Attach** This value is used when you are using a specialized disk to
- * create the virtual machine.
**FromImage** 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'
+ * **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
@@ -4921,12 +4901,13 @@ export interface VirtualMachines {
*
* @param {string} parameters.storageProfile.osDisk.createOption Specifies how
* the virtual machine should be created.
Possible values are:
- * **Attach** This value is used when you are using a specialized disk to
- * create the virtual machine.
**FromImage** 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'
+ * **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
@@ -5337,12 +5318,13 @@ export interface VirtualMachines {
*
* @param {string} parameters.storageProfile.osDisk.createOption Specifies how
* the virtual machine should be created.
Possible values are:
- * **Attach** This value is used when you are using a specialized disk to
- * create the virtual machine.
**FromImage** 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'
+ * **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
@@ -5732,12 +5714,13 @@ export interface VirtualMachines {
*
* @param {string} parameters.storageProfile.osDisk.createOption Specifies how
* the virtual machine should be created.
Possible values are:
- * **Attach** This value is used when you are using a specialized disk to
- * create the virtual machine.
**FromImage** 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'
+ * **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
@@ -5974,11 +5957,11 @@ 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.
*/
- beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* The operation to delete a virtual machine.
@@ -5999,7 +5982,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -6007,17 +5990,15 @@ 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.
+ * {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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- beginDeleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- beginDeleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ beginDeleteMethod(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ beginDeleteMethod(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
+ beginDeleteMethod(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -6035,11 +6016,11 @@ 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.
*/
- beginConvertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ beginConvertToManagedDisksWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* Converts virtual machine disks from blob-based to managed disks. Virtual
@@ -6061,7 +6042,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -6069,17 +6050,15 @@ 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.
+ * {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.
*/
- beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- beginConvertToManagedDisks(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ beginConvertToManagedDisks(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
+ beginConvertToManagedDisks(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -6097,11 +6076,11 @@ export interface VirtualMachines {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
- beginDeallocateWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ beginDeallocateWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* Shuts down the virtual machine and releases the compute resources. You are
@@ -6123,7 +6102,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -6131,17 +6110,15 @@ 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.
+ * {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.
*/
- beginDeallocate(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- beginDeallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- beginDeallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ beginDeallocate(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ beginDeallocate(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
+ beginDeallocate(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -6160,11 +6137,11 @@ export interface VirtualMachines {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
- beginPowerOffWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ beginPowerOffWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* The operation to power off (stop) a virtual machine. The virtual machine can
@@ -6187,7 +6164,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -6195,17 +6172,15 @@ 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.
+ * {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.
*/
- beginPowerOff(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- beginPowerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- beginPowerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ beginPowerOff(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ beginPowerOff(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
+ beginPowerOff(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -6222,11 +6197,11 @@ 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.
*/
- beginRestartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ beginRestartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* The operation to restart a virtual machine.
@@ -6247,7 +6222,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -6255,17 +6230,15 @@ 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.
+ * {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.
*/
- beginRestart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- beginRestart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- beginRestart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ beginRestart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ beginRestart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
+ beginRestart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -6282,11 +6255,11 @@ 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.
*/
- beginStartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ beginStartWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* The operation to start a virtual machine.
@@ -6307,7 +6280,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -6315,17 +6288,15 @@ 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.
+ * {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.
*/
- beginStart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- beginStart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- beginStart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ beginStart(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ beginStart(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
+ beginStart(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
/**
@@ -6342,11 +6313,11 @@ export interface VirtualMachines {
*
* @returns {Promise} A promise is returned
*
- * @resolve {HttpOperationResponse} - The deserialized result object.
+ * @resolve {HttpOperationResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
- beginRedeployWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
+ beginRedeployWithHttpOperationResponse(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>;
/**
* The operation to redeploy a virtual machine.
@@ -6367,7 +6338,7 @@ export interface VirtualMachines {
*
* {Promise} A promise is returned.
*
- * @resolve {OperationStatusResponse} - The deserialized result object.
+ * @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
@@ -6375,17 +6346,15 @@ 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.
+ * {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.
*/
- beginRedeploy(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
- beginRedeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
- beginRedeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void;
+ beginRedeploy(resourceGroupName: string, vmName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise;
+ beginRedeploy(resourceGroupName: string, vmName: string, callback: ServiceCallback): void;
+ beginRedeploy(resourceGroupName: string, vmName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback