diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 40055629c861..18b4bbb41346 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -645,6 +645,21 @@ packages: - supports-color dev: false + /@azure/arm-compute/17.3.0: + resolution: {integrity: sha512-HPU9hEKB2s3qS2kvnEu+rg/ysC/oSTxZ9NugIcAbulSSmU6g0OxsWKhGWp7m6lxjmw3070bQlGDZSPGV3j4J/w==} + engines: {node: '>=12.0.0'} + dependencies: + '@azure/abort-controller': 1.0.4 + '@azure/core-auth': 1.3.2 + '@azure/core-client': 1.5.0 + '@azure/core-lro': 2.2.3 + '@azure/core-paging': 1.2.1 + '@azure/core-rest-pipeline': 1.5.0 + tslib: 2.3.1 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/arm-storage/17.0.0: resolution: {integrity: sha512-WS9eT3/vDQ7a1z/8K5BkPhoAi0ilo94yCSws4KyWq6UIA3RaXBDpYYAlN0TOxad9rPeOnWXWcB9gLw3DmjZ4wg==} engines: {node: '>=12.0.0'} @@ -9038,7 +9053,7 @@ packages: dev: false file:projects/ai-form-recognizer.tgz: - resolution: {integrity: sha512-p5c3Fvz/1TsAf39TR5Ob1MKEeCRfnLTepqV1LW/Hq1VZQ1AGvRbPSZAaUX9KbLtmfas+T4RkAs2NLYagTV5YWw==, tarball: file:projects/ai-form-recognizer.tgz} + resolution: {integrity: sha512-8nfO8GUFtqYDD3IZqe/e2skZAdyrGmMILxiBu5J97qbpBEHtR78QWfaBwH0wQjwB3qYvqtyxKO76G3OXPaNTPw==, tarball: file:projects/ai-form-recognizer.tgz} name: '@rush-temp/ai-form-recognizer' version: 0.0.0 dependencies: @@ -9924,28 +9939,27 @@ packages: dev: false file:projects/arm-compute.tgz: - resolution: {integrity: sha512-SXG1OOPxmuDjfmHhCOcG31GII1K7GgOEgaWBJ1ljPTcUIHkI9dVHelhX9hgUh5GOlGLpQlC6UYp6PKlJE4JVXA==, tarball: file:projects/arm-compute.tgz} + resolution: {integrity: sha512-CkJMDR3d+f00GcPgkTOQG1FbkqKiPDJoPakHKYohtZRQoPHP98UIcpTmJT6MG4KZm6dCrywUQQG66cL/QfKTxg==, tarball: file:projects/arm-compute.tgz} name: '@rush-temp/arm-compute' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.4 - '@rollup/plugin-commonjs': 21.0.1_rollup@2.67.1 - '@rollup/plugin-json': 4.1.0_rollup@2.67.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.67.1 - '@rollup/plugin-node-resolve': 13.1.3_rollup@2.67.1 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 2.67.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.67.1 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.15.1 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color @@ -10987,11 +11001,12 @@ packages: dev: false file:projects/arm-imagebuilder.tgz: - resolution: {integrity: sha512-kyj4FpY8IBE52Ojym8PqCldNoyZMUgbMZDUTT7hn7Rd7WF3N843VdO2uiLxTz+CCpZfvC2WDGY+H+wiCQeCcHQ==, tarball: file:projects/arm-imagebuilder.tgz} + resolution: {integrity: sha512-rIvsXQJShRtBz5RlLlvfoBOrrvb868mMeR8rLaiV16gm2S6qWYfsMXPdZ8NQ4fTvw3k5oiKZ5t/3XgcJfd2fZA==, tarball: file:projects/arm-imagebuilder.tgz} name: '@rush-temp/arm-imagebuilder' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 + '@azure/arm-compute': 17.3.0 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.4 '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 @@ -14716,7 +14731,7 @@ packages: dev: false file:projects/data-tables.tgz: - resolution: {integrity: sha512-2cfUMl2pp6rxlhzwxWiTvxuR3rE7/6PnHFqemx0G3XhFPcjNVmG86akuP53lYbCfZzrJ4zfIuiAm+TDhCEVYcg==, tarball: file:projects/data-tables.tgz} + resolution: {integrity: sha512-+zq/iyIQMvsNStPKiIdnhkC2EZfg5sUJAJoSF8UO7J7mnpNNMGqKy83bgVct89h9RQJ8ffvLvj8qOD+BOz0P+w==, tarball: file:projects/data-tables.tgz} name: '@rush-temp/data-tables' version: 0.0.0 dependencies: @@ -14953,7 +14968,7 @@ packages: dev: false file:projects/event-hubs.tgz: - resolution: {integrity: sha512-opYvozUeyklN6hWR3v+QKZ/yADTfwHXKp81KqpQODwrHWI6UosjIKDuSI6NaBQl8YGLL+KCCW8RtSoNeLWLTnw==, tarball: file:projects/event-hubs.tgz} + resolution: {integrity: sha512-WB+YXTl5pugC7LFJojH/xLjFnP99t0VTU7dUNFHnCWFfqsd8zDwQkhnbcuIsDBzTwcH6yOrN12pHod6Gec89lA==, tarball: file:projects/event-hubs.tgz} name: '@rush-temp/event-hubs' version: 0.0.0 dependencies: @@ -15847,7 +15862,7 @@ packages: dev: false file:projects/opentelemetry-instrumentation-azure-sdk.tgz: - resolution: {integrity: sha512-VBSR9nowFkwZxweaxyAfHs5845rwQss3+lKzEkswtJ6/fapsdB3/yCyCgjSk/wjFIQ+TmR0L1E7uxq2mj9kIdg==, tarball: file:projects/opentelemetry-instrumentation-azure-sdk.tgz} + resolution: {integrity: sha512-/zqXms1lqA4XHzV+tTJGpUrpT7aikkmGbNfpBYlHu3WaoqBht8uSTvXX0eLqbeN9F/fGIy82DVt4OSSmCfxKKg==, tarball: file:projects/opentelemetry-instrumentation-azure-sdk.tgz} name: '@rush-temp/opentelemetry-instrumentation-azure-sdk' version: 0.0.0 dependencies: @@ -17355,7 +17370,7 @@ packages: dev: false file:projects/template.tgz: - resolution: {integrity: sha512-HFiYA5WMTZ5uV7heu6jS7nPDXibcYDUwYY9BmsgPkSewJqaZrFZGq7VsrpEsT5LrKpbWTN79sQJI8ziiyaIXWA==, tarball: file:projects/template.tgz} + resolution: {integrity: sha512-+Br/j0LW6HPO8FtcZA318RDXzwVmFvhoVTH2MyExmFcT2ZQ0taJtGd7HeW9IPHVKxVRnPAnSrv1dT5tnOgCy1w==, tarball: file:projects/template.tgz} name: '@rush-temp/template' version: 0.0.0 dependencies: @@ -17491,7 +17506,7 @@ packages: dev: false file:projects/test-utils.tgz: - resolution: {integrity: sha512-6YltGfIt/N0fCMBst9a1WUIdPHEd1P07BVbpdSywL40SvBUrIl5KPmupCINQAYHCf6BvExke3q712AwIb3BGcA==, tarball: file:projects/test-utils.tgz} + resolution: {integrity: sha512-qF48UapaRaIx/JiHpf1Qpqrx/ef89BjKdakW4mKBEQOLBmcSkyA0mDhfZDaKuDuzfxDar+wkz1AlW03FeP+cBg==, tarball: file:projects/test-utils.tgz} name: '@rush-temp/test-utils' version: 0.0.0 dependencies: diff --git a/sdk/compute/arm-compute/CHANGELOG.md b/sdk/compute/arm-compute/CHANGELOG.md index 546c79cf597a..9d407c6b389f 100644 --- a/sdk/compute/arm-compute/CHANGELOG.md +++ b/sdk/compute/arm-compute/CHANGELOG.md @@ -1,15 +1,40 @@ # Release History + +## 18.0.0 (2022-03-18) + +**Features** -## 17.3.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added operation CommunityGalleryImages.list + - Added operation CommunityGalleryImageVersions.list + - Added Interface CommunityGalleryImageList + - Added Interface CommunityGalleryImagesListNextOptionalParams + - Added Interface CommunityGalleryImagesListOptionalParams + - Added Interface CommunityGalleryImageVersionList + - Added Interface CommunityGalleryImageVersionsListNextOptionalParams + - Added Interface CommunityGalleryImageVersionsListOptionalParams + - Added Interface SharedGalleryDiskImage + - Added Interface SharedGalleryImageVersionStorageProfile + - Added Type Alias CommunityGalleryImagesListNextResponse + - Added Type Alias CommunityGalleryImagesListResponse + - Added Type Alias CommunityGalleryImageVersionsListNextResponse + - Added Type Alias CommunityGalleryImageVersionsListResponse + - Added Type Alias SharedGalleryDataDiskImage + - Added Type Alias SharedGalleryHostCaching + - Added Type Alias SharedGalleryOSDiskImage + - Type Alias CommunityGalleryImage has a new parameter architecture + - Type Alias CommunityGalleryImageVersion has a new parameter excludeFromLatest + - Type Alias CommunityGalleryImageVersion has a new parameter storageProfile + - Type Alias SharedGalleryImage has a new parameter architecture + - Type Alias SharedGalleryImageVersion has a new parameter excludeFromLatest + - Type Alias SharedGalleryImageVersion has a new parameter storageProfile + - Added Enum KnownSharedGalleryHostCaching + - Enum KnownGallerySharingPermissionTypes has a new value Community -### Other Changes +**Breaking Changes** + - Enum KnownSharingProfileGroupTypes no longer has value Community + + ## 17.3.0 (2022-03-02) **Features** diff --git a/sdk/compute/arm-compute/README.md b/sdk/compute/arm-compute/README.md index 9a5b8e7c17fc..cb9f06fd0eac 100644 --- a/sdk/compute/arm-compute/README.md +++ b/sdk/compute/arm-compute/README.md @@ -16,8 +16,6 @@ Compute Client - [LTS versions of Node.js](https://nodejs.org/about/releases/) - Latest versions of Safari, Chrome, Edge and Firefox. -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. - ### Prerequisites - An [Azure subscription][azure_sub]. @@ -51,17 +49,8 @@ For more information about how to create an Azure AD Application check out [this ```javascript const { ComputeManagementClient } = require("@azure/arm-compute"); const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new ComputeManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new ComputeManagementClient(credential, subscriptionId); ``` diff --git a/sdk/compute/arm-compute/_meta.json b/sdk/compute/arm-compute/_meta.json index 8f1be21afd12..d2de9e1670e7 100644 --- a/sdk/compute/arm-compute/_meta.json +++ b/sdk/compute/arm-compute/_meta.json @@ -1,7 +1,8 @@ { - "commit": "4042a47cff72c950d35dd72149895b044ed79713", + "commit": "0e34eedd27e854e1ceaf940e37daea70f37c4d53", "readme": "specification/compute/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\compute\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220225.1 --generate-sample=true", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/compute/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20220225.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.1.3", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/compute/arm-compute/package.json b/sdk/compute/arm-compute/package.json index 75fba3649d45..c2a7712149f1 100644 --- a/sdk/compute/arm-compute/package.json +++ b/sdk/compute/arm-compute/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ComputeManagementClient.", - "version": "17.3.1", + "version": "18.0.0", "engines": { "node": ">=12.0.0" }, @@ -29,21 +29,20 @@ "types": "./types/arm-compute.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.18.11", - "@rollup/plugin-commonjs": "^21.0.1", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-multi-entry": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.1.3", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", "mkdirp": "^1.0.4", - "rollup": "^2.66.1", - "rollup-plugin-sourcemaps": "^0.6.3", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2", - "@azure/arm-network": "^26.0.0" + "cross-env": "^7.0.2" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute", "repository": { @@ -99,21 +98,5 @@ "docs": "echo skipped" }, "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/computeManagementClient.ts", - "prefix": "packageDetails" - } - ] - }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-compute?view=azure-node-preview" - } -} + "autoPublish": true +} \ 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 53ef7aaacaf7..92640307a622 100644 --- a/sdk/compute/arm-compute/review/arm-compute.api.md +++ b/sdk/compute/arm-compute/review/arm-compute.api.md @@ -936,11 +936,19 @@ export type CommunityGalleryImage = PirCommunityGalleryResource & { hyperVGeneration?: HyperVGeneration; features?: GalleryImageFeature[]; purchasePlan?: ImagePurchasePlan; + architecture?: Architecture; }; +// @public +export interface CommunityGalleryImageList { + nextLink?: string; + value: CommunityGalleryImage[]; +} + // @public export interface CommunityGalleryImages { get(location: string, publicGalleryName: string, galleryImageName: string, options?: CommunityGalleryImagesGetOptionalParams): Promise; + list(location: string, publicGalleryName: string, options?: CommunityGalleryImagesListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -950,15 +958,38 @@ export interface CommunityGalleryImagesGetOptionalParams extends coreClient.Oper // @public export type CommunityGalleryImagesGetResponse = CommunityGalleryImage; +// @public +export interface CommunityGalleryImagesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunityGalleryImagesListNextResponse = CommunityGalleryImageList; + +// @public +export interface CommunityGalleryImagesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunityGalleryImagesListResponse = CommunityGalleryImageList; + // @public export type CommunityGalleryImageVersion = PirCommunityGalleryResource & { publishedDate?: Date; endOfLifeDate?: Date; + excludeFromLatest?: boolean; + storageProfile?: SharedGalleryImageVersionStorageProfile; }; +// @public +export interface CommunityGalleryImageVersionList { + nextLink?: string; + value: CommunityGalleryImageVersion[]; +} + // @public export interface CommunityGalleryImageVersions { get(location: string, publicGalleryName: string, galleryImageName: string, galleryImageVersionName: string, options?: CommunityGalleryImageVersionsGetOptionalParams): Promise; + list(location: string, publicGalleryName: string, galleryImageName: string, options?: CommunityGalleryImageVersionsListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -968,6 +999,20 @@ export interface CommunityGalleryImageVersionsGetOptionalParams extends coreClie // @public export type CommunityGalleryImageVersionsGetResponse = CommunityGalleryImageVersion; +// @public +export interface CommunityGalleryImageVersionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunityGalleryImageVersionsListNextResponse = CommunityGalleryImageVersionList; + +// @public +export interface CommunityGalleryImageVersionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CommunityGalleryImageVersionsListResponse = CommunityGalleryImageVersionList; + // @public export interface CommunityGalleryInfo { readonly communityGalleryEnabled?: boolean; @@ -3173,6 +3218,8 @@ export enum KnownGalleryPropertiesProvisioningState { // @public export enum KnownGallerySharingPermissionTypes { + // (undocumented) + Community = "Community", // (undocumented) Groups = "Groups", // (undocumented) @@ -3458,6 +3505,16 @@ export enum KnownSelectPermissions { Permissions = "Permissions" } +// @public +export enum KnownSharedGalleryHostCaching { + // (undocumented) + None = "None", + // (undocumented) + ReadOnly = "ReadOnly", + // (undocumented) + ReadWrite = "ReadWrite" +} + // @public export enum KnownSharedToValues { // (undocumented) @@ -3469,8 +3526,6 @@ export enum KnownSharingProfileGroupTypes { // (undocumented) AADTenants = "AADTenants", // (undocumented) - Community = "Community", - // (undocumented) Subscriptions = "Subscriptions" } @@ -5135,6 +5190,20 @@ export type SharedGalleriesListResponse = SharedGalleryList; // @public export type SharedGallery = PirSharedGalleryResource & {}; +// @public +export type SharedGalleryDataDiskImage = SharedGalleryDiskImage & { + lun: number; +}; + +// @public +export interface SharedGalleryDiskImage { + readonly diskSizeGB?: number; + hostCaching?: SharedGalleryHostCaching; +} + +// @public +export type SharedGalleryHostCaching = string; + // @public export type SharedGalleryImage = PirSharedGalleryResource & { osType?: OperatingSystemTypes; @@ -5146,6 +5215,7 @@ export type SharedGalleryImage = PirSharedGalleryResource & { hyperVGeneration?: HyperVGeneration; features?: GalleryImageFeature[]; purchasePlan?: ImagePurchasePlan; + architecture?: Architecture; }; // @public @@ -5187,6 +5257,8 @@ export type SharedGalleryImagesListResponse = SharedGalleryImageList; export type SharedGalleryImageVersion = PirSharedGalleryResource & { publishedDate?: Date; endOfLifeDate?: Date; + excludeFromLatest?: boolean; + storageProfile?: SharedGalleryImageVersionStorageProfile; }; // @public @@ -5224,12 +5296,21 @@ export interface SharedGalleryImageVersionsListOptionalParams extends coreClient // @public export type SharedGalleryImageVersionsListResponse = SharedGalleryImageVersionList; +// @public +export interface SharedGalleryImageVersionStorageProfile { + dataDiskImages?: SharedGalleryDataDiskImage[]; + osDiskImage?: SharedGalleryOSDiskImage; +} + // @public export interface SharedGalleryList { nextLink?: string; value: SharedGallery[]; } +// @public +export type SharedGalleryOSDiskImage = SharedGalleryDiskImage & {}; + // @public export type SharedToValues = string; diff --git a/sdk/compute/arm-compute/rollup.config.js b/sdk/compute/arm-compute/rollup.config.js index 3f89d7309da5..9be1955eb7f1 100644 --- a/sdk/compute/arm-compute/rollup.config.js +++ b/sdk/compute/arm-compute/rollup.config.js @@ -14,14 +14,62 @@ import json from "@rollup/plugin-json"; import nodeBuiltins from "builtin-modules"; +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + // #region Warning Handler /** - * A function that can determine whether a rollup warning should be ignored. If + * A function that can determine whether a rollupwarning should be ignored. If * the function returns `true`, then the warning will not be displayed. */ -function ignoreNiseSinonEval(warning) { +function ignoreNiseSinonEvalWarnings(warning) { return ( warning.code === "EVAL" && warning.id && @@ -30,14 +78,17 @@ function ignoreNiseSinonEval(warning) { ); } -function ignoreChaiCircularDependency(warning) { +function ignoreChaiCircularDependencyWarnings(warning) { return ( warning.code === "CIRCULAR_DEPENDENCY" && warning.importer && warning.importer.includes("node_modules/chai") === true ); } -const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; /** * Construct a warning handler for the shared rollup configuration @@ -71,7 +122,22 @@ function makeBrowserTestConfig() { nodeResolve({ mainFields: ["module", "browser"] }), - cjs(), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), json(), sourcemaps() //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) @@ -107,7 +173,7 @@ export function makeConfig(pkg, options) { ], output: { file: "dist/index.js", format: "cjs", sourcemap: true }, preserveSymlinks: false, - plugins: [sourcemaps(), nodeResolve()] + plugins: [sourcemaps(), nodeResolve(), cjs()] }; const config = [baseConfig]; diff --git a/sdk/compute/arm-compute/src/computeManagementClient.ts b/sdk/compute/arm-compute/src/computeManagementClient.ts index e8ec334e419a..6aa385c29548 100644 --- a/sdk/compute/arm-compute/src/computeManagementClient.ts +++ b/sdk/compute/arm-compute/src/computeManagementClient.ts @@ -144,7 +144,7 @@ export class ComputeManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-compute/17.3.1`; + const packageDetails = `azsdk-js-arm-compute/18.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 4abb76fcfb79..76376a3d86ae 100644 --- a/sdk/compute/arm-compute/src/models/index.ts +++ b/sdk/compute/arm-compute/src/models/index.ts @@ -3129,7 +3129,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** */ + /** 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. @@ -3142,7 +3142,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**

**Community** */ + /** 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[]; @@ -3498,6 +3498,25 @@ export interface SharedGalleryImageVersionList { nextLink?: string; } +/** This is the storage profile of a Gallery Image Version. */ +export interface SharedGalleryImageVersionStorageProfile { + /** This is the OS disk image. */ + osDiskImage?: SharedGalleryOSDiskImage; + /** A list of data disk images. */ + dataDiskImages?: SharedGalleryDataDiskImage[]; +} + +/** This is the disk image base class. */ +export interface SharedGalleryDiskImage { + /** + * This property indicates the size of the VHD to be created. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly diskSizeGB?: number; + /** The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' */ + hostCaching?: SharedGalleryHostCaching; +} + /** Base information about the community gallery resource in pir. */ export interface PirCommunityGalleryResource { /** @@ -3519,6 +3538,22 @@ export interface PirCommunityGalleryResource { uniqueId?: string; } +/** The List Community Gallery Images operation response. */ +export interface CommunityGalleryImageList { + /** A list of community gallery images. */ + value: CommunityGalleryImage[]; + /** The uri to fetch the next page of community gallery images. Call ListNext() with this to fetch the next page of community gallery images. */ + nextLink?: string; +} + +/** The List Community Gallery Image versions operation response. */ +export interface CommunityGalleryImageVersionList { + /** A list of community gallery image versions. */ + value: CommunityGalleryImageVersion[]; + /** The uri to fetch the next page of community gallery image versions. Call ListNext() with this to fetch the next page of community gallery image versions. */ + nextLink?: string; +} + export interface RoleInstance { /** * Resource Id @@ -5100,7 +5135,7 @@ export type GalleryImage = Resource & { readonly provisioningState?: GalleryImagePropertiesProvisioningState; /** 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; }; @@ -5842,7 +5877,7 @@ export type GalleryImageUpdate = UpdateResourceDefinition & { readonly provisioningState?: GalleryImagePropertiesProvisioningState; /** 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; }; @@ -5935,6 +5970,15 @@ export type PirSharedGalleryResource = PirResource & { uniqueId?: string; }; +/** This is the OS disk image. */ +export type SharedGalleryOSDiskImage = SharedGalleryDiskImage & {}; + +/** This is the data disk image. */ +export type SharedGalleryDataDiskImage = SharedGalleryDiskImage & { + /** This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. */ + lun: number; +}; + /** Specifies information about the Community Gallery that you want to create or update. */ export type CommunityGallery = PirCommunityGalleryResource & {}; @@ -5958,6 +6002,8 @@ export type CommunityGalleryImage = PirCommunityGalleryResource & { features?: GalleryImageFeature[]; /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ purchasePlan?: ImagePurchasePlan; + /** CPU architecture supported by an OS disk. */ + architecture?: Architecture; }; /** Specifies information about the gallery image version that you want to create or update. */ @@ -5966,6 +6012,10 @@ export type CommunityGalleryImageVersion = PirCommunityGalleryResource & { publishedDate?: Date; /** The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. */ endOfLifeDate?: Date; + /** If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. */ + excludeFromLatest?: boolean; + /** Describes the storage profile of the image version. */ + storageProfile?: SharedGalleryImageVersionStorageProfile; }; /** Describes a Virtual Machine Image. */ @@ -6015,6 +6065,8 @@ export type SharedGalleryImage = PirSharedGalleryResource & { features?: GalleryImageFeature[]; /** Describes the gallery image definition purchase plan. This is used by marketplace images. */ purchasePlan?: ImagePurchasePlan; + /** CPU architecture supported by an OS disk. */ + architecture?: Architecture; }; /** Specifies information about the gallery image version that you want to create or update. */ @@ -6023,6 +6075,10 @@ export type SharedGalleryImageVersion = PirSharedGalleryResource & { publishedDate?: Date; /** The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. */ endOfLifeDate?: Date; + /** If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. */ + excludeFromLatest?: boolean; + /** Describes the storage profile of the image version. */ + storageProfile?: SharedGalleryImageVersionStorageProfile; }; /** Known values of {@link ProximityPlacementGroupType} that the service accepts. */ @@ -7622,7 +7678,8 @@ export type GalleryPropertiesProvisioningState = string; /** Known values of {@link GallerySharingPermissionTypes} that the service accepts. */ export enum KnownGallerySharingPermissionTypes { Private = "Private", - Groups = "Groups" + Groups = "Groups", + Community = "Community" } /** @@ -7631,15 +7688,15 @@ export enum KnownGallerySharingPermissionTypes { * this enum contains the known values that the service supports. * ### Known values supported by the service * **Private** \ - * **Groups** + * **Groups** \ + * **Community** */ export type GallerySharingPermissionTypes = string; /** Known values of {@link SharingProfileGroupTypes} that the service accepts. */ export enum KnownSharingProfileGroupTypes { Subscriptions = "Subscriptions", - AADTenants = "AADTenants", - Community = "Community" + AADTenants = "AADTenants" } /** @@ -7648,8 +7705,7 @@ export enum KnownSharingProfileGroupTypes { * this enum contains the known values that the service supports. * ### Known values supported by the service * **Subscriptions** \ - * **AADTenants** \ - * **Community** + * **AADTenants** */ export type SharingProfileGroupTypes = string; @@ -7929,6 +7985,24 @@ export enum KnownSharedToValues { */ export type SharedToValues = string; +/** Known values of {@link SharedGalleryHostCaching} that the service accepts. */ +export enum KnownSharedGalleryHostCaching { + None = "None", + ReadOnly = "ReadOnly", + ReadWrite = "ReadWrite" +} + +/** + * Defines values for SharedGalleryHostCaching. \ + * {@link KnownSharedGalleryHostCaching} can be used interchangeably with SharedGalleryHostCaching, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **ReadOnly** \ + * **ReadWrite** + */ +export type SharedGalleryHostCaching = string; + /** Known values of {@link CloudServiceUpgradeMode} that the service accepts. */ export enum KnownCloudServiceUpgradeMode { Auto = "Auto", @@ -10661,6 +10735,20 @@ export interface CommunityGalleryImagesGetOptionalParams /** Contains response data for the get operation. */ export type CommunityGalleryImagesGetResponse = CommunityGalleryImage; +/** Optional parameters. */ +export interface CommunityGalleryImagesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type CommunityGalleryImagesListResponse = CommunityGalleryImageList; + +/** Optional parameters. */ +export interface CommunityGalleryImagesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type CommunityGalleryImagesListNextResponse = CommunityGalleryImageList; + /** Optional parameters. */ export interface CommunityGalleryImageVersionsGetOptionalParams extends coreClient.OperationOptions {} @@ -10668,6 +10756,20 @@ export interface CommunityGalleryImageVersionsGetOptionalParams /** Contains response data for the get operation. */ export type CommunityGalleryImageVersionsGetResponse = CommunityGalleryImageVersion; +/** Optional parameters. */ +export interface CommunityGalleryImageVersionsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type CommunityGalleryImageVersionsListResponse = CommunityGalleryImageVersionList; + +/** Optional parameters. */ +export interface CommunityGalleryImageVersionsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type CommunityGalleryImageVersionsListNextResponse = CommunityGalleryImageVersionList; + /** Optional parameters. */ export interface CloudServiceRoleInstancesDeleteOptionalParams extends coreClient.OperationOptions { diff --git a/sdk/compute/arm-compute/src/models/mappers.ts b/sdk/compute/arm-compute/src/models/mappers.ts index 12978d03ca18..555e36faf902 100644 --- a/sdk/compute/arm-compute/src/models/mappers.ts +++ b/sdk/compute/arm-compute/src/models/mappers.ts @@ -9131,6 +9131,56 @@ export const SharedGalleryImageVersionList: coreClient.CompositeMapper = { } }; +export const SharedGalleryImageVersionStorageProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SharedGalleryImageVersionStorageProfile", + modelProperties: { + osDiskImage: { + serializedName: "osDiskImage", + type: { + name: "Composite", + className: "SharedGalleryOSDiskImage" + } + }, + dataDiskImages: { + serializedName: "dataDiskImages", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SharedGalleryDataDiskImage" + } + } + } + } + } + } +}; + +export const SharedGalleryDiskImage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SharedGalleryDiskImage", + modelProperties: { + diskSizeGB: { + serializedName: "diskSizeGB", + readOnly: true, + type: { + name: "Number" + } + }, + hostCaching: { + serializedName: "hostCaching", + type: { + name: "String" + } + } + } + } +}; + export const PirCommunityGalleryResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -9167,6 +9217,62 @@ export const PirCommunityGalleryResource: coreClient.CompositeMapper = { } }; +export const CommunityGalleryImageList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityGalleryImageList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CommunityGalleryImage" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const CommunityGalleryImageVersionList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityGalleryImageVersionList", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CommunityGalleryImageVersion" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const RoleInstance: coreClient.CompositeMapper = { type: { name: "Composite", @@ -15310,6 +15416,33 @@ export const PirSharedGalleryResource: coreClient.CompositeMapper = { } }; +export const SharedGalleryOSDiskImage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SharedGalleryOSDiskImage", + modelProperties: { + ...SharedGalleryDiskImage.type.modelProperties + } + } +}; + +export const SharedGalleryDataDiskImage: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SharedGalleryDataDiskImage", + modelProperties: { + ...SharedGalleryDiskImage.type.modelProperties, + lun: { + serializedName: "lun", + required: true, + type: { + name: "Number" + } + } + } + } +}; + export const CommunityGallery: coreClient.CompositeMapper = { type: { name: "Composite", @@ -15391,6 +15524,12 @@ export const CommunityGalleryImage: coreClient.CompositeMapper = { name: "Composite", className: "ImagePurchasePlan" } + }, + architecture: { + serializedName: "properties.architecture", + type: { + name: "String" + } } } } @@ -15413,6 +15552,19 @@ export const CommunityGalleryImageVersion: coreClient.CompositeMapper = { type: { name: "DateTime" } + }, + excludeFromLatest: { + serializedName: "properties.excludeFromLatest", + type: { + name: "Boolean" + } + }, + storageProfile: { + serializedName: "properties.storageProfile", + type: { + name: "Composite", + className: "SharedGalleryImageVersionStorageProfile" + } } } } @@ -15594,6 +15746,12 @@ export const SharedGalleryImage: coreClient.CompositeMapper = { name: "Composite", className: "ImagePurchasePlan" } + }, + architecture: { + serializedName: "properties.architecture", + type: { + name: "String" + } } } } @@ -15616,6 +15774,19 @@ export const SharedGalleryImageVersion: coreClient.CompositeMapper = { type: { name: "DateTime" } + }, + excludeFromLatest: { + serializedName: "properties.excludeFromLatest", + type: { + name: "Boolean" + } + }, + storageProfile: { + serializedName: "properties.storageProfile", + type: { + name: "Composite", + className: "SharedGalleryImageVersionStorageProfile" + } } } } diff --git a/sdk/compute/arm-compute/src/models/parameters.ts b/sdk/compute/arm-compute/src/models/parameters.ts index 3b84e2941ec9..388e5d56e169 100644 --- a/sdk/compute/arm-compute/src/models/parameters.ts +++ b/sdk/compute/arm-compute/src/models/parameters.ts @@ -1079,7 +1079,7 @@ export const galleryName: OperationURLParameter = { export const apiVersion3: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-10-01", + defaultValue: "2022-01-03", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/compute/arm-compute/src/operations/communityGalleries.ts b/sdk/compute/arm-compute/src/operations/communityGalleries.ts index 34331ae4ea8d..62a08e1bf8a7 100644 --- a/sdk/compute/arm-compute/src/operations/communityGalleries.ts +++ b/sdk/compute/arm-compute/src/operations/communityGalleries.ts @@ -60,7 +60,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/communityGalleryImageVersions.ts b/sdk/compute/arm-compute/src/operations/communityGalleryImageVersions.ts index 3c4df4024c2d..2e67eec68195 100644 --- a/sdk/compute/arm-compute/src/operations/communityGalleryImageVersions.ts +++ b/sdk/compute/arm-compute/src/operations/communityGalleryImageVersions.ts @@ -6,16 +6,23 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { CommunityGalleryImageVersions } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ComputeManagementClient } from "../computeManagementClient"; import { + CommunityGalleryImageVersion, + CommunityGalleryImageVersionsListNextOptionalParams, + CommunityGalleryImageVersionsListOptionalParams, CommunityGalleryImageVersionsGetOptionalParams, - CommunityGalleryImageVersionsGetResponse + CommunityGalleryImageVersionsGetResponse, + CommunityGalleryImageVersionsListResponse, + CommunityGalleryImageVersionsListNextResponse } from "../models"; +/// /** Class containing CommunityGalleryImageVersions operations. */ export class CommunityGalleryImageVersionsImpl implements CommunityGalleryImageVersions { @@ -29,6 +36,86 @@ export class CommunityGalleryImageVersionsImpl this.client = client; } + /** + * List community gallery image versions inside an image. + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param options The options parameters. + */ + public list( + location: string, + publicGalleryName: string, + galleryImageName: string, + options?: CommunityGalleryImageVersionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + location, + publicGalleryName, + galleryImageName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + location, + publicGalleryName, + galleryImageName, + options + ); + } + }; + } + + private async *listPagingPage( + location: string, + publicGalleryName: string, + galleryImageName: string, + options?: CommunityGalleryImageVersionsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + location, + publicGalleryName, + galleryImageName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + location, + publicGalleryName, + galleryImageName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + location: string, + publicGalleryName: string, + galleryImageName: string, + options?: CommunityGalleryImageVersionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + location, + publicGalleryName, + galleryImageName, + options + )) { + yield* page; + } + } + /** * Get a community gallery image version. * @param location Resource location. @@ -57,6 +144,46 @@ export class CommunityGalleryImageVersionsImpl getOperationSpec ); } + + /** + * List community gallery image versions inside an image. + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param options The options parameters. + */ + private _list( + location: string, + publicGalleryName: string, + galleryImageName: string, + options?: CommunityGalleryImageVersionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, publicGalleryName, galleryImageName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + location: string, + publicGalleryName: string, + galleryImageName: string, + nextLink: string, + options?: CommunityGalleryImageVersionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, publicGalleryName, galleryImageName, nextLink, options }, + listNextOperationSpec + ); + } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -73,7 +200,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -85,3 +212,49 @@ const getOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommunityGalleryImageVersionList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location, + Parameters.galleryImageName, + Parameters.publicGalleryName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommunityGalleryImageVersionList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.location, + Parameters.galleryImageName, + Parameters.publicGalleryName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/compute/arm-compute/src/operations/communityGalleryImages.ts b/sdk/compute/arm-compute/src/operations/communityGalleryImages.ts index 487c976b6a77..b74019395c8b 100644 --- a/sdk/compute/arm-compute/src/operations/communityGalleryImages.ts +++ b/sdk/compute/arm-compute/src/operations/communityGalleryImages.ts @@ -6,16 +6,23 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { CommunityGalleryImages } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ComputeManagementClient } from "../computeManagementClient"; import { + CommunityGalleryImage, + CommunityGalleryImagesListNextOptionalParams, + CommunityGalleryImagesListOptionalParams, CommunityGalleryImagesGetOptionalParams, - CommunityGalleryImagesGetResponse + CommunityGalleryImagesGetResponse, + CommunityGalleryImagesListResponse, + CommunityGalleryImagesListNextResponse } from "../models"; +/// /** Class containing CommunityGalleryImages operations. */ export class CommunityGalleryImagesImpl implements CommunityGalleryImages { private readonly client: ComputeManagementClient; @@ -28,6 +35,65 @@ export class CommunityGalleryImagesImpl implements CommunityGalleryImages { this.client = client; } + /** + * List community gallery images inside a gallery. + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param options The options parameters. + */ + public list( + location: string, + publicGalleryName: string, + options?: CommunityGalleryImagesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(location, publicGalleryName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(location, publicGalleryName, options); + } + }; + } + + private async *listPagingPage( + location: string, + publicGalleryName: string, + options?: CommunityGalleryImagesListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(location, publicGalleryName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext( + location, + publicGalleryName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + location: string, + publicGalleryName: string, + options?: CommunityGalleryImagesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + location, + publicGalleryName, + options + )) { + yield* page; + } + } + /** * Get a community gallery image. * @param location Resource location. @@ -46,6 +112,42 @@ export class CommunityGalleryImagesImpl implements CommunityGalleryImages { getOperationSpec ); } + + /** + * List community gallery images inside a gallery. + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param options The options parameters. + */ + private _list( + location: string, + publicGalleryName: string, + options?: CommunityGalleryImagesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, publicGalleryName, options }, + listOperationSpec + ); + } + + /** + * ListNext + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + location: string, + publicGalleryName: string, + nextLink: string, + options?: CommunityGalleryImagesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, publicGalleryName, nextLink, options }, + listNextOperationSpec + ); + } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -62,7 +164,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -73,3 +175,47 @@ const getOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommunityGalleryImageList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location, + Parameters.publicGalleryName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommunityGalleryImageList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion3], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + Parameters.location, + Parameters.publicGalleryName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/compute/arm-compute/src/operations/sharedGalleries.ts b/sdk/compute/arm-compute/src/operations/sharedGalleries.ts index 808dae3ffc1b..19101bb0cbc0 100644 --- a/sdk/compute/arm-compute/src/operations/sharedGalleries.ts +++ b/sdk/compute/arm-compute/src/operations/sharedGalleries.ts @@ -145,7 +145,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1, Parameters.sharedTo], + queryParameters: [Parameters.apiVersion3, Parameters.sharedTo], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -166,7 +166,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -187,7 +187,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1, Parameters.sharedTo], + queryParameters: [Parameters.apiVersion3, Parameters.sharedTo], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/sharedGalleryImageVersions.ts b/sdk/compute/arm-compute/src/operations/sharedGalleryImageVersions.ts index a416ee2cedd5..39857d5764b8 100644 --- a/sdk/compute/arm-compute/src/operations/sharedGalleryImageVersions.ts +++ b/sdk/compute/arm-compute/src/operations/sharedGalleryImageVersions.ts @@ -204,7 +204,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1, Parameters.sharedTo], + queryParameters: [Parameters.apiVersion3, Parameters.sharedTo], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -227,7 +227,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -250,7 +250,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1, Parameters.sharedTo], + queryParameters: [Parameters.apiVersion3, Parameters.sharedTo], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/sharedGalleryImages.ts b/sdk/compute/arm-compute/src/operations/sharedGalleryImages.ts index b30d2a77e79a..27e0ba14c07b 100644 --- a/sdk/compute/arm-compute/src/operations/sharedGalleryImages.ts +++ b/sdk/compute/arm-compute/src/operations/sharedGalleryImages.ts @@ -165,7 +165,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1, Parameters.sharedTo], + queryParameters: [Parameters.apiVersion3, Parameters.sharedTo], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -187,7 +187,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -209,7 +209,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1, Parameters.sharedTo], + queryParameters: [Parameters.apiVersion3, Parameters.sharedTo], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImageVersions.ts b/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImageVersions.ts index 4a9f9ed88f2d..53851504708c 100644 --- a/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImageVersions.ts +++ b/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImageVersions.ts @@ -6,13 +6,30 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { + CommunityGalleryImageVersion, + CommunityGalleryImageVersionsListOptionalParams, CommunityGalleryImageVersionsGetOptionalParams, CommunityGalleryImageVersionsGetResponse } from "../models"; +/// /** Interface representing a CommunityGalleryImageVersions. */ export interface CommunityGalleryImageVersions { + /** + * List community gallery image versions inside an image. + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param galleryImageName The name of the community gallery image definition. + * @param options The options parameters. + */ + list( + location: string, + publicGalleryName: string, + galleryImageName: string, + options?: CommunityGalleryImageVersionsListOptionalParams + ): PagedAsyncIterableIterator; /** * Get a community gallery image version. * @param location Resource location. diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImages.ts b/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImages.ts index 282d3af41a5d..7d3f7811531e 100644 --- a/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImages.ts +++ b/sdk/compute/arm-compute/src/operationsInterfaces/communityGalleryImages.ts @@ -6,13 +6,28 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { + CommunityGalleryImage, + CommunityGalleryImagesListOptionalParams, CommunityGalleryImagesGetOptionalParams, CommunityGalleryImagesGetResponse } from "../models"; +/// /** Interface representing a CommunityGalleryImages. */ export interface CommunityGalleryImages { + /** + * List community gallery images inside a gallery. + * @param location Resource location. + * @param publicGalleryName The public name of the community gallery. + * @param options The options parameters. + */ + list( + location: string, + publicGalleryName: string, + options?: CommunityGalleryImagesListOptionalParams + ): PagedAsyncIterableIterator; /** * Get a community gallery image. * @param location Resource location. diff --git a/sdk/compute/arm-compute/test/sampleTest.ts b/sdk/compute/arm-compute/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/compute/arm-compute/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * 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 { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + 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" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + 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"