From c5a57fd4a3dfbdc312ca139a6f4506aa68da05be Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 21 Jun 2023 23:48:24 +0000 Subject: [PATCH] CodeGen from PR 23633 in Azure/azure-rest-api-specs Merge 6a94c39461cc4ecbebf7dbae1548f139aa80eeec into f0866b0733a2f4bed9e85b2f7e4e51bb230029a5 --- sdk/compute/arm-compute/CHANGELOG.md | 33 ++- sdk/compute/arm-compute/_meta.json | 8 +- sdk/compute/arm-compute/package.json | 19 +- .../arm-compute/review/arm-compute.api.md | 61 ++++-- .../src/computeManagementClient.ts | 2 +- sdk/compute/arm-compute/src/models/index.ts | 149 ++++++++----- sdk/compute/arm-compute/src/models/mappers.ts | 195 +++++++++++++++--- .../arm-compute/src/models/parameters.ts | 30 ++- .../src/operations/galleryImageVersions.ts | 44 ++++ .../galleryImageVersions.ts | 17 +- sdk/compute/arm-compute/test/sampleTest.ts | 43 ++++ sdk/compute/arm-compute/tsconfig.json | 10 +- 12 files changed, 489 insertions(+), 122 deletions(-) create mode 100644 sdk/compute/arm-compute/test/sampleTest.ts diff --git a/sdk/compute/arm-compute/CHANGELOG.md b/sdk/compute/arm-compute/CHANGELOG.md index f5e41f7e249f..644db4f9091e 100644 --- a/sdk/compute/arm-compute/CHANGELOG.md +++ b/sdk/compute/arm-compute/CHANGELOG.md @@ -1,15 +1,32 @@ # Release History + +## 22.0.0 (2023-06-21) + +**Features** -## 21.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added operation GalleryImageVersions.getLatest + - Added Interface CommunityGalleryMetadata + - Added Interface GalleryImageVersionsGetLatestOptionalParams + - Added Interface LatestVersion + - Added Type Alias GalleryImageVersionsGetLatestResponse + - Interface CommunityGallery has a new optional parameter artifactTags + - Interface CommunityGallery has a new optional parameter communityMetadata + - Interface CommunityGallery has a new optional parameter disclaimer + - Interface CommunityGalleryImage has a new optional parameter artifactTags + - Interface CommunityGalleryImage has a new optional parameter disclaimer + - Interface CommunityGalleryImageVersion has a new optional parameter artifactTags + - Interface CommunityGalleryImageVersion has a new optional parameter disclaimer + - Interface SharedGallery has a new optional parameter artifactTags + - Interface SharedGalleryImage has a new optional parameter artifactTags + - Interface SharedGalleryImageVersion has a new optional parameter artifactTags + - Enum KnownStorageAccountType has a new value StandardSSDLRS -### Other Changes +**Breaking Changes** + - Type of parameter storageAccountType of interface GalleryTargetExtendedLocation is changed from EdgeZoneStorageAccountType to StorageAccountType + - Removed Enum KnownEdgeZoneStorageAccountType + + ## 21.0.0 (2023-05-17) **Features** diff --git a/sdk/compute/arm-compute/_meta.json b/sdk/compute/arm-compute/_meta.json index 826fb6a5033f..40067df8675e 100644 --- a/sdk/compute/arm-compute/_meta.json +++ b/sdk/compute/arm-compute/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a2140e7ff0a6c28df501b16c51fe85b762a386fc", + "commit": "563291a0288458ff1dbe0d805ad84cdcd5920749", "readme": "specification/compute/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\compute\\resource-manager\\readme.md --use=@autorest/typescript@6.0.1 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/compute/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.1", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/compute/arm-compute/package.json b/sdk/compute/arm-compute/package.json index ade08ec6addf..1c1f064b1955 100644 --- a/sdk/compute/arm-compute/package.json +++ b/sdk/compute/arm-compute/package.json @@ -3,12 +3,12 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ComputeManagementClient.", - "version": "21.0.1", + "version": "22.0.0", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.0", + "@azure/core-lro": "^2.5.3", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", @@ -48,8 +48,7 @@ "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^14.0.0", - "@azure/dev-tool": "^1.0.0", - "@azure/arm-network": "^26.0.0" + "@azure/dev-tool": "^1.0.0" }, "repository": { "type": "git", @@ -112,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-compute?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute" +} \ No newline at end of file diff --git a/sdk/compute/arm-compute/review/arm-compute.api.md b/sdk/compute/arm-compute/review/arm-compute.api.md index 2bc70772e10b..26c7a283b475 100644 --- a/sdk/compute/arm-compute/review/arm-compute.api.md +++ b/sdk/compute/arm-compute/review/arm-compute.api.md @@ -931,12 +931,21 @@ export type CommunityGalleriesGetResponse = CommunityGallery; // @public export interface CommunityGallery extends PirCommunityGalleryResource { + artifactTags?: { + [propertyName: string]: string; + }; + communityMetadata?: CommunityGalleryMetadata; + disclaimer?: string; } // @public export interface CommunityGalleryImage extends PirCommunityGalleryResource { architecture?: Architecture; + artifactTags?: { + [propertyName: string]: string; + }; disallowed?: Disallowed; + disclaimer?: string; endOfLifeDate?: Date; eula?: string; features?: GalleryImageFeature[]; @@ -991,6 +1000,10 @@ export type CommunityGalleryImagesListResponse = CommunityGalleryImageList; // @public export interface CommunityGalleryImageVersion extends PirCommunityGalleryResource { + artifactTags?: { + [propertyName: string]: string; + }; + disclaimer?: string; endOfLifeDate?: Date; excludeFromLatest?: boolean; publishedDate?: Date; @@ -1040,6 +1053,15 @@ export interface CommunityGalleryInfo { publisherUri?: string; } +// @public +export interface CommunityGalleryMetadata { + eula?: string; + privacyStatementUri?: string; + publicNames?: string[]; + publisherContact?: string; + publisherUri?: string; +} + // @public (undocumented) export class ComputeManagementClient extends coreClient.ServiceClient { // (undocumented) @@ -2080,9 +2102,6 @@ export interface DiskUpdate { tier?: string; } -// @public -export type EdgeZoneStorageAccountType = string; - // @public export interface Encryption { diskEncryptionSetId?: string; @@ -2650,6 +2669,7 @@ export interface GalleryImageVersions { beginUpdate(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: GalleryImageVersionUpdate, options?: GalleryImageVersionsUpdateOptionalParams): Promise, GalleryImageVersionsUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, galleryImageVersion: GalleryImageVersionUpdate, options?: GalleryImageVersionsUpdateOptionalParams): Promise; get(resourceGroupName: string, galleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: GalleryImageVersionsGetOptionalParams): Promise; + getLatest(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: GalleryImageVersionsGetLatestOptionalParams): Promise; listByGalleryImage(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: GalleryImageVersionsListByGalleryImageOptionalParams): PagedAsyncIterableIterator; } @@ -2674,6 +2694,13 @@ export interface GalleryImageVersionsDeleteOptionalParams extends coreClient.Ope updateIntervalInMs?: number; } +// @public +export interface GalleryImageVersionsGetLatestOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GalleryImageVersionsGetLatestResponse = LatestVersion; + // @public export interface GalleryImageVersionsGetOptionalParams extends coreClient.OperationOptions { expand?: ReplicationStatusTypes; @@ -2758,7 +2785,7 @@ export interface GalleryTargetExtendedLocation { extendedLocation?: GalleryExtendedLocation; extendedLocationReplicaCount?: number; name?: string; - storageAccountType?: EdgeZoneStorageAccountType; + storageAccountType?: StorageAccountType; } // @public @@ -3219,14 +3246,6 @@ export enum KnownDiskStorageAccountTypes { UltraSSDLRS = "UltraSSD_LRS" } -// @public -export enum KnownEdgeZoneStorageAccountType { - PremiumLRS = "Premium_LRS", - StandardLRS = "Standard_LRS", - StandardSSDLRS = "StandardSSD_LRS", - StandardZRS = "Standard_ZRS" -} - // @public export enum KnownEncryptionType { EncryptionAtRestWithCustomerKey = "EncryptionAtRestWithCustomerKey", @@ -3587,6 +3606,7 @@ export enum KnownSnapshotStorageAccountTypes { export enum KnownStorageAccountType { PremiumLRS = "Premium_LRS", StandardLRS = "Standard_LRS", + StandardSSDLRS = "StandardSSD_LRS", StandardZRS = "Standard_ZRS" } @@ -3883,6 +3903,14 @@ export interface LatestGalleryImageVersion { location?: string; } +// @public +export interface LatestVersion { + readonly id?: string; + readonly name?: string; + readonly properties?: LatestGalleryImageVersion; + readonly type?: string; +} + // @public export interface LinuxConfiguration { disablePasswordAuthentication?: boolean; @@ -5093,6 +5121,9 @@ export type SharedGalleriesListResponse = SharedGalleryList; // @public export interface SharedGallery extends PirSharedGalleryResource { + readonly artifactTags?: { + [propertyName: string]: string; + }; } // @public @@ -5112,6 +5143,9 @@ export type SharedGalleryHostCaching = string; // @public export interface SharedGalleryImage extends PirSharedGalleryResource { architecture?: Architecture; + artifactTags?: { + [propertyName: string]: string; + }; disallowed?: Disallowed; endOfLifeDate?: Date; eula?: string; @@ -5161,6 +5195,9 @@ export type SharedGalleryImagesListResponse = SharedGalleryImageList; // @public export interface SharedGalleryImageVersion extends PirSharedGalleryResource { + artifactTags?: { + [propertyName: string]: string; + }; endOfLifeDate?: Date; excludeFromLatest?: boolean; publishedDate?: Date; diff --git a/sdk/compute/arm-compute/src/computeManagementClient.ts b/sdk/compute/arm-compute/src/computeManagementClient.ts index b91bdcdc06ec..505a0bd95d13 100644 --- a/sdk/compute/arm-compute/src/computeManagementClient.ts +++ b/sdk/compute/arm-compute/src/computeManagementClient.ts @@ -145,7 +145,7 @@ export class ComputeManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-compute/21.0.1`; + const packageDetails = `azsdk-js-arm-compute/22.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/compute/arm-compute/src/models/index.ts b/sdk/compute/arm-compute/src/models/index.ts index abc7c3a7788b..80fcce9de961 100644 --- a/sdk/compute/arm-compute/src/models/index.ts +++ b/sdk/compute/arm-compute/src/models/index.ts @@ -3503,7 +3503,7 @@ export interface GalleryIdentifier { /** Profile for gallery sharing to subscription or tenant */ export interface SharingProfile { - /** This property allows you to specify the permission of sharing gallery.

Possible values are:

**Private**

**Groups**

**Community** */ + /** This property allows you to specify the permission of sharing gallery. Possible values are: **Private,** **Groups,** **Community.** */ permissions?: GallerySharingPermissionTypes; /** * A list of sharing profile groups. @@ -3516,7 +3516,7 @@ export interface SharingProfile { /** Group of the gallery sharing profile */ export interface SharingProfileGroup { - /** This property allows you to specify the type of sharing group.

Possible values are:

**Subscriptions**

**AADTenants** */ + /** This property allows you to specify the type of sharing group. Possible values are: **Subscriptions,** **AADTenants.** */ type?: SharingProfileGroupTypes; /** A list of subscription/tenant ids the gallery is aimed to be shared to. */ ids?: string[]; @@ -3712,7 +3712,7 @@ export interface GalleryTargetExtendedLocation { /** The number of replicas of the Image Version to be created per extended location. This property is updatable. */ extendedLocationReplicaCount?: number; /** Specifies the storage account type to be used to store the image. This property is not updatable. */ - storageAccountType?: EdgeZoneStorageAccountType; + storageAccountType?: StorageAccountType; /** Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. */ encryption?: EncryptionImages; } @@ -3805,6 +3805,38 @@ export interface RegionalReplicationStatus { readonly progress?: number; } +/** latestVersion is an ARM resource. It follows the schema of ARM resource, which has id, name, type and properties. The name of the latest version in the region is in the properties. */ +export interface LatestVersion { + /** + * Resource Id + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Resource name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Resource type + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The property latestVersion. It contains two value, the latest version name and the region. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly properties?: LatestGalleryImageVersion; +} + +/** The property latestVersion. It contains two value, the latest version name and the region. */ +export interface LatestGalleryImageVersion { + /** The name of the latest version in the region. */ + latestVersionName?: string; + /** region of the Gallery Image Version. */ + location?: string; +} + /** A custom action that can be performed with a Gallery Application Version. */ export interface GalleryApplicationCustomAction { /** The name of the custom action. Must be unique within the Gallery Application Version. */ @@ -3898,7 +3930,7 @@ export interface GalleryApplicationVersionList { /** Specifies information about the gallery sharing profile update. */ export interface SharingUpdate { - /** This property allows you to specify the operation type of gallery sharing update.

Possible values are:

**Add**

**Remove**

**Reset** */ + /** This property allows you to specify the operation type of gallery sharing update. Possible values are: **Add,** **Remove,** **Reset.** */ operationType: SharingUpdateOperationTypes; /** A list of sharing profile groups. */ groups?: SharingProfileGroup[]; @@ -3961,6 +3993,20 @@ export interface SharedGalleryDiskImage { hostCaching?: SharedGalleryHostCaching; } +/** The metadata of community gallery. */ +export interface CommunityGalleryMetadata { + /** The publisher uri of this community gallery. */ + publisherUri?: string; + /** The publisher contact of this community gallery. */ + publisherContact?: string; + /** The eula of this community gallery. */ + eula?: string; + /** A list of public names the gallery has. */ + publicNames?: string[]; + /** The privacyStatementUri of this community gallery. */ + privacyStatementUri?: string; +} + /** Base information about the community gallery resource in pir. */ export interface PirCommunityGalleryResource { /** @@ -4651,14 +4697,6 @@ export interface ManagedArtifact { id: string; } -/** The gallery image version with latest version in a particular region. */ -export interface LatestGalleryImageVersion { - /** The name of the latest version in the region. */ - latestVersionName?: string; - /** region of the Gallery Image Version. */ - location?: string; -} - /** Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. */ export interface ImageReference extends SubResource { /** The image publisher. */ @@ -5726,7 +5764,7 @@ export interface GalleryImage extends Resource { privacyStatementUri?: string; /** The release note uri. */ releaseNoteUri?: string; - /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

Possible values are:

**Windows**

**Linux** */ + /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ osType?: OperatingSystemTypes; /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ osState?: OperatingSystemStateTypes; @@ -5749,7 +5787,7 @@ export interface GalleryImage extends Resource { readonly provisioningState?: GalleryProvisioningState; /** A list of gallery image features. */ features?: GalleryImageFeature[]; - /** The architecture of the image. Applicable to OS disks only. */ + /** CPU architecture supported by an OS disk. */ architecture?: Architecture; } @@ -5785,7 +5823,7 @@ export interface GalleryApplication extends Resource { releaseNoteUri?: string; /** The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. */ endOfLifeDate?: Date; - /** This property allows you to specify the supported type of the OS that application is built for.

Possible values are:

**Windows**

**Linux** */ + /** This property allows you to specify the supported type of the OS that application is built for. Possible values are: **Windows,** **Linux.** */ supportedOSType?: OperatingSystemTypes; /** A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery Application. */ customActions?: GalleryApplicationCustomAction[]; @@ -6338,7 +6376,7 @@ export interface GalleryImageUpdate extends UpdateResourceDefinition { privacyStatementUri?: string; /** The release note uri. */ releaseNoteUri?: string; - /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

Possible values are:

**Windows**

**Linux** */ + /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ osType?: OperatingSystemTypes; /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ osState?: OperatingSystemStateTypes; @@ -6361,7 +6399,7 @@ export interface GalleryImageUpdate extends UpdateResourceDefinition { readonly provisioningState?: GalleryProvisioningState; /** A list of gallery image features. */ features?: GalleryImageFeature[]; - /** The architecture of the image. Applicable to OS disks only. */ + /** CPU architecture supported by an OS disk. */ architecture?: Architecture; } @@ -6397,7 +6435,7 @@ export interface GalleryApplicationUpdate extends UpdateResourceDefinition { releaseNoteUri?: string; /** The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. */ endOfLifeDate?: Date; - /** This property allows you to specify the supported type of the OS that application is built for.

Possible values are:

**Windows**

**Linux** */ + /** This property allows you to specify the supported type of the OS that application is built for. Possible values are: **Windows,** **Linux.** */ supportedOSType?: OperatingSystemTypes; /** A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery Application. */ customActions?: GalleryApplicationCustomAction[]; @@ -6513,11 +6551,18 @@ export interface SharedGalleryDataDiskImage extends SharedGalleryDiskImage { } /** Specifies information about the Community Gallery that you want to create or update. */ -export interface CommunityGallery extends PirCommunityGalleryResource {} +export interface CommunityGallery extends PirCommunityGalleryResource { + /** The disclaimer for a community gallery resource. */ + disclaimer?: string; + /** The artifact tags of a community gallery resource. */ + artifactTags?: { [propertyName: string]: string }; + /** The metadata of community gallery. */ + communityMetadata?: CommunityGalleryMetadata; +} /** Specifies information about the gallery image definition that you want to create or update. */ export interface CommunityGalleryImage extends PirCommunityGalleryResource { - /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

Possible values are:

**Windows**

**Linux** */ + /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ osType?: OperatingSystemTypes; /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ osState?: OperatingSystemStateTypes; @@ -6535,12 +6580,16 @@ export interface CommunityGalleryImage extends PirCommunityGalleryResource { features?: GalleryImageFeature[]; /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ purchasePlan?: ImagePurchasePlan; - /** The architecture of the image. Applicable to OS disks only. */ + /** CPU architecture supported by an OS disk. */ architecture?: Architecture; /** Privacy statement uri for the current community gallery image. */ privacyStatementUri?: string; /** End-user license agreement for the current community gallery image. */ eula?: string; + /** The disclaimer for a community gallery resource. */ + disclaimer?: string; + /** The artifact tags of a community gallery resource. */ + artifactTags?: { [propertyName: string]: string }; } /** Specifies information about the gallery image version that you want to create or update. */ @@ -6554,6 +6603,10 @@ export interface CommunityGalleryImageVersion excludeFromLatest?: boolean; /** Describes the storage profile of the image version. */ storageProfile?: SharedGalleryImageVersionStorageProfile; + /** The disclaimer for a community gallery resource. */ + disclaimer?: string; + /** The artifact tags of a community gallery resource. */ + artifactTags?: { [propertyName: string]: string }; } /** Describes a Virtual Machine Image. */ @@ -6584,11 +6637,17 @@ export interface VirtualMachineScaleSetReimageParameters } /** Specifies information about the Shared Gallery that you want to create or update. */ -export interface SharedGallery extends PirSharedGalleryResource {} +export interface SharedGallery extends PirSharedGalleryResource { + /** + * The artifact tags of a shared gallery resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly artifactTags?: { [propertyName: string]: string }; +} /** Specifies information about the gallery image definition that you want to create or update. */ export interface SharedGalleryImage extends PirSharedGalleryResource { - /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

Possible values are:

**Windows**

**Linux** */ + /** This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image. Possible values are: **Windows,** **Linux.** */ osType?: OperatingSystemTypes; /** This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. */ osState?: OperatingSystemStateTypes; @@ -6606,12 +6665,14 @@ export interface SharedGalleryImage extends PirSharedGalleryResource { features?: GalleryImageFeature[]; /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ purchasePlan?: ImagePurchasePlan; - /** The architecture of the image. Applicable to OS disks only. */ + /** CPU architecture supported by an OS disk. */ architecture?: Architecture; /** Privacy statement uri for the current community gallery image. */ privacyStatementUri?: string; /** End-user license agreement for the current community gallery image. */ eula?: string; + /** The artifact tags of a shared gallery resource. */ + artifactTags?: { [propertyName: string]: string }; } /** Specifies information about the gallery image version that you want to create or update. */ @@ -6624,6 +6685,8 @@ export interface SharedGalleryImageVersion extends PirSharedGalleryResource { excludeFromLatest?: boolean; /** Describes the storage profile of the image version. */ storageProfile?: SharedGalleryImageVersionStorageProfile; + /** The artifact tags of a shared gallery resource. */ + artifactTags?: { [propertyName: string]: string }; } /** Defines headers for VirtualMachineScaleSets_reapply operation. */ @@ -8828,7 +8891,9 @@ export enum KnownStorageAccountType { /** StandardZRS */ StandardZRS = "Standard_ZRS", /** PremiumLRS */ - PremiumLRS = "Premium_LRS" + PremiumLRS = "Premium_LRS", + /** StandardSSDLRS */ + StandardSSDLRS = "StandardSSD_LRS" } /** @@ -8838,7 +8903,8 @@ export enum KnownStorageAccountType { * ### Known values supported by the service * **Standard_LRS** \ * **Standard_ZRS** \ - * **Premium_LRS** + * **Premium_LRS** \ + * **StandardSSD_LRS** */ export type StorageAccountType = string; @@ -8899,30 +8965,6 @@ export enum KnownGalleryExtendedLocationType { */ export type GalleryExtendedLocationType = string; -/** Known values of {@link EdgeZoneStorageAccountType} that the service accepts. */ -export enum KnownEdgeZoneStorageAccountType { - /** StandardLRS */ - StandardLRS = "Standard_LRS", - /** StandardZRS */ - StandardZRS = "Standard_ZRS", - /** StandardSSDLRS */ - StandardSSDLRS = "StandardSSD_LRS", - /** PremiumLRS */ - PremiumLRS = "Premium_LRS" -} - -/** - * Defines values for EdgeZoneStorageAccountType. \ - * {@link KnownEdgeZoneStorageAccountType} can be used interchangeably with EdgeZoneStorageAccountType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Standard_LRS** \ - * **Standard_ZRS** \ - * **StandardSSD_LRS** \ - * **Premium_LRS** - */ -export type EdgeZoneStorageAccountType = string; - /** Known values of {@link PolicyViolationCategory} that the service accepts. */ export enum KnownPolicyViolationCategory { /** Other */ @@ -11592,6 +11634,13 @@ export interface GalleryImageVersionsDeleteOptionalParams resumeFrom?: string; } +/** Optional parameters. */ +export interface GalleryImageVersionsGetLatestOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getLatest operation. */ +export type GalleryImageVersionsGetLatestResponse = LatestVersion; + /** Optional parameters. */ export interface GalleryImageVersionsListByGalleryImageOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/compute/arm-compute/src/models/mappers.ts b/sdk/compute/arm-compute/src/models/mappers.ts index c5452e132b4b..ab3f4bcc4410 100644 --- a/sdk/compute/arm-compute/src/models/mappers.ts +++ b/sdk/compute/arm-compute/src/models/mappers.ts @@ -9889,6 +9889,64 @@ export const RegionalReplicationStatus: coreClient.CompositeMapper = { } }; +export const LatestVersion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LatestVersion", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "LatestGalleryImageVersion" + } + } + } + } +}; + +export const LatestGalleryImageVersion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LatestGalleryImageVersion", + modelProperties: { + latestVersionName: { + serializedName: "latestVersionName", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export const GalleryApplicationCustomAction: coreClient.CompositeMapper = { type: { name: "Composite", @@ -10368,6 +10426,50 @@ export const SharedGalleryDiskImage: coreClient.CompositeMapper = { } }; +export const CommunityGalleryMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityGalleryMetadata", + modelProperties: { + publisherUri: { + serializedName: "publisherUri", + type: { + name: "String" + } + }, + publisherContact: { + serializedName: "publisherContact", + type: { + name: "String" + } + }, + eula: { + serializedName: "eula", + type: { + name: "String" + } + }, + publicNames: { + serializedName: "publicNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + privacyStatementUri: { + serializedName: "privacyStatementUri", + type: { + name: "String" + } + } + } + } +}; + export const PirCommunityGalleryResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -11924,27 +12026,6 @@ export const ManagedArtifact: coreClient.CompositeMapper = { } }; -export const LatestGalleryImageVersion: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LatestGalleryImageVersion", - modelProperties: { - latestVersionName: { - serializedName: "latestVersionName", - type: { - name: "String" - } - }, - location: { - serializedName: "location", - type: { - name: "String" - } - } - } - } -}; - export const ImageReference: coreClient.CompositeMapper = { type: { name: "Composite", @@ -16698,7 +16779,27 @@ export const CommunityGallery: coreClient.CompositeMapper = { name: "Composite", className: "CommunityGallery", modelProperties: { - ...PirCommunityGalleryResource.type.modelProperties + ...PirCommunityGalleryResource.type.modelProperties, + disclaimer: { + serializedName: "properties.disclaimer", + type: { + name: "String" + } + }, + artifactTags: { + serializedName: "properties.artifactTags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + communityMetadata: { + serializedName: "properties.communityMetadata", + type: { + name: "Composite", + className: "CommunityGalleryMetadata" + } + } } } }; @@ -16792,6 +16893,19 @@ export const CommunityGalleryImage: coreClient.CompositeMapper = { type: { name: "String" } + }, + disclaimer: { + serializedName: "properties.disclaimer", + type: { + name: "String" + } + }, + artifactTags: { + serializedName: "properties.artifactTags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } } } } @@ -16827,6 +16941,19 @@ export const CommunityGalleryImageVersion: coreClient.CompositeMapper = { name: "Composite", className: "SharedGalleryImageVersionStorageProfile" } + }, + disclaimer: { + serializedName: "properties.disclaimer", + type: { + name: "String" + } + }, + artifactTags: { + serializedName: "properties.artifactTags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } } } } @@ -16939,7 +17066,15 @@ export const SharedGallery: coreClient.CompositeMapper = { name: "Composite", className: "SharedGallery", modelProperties: { - ...PirSharedGalleryResource.type.modelProperties + ...PirSharedGalleryResource.type.modelProperties, + artifactTags: { + serializedName: "properties.artifactTags", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } } } }; @@ -17033,6 +17168,13 @@ export const SharedGalleryImage: coreClient.CompositeMapper = { type: { name: "String" } + }, + artifactTags: { + serializedName: "properties.artifactTags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } } } } @@ -17068,6 +17210,13 @@ export const SharedGalleryImageVersion: coreClient.CompositeMapper = { name: "Composite", className: "SharedGalleryImageVersionStorageProfile" } + }, + artifactTags: { + serializedName: "properties.artifactTags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } } } } diff --git a/sdk/compute/arm-compute/src/models/parameters.ts b/sdk/compute/arm-compute/src/models/parameters.ts index cd45c7e60b2a..4b4a12b92cb7 100644 --- a/sdk/compute/arm-compute/src/models/parameters.ts +++ b/sdk/compute/arm-compute/src/models/parameters.ts @@ -1127,7 +1127,7 @@ export const galleryName: OperationURLParameter = { export const apiVersion3: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-03-03", + defaultValue: "2022-08-03", isConstant: true, serializedName: "api-version", type: { @@ -1213,6 +1213,34 @@ export const expand11: OperationQueryParameter = { } }; +export const galleryName1: OperationURLParameter = { + parameterPath: "galleryName", + mapper: { + constraints: { + Pattern: new RegExp("^.*$") + }, + serializedName: "galleryName", + required: true, + type: { + name: "String" + } + } +}; + +export const galleryImageName1: OperationURLParameter = { + parameterPath: "galleryImageName", + mapper: { + constraints: { + Pattern: new RegExp("^.*$") + }, + serializedName: "galleryImageName", + required: true, + type: { + name: "String" + } + } +}; + export const galleryApplication: OperationParameter = { parameterPath: "galleryApplication", mapper: GalleryApplicationMapper diff --git a/sdk/compute/arm-compute/src/operations/galleryImageVersions.ts b/sdk/compute/arm-compute/src/operations/galleryImageVersions.ts index c271b859db0b..b0816d4fbf64 100644 --- a/sdk/compute/arm-compute/src/operations/galleryImageVersions.ts +++ b/sdk/compute/arm-compute/src/operations/galleryImageVersions.ts @@ -32,6 +32,8 @@ import { GalleryImageVersionsGetOptionalParams, GalleryImageVersionsGetResponse, GalleryImageVersionsDeleteOptionalParams, + GalleryImageVersionsGetLatestOptionalParams, + GalleryImageVersionsGetLatestResponse, GalleryImageVersionsListByGalleryImageNextResponse } from "../models"; @@ -505,6 +507,25 @@ export class GalleryImageVersionsImpl implements GalleryImageVersions { return poller.pollUntilDone(); } + /** + * Retrieves information about the latest version of an image. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param options The options parameters. + */ + getLatest( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options?: GalleryImageVersionsGetLatestOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, galleryName, galleryImageName, options }, + getLatestOperationSpec + ); + } + /** * List gallery image versions in a gallery image definition. * @param resourceGroupName The name of the resource group. @@ -669,6 +690,29 @@ const deleteOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const getLatestOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versionNames/latest", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.LatestVersion + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.galleryName1, + Parameters.galleryImageName1 + ], + headerParameters: [Parameters.accept], + serializer +}; const listByGalleryImageOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions", diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/galleryImageVersions.ts b/sdk/compute/arm-compute/src/operationsInterfaces/galleryImageVersions.ts index 4b0460bc2156..e7487f5485f1 100644 --- a/sdk/compute/arm-compute/src/operationsInterfaces/galleryImageVersions.ts +++ b/sdk/compute/arm-compute/src/operationsInterfaces/galleryImageVersions.ts @@ -18,7 +18,9 @@ import { GalleryImageVersionsUpdateResponse, GalleryImageVersionsGetOptionalParams, GalleryImageVersionsGetResponse, - GalleryImageVersionsDeleteOptionalParams + GalleryImageVersionsDeleteOptionalParams, + GalleryImageVersionsGetLatestOptionalParams, + GalleryImageVersionsGetLatestResponse } from "../models"; /// @@ -175,4 +177,17 @@ export interface GalleryImageVersions { galleryImageVersionName: string, options?: GalleryImageVersionsDeleteOptionalParams ): Promise; + /** + * Retrieves information about the latest version of an image. + * @param resourceGroupName The name of the resource group. + * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. + * @param galleryImageName The name of the gallery image definition in which the Image Version resides. + * @param options The options parameters. + */ + getLatest( + resourceGroupName: string, + galleryName: string, + galleryImageName: string, + options?: GalleryImageVersionsGetLatestOptionalParams + ): Promise; } diff --git a/sdk/compute/arm-compute/test/sampleTest.ts b/sdk/compute/arm-compute/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/compute/arm-compute/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/compute/arm-compute/tsconfig.json b/sdk/compute/arm-compute/tsconfig.json index b84abc8423ab..3e6ae96443f3 100644 --- a/sdk/compute/arm-compute/tsconfig.json +++ b/sdk/compute/arm-compute/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-compute": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"