From 1c048634683f8514fa79669e561ad69b51b9d265 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 5 Aug 2022 02:21:49 +0000 Subject: [PATCH] CodeGen from PR 20122 in Azure/azure-rest-api-specs Merge 0b20c9a381201c9b6f44c3da2e24a90dec4472d8 into d885d1f6a1e013a3cc44bf5c96e68278053a0ffd --- .../arm-imagebuilder/CHANGELOG.md | 33 ++-- sdk/imagebuilder/arm-imagebuilder/_meta.json | 8 +- .../arm-imagebuilder/package.json | 22 +-- .../review/arm-imagebuilder.api.md | 162 ++++++++---------- .../src/imageBuilderClient.ts | 4 +- .../arm-imagebuilder/src/models/index.ts | 97 +++++++---- .../arm-imagebuilder/test/sampleTest.ts | 43 +++++ .../arm-imagebuilder/tsconfig.json | 10 +- 8 files changed, 213 insertions(+), 166 deletions(-) create mode 100644 sdk/imagebuilder/arm-imagebuilder/test/sampleTest.ts diff --git a/sdk/imagebuilder/arm-imagebuilder/CHANGELOG.md b/sdk/imagebuilder/arm-imagebuilder/CHANGELOG.md index 3a8d84d36d43..4e6230f47dc1 100644 --- a/sdk/imagebuilder/arm-imagebuilder/CHANGELOG.md +++ b/sdk/imagebuilder/arm-imagebuilder/CHANGELOG.md @@ -1,15 +1,28 @@ # Release History + +## 2.1.0 (2022-08-05) + +**Features** -## 2.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added Interface ImageTemplate + - Added Interface ImageTemplateFileCustomizer + - Added Interface ImageTemplateManagedImageDistributor + - Added Interface ImageTemplateManagedImageSource + - Added Interface ImageTemplatePlatformImageSource + - Added Interface ImageTemplatePowerShellCustomizer + - Added Interface ImageTemplatePowerShellValidator + - Added Interface ImageTemplateRestartCustomizer + - Added Interface ImageTemplateSharedImageDistributor + - Added Interface ImageTemplateSharedImageVersionSource + - Added Interface ImageTemplateShellCustomizer + - Added Interface ImageTemplateShellValidator + - Added Interface ImageTemplateVhdDistributor + - Added Interface ImageTemplateWindowsUpdateCustomizer + - Added Interface ProxyResource + - Added Interface RunOutput + - Added Interface TrackedResource + + ## 2.0.0 (2022-06-06) **Features** diff --git a/sdk/imagebuilder/arm-imagebuilder/_meta.json b/sdk/imagebuilder/arm-imagebuilder/_meta.json index 1ae6ed1406ec..1dfb95dd3086 100644 --- a/sdk/imagebuilder/arm-imagebuilder/_meta.json +++ b/sdk/imagebuilder/arm-imagebuilder/_meta.json @@ -1,8 +1,8 @@ { - "commit": "078b90617e5e08137d0395963bd4119f4561a910", + "commit": "757cfd0f3b210a5abd7a8402527e76ff1bbeff81", "readme": "specification/imagebuilder/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:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\imagebuilder\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-beta.20 --generate-sample=true", + "autorest_command": "", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", - "use": "@autorest/typescript@6.0.0-beta.20" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.1", + "use": "@autorest/typescript@6.0.0-rc.1" } \ No newline at end of file diff --git a/sdk/imagebuilder/arm-imagebuilder/package.json b/sdk/imagebuilder/arm-imagebuilder/package.json index 18dd18aa46e0..bc324cd17c6e 100644 --- a/sdk/imagebuilder/arm-imagebuilder/package.json +++ b/sdk/imagebuilder/arm-imagebuilder/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ImageBuilderClient.", - "version": "2.0.1", + "version": "2.1.0", "engines": { "node": ">=12.0.0" }, @@ -46,10 +46,7 @@ "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", - "@azure/dev-tool": "^1.0.0", - "@azure/arm-compute": "^17.0.0", - "@azure/arm-msi": "^2.0.0", - "@types/node": "^12.0.0" + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/imagebuilder/arm-imagebuilder", "repository": { @@ -101,8 +98,7 @@ "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "integration-test:browser": "echo skipped", - "docs": "echo skipped" + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -113,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-imagebuilder?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/imagebuilder/arm-imagebuilder/review/arm-imagebuilder.api.md b/sdk/imagebuilder/arm-imagebuilder/review/arm-imagebuilder.api.md index a30e247fb617..338d9a2d5622 100644 --- a/sdk/imagebuilder/arm-imagebuilder/review/arm-imagebuilder.api.md +++ b/sdk/imagebuilder/arm-imagebuilder/review/arm-imagebuilder.api.md @@ -55,20 +55,20 @@ export interface ImageBuilderClientOptionalParams extends coreClient.ServiceClie } // @public -export type ImageTemplate = TrackedResource & { - identity: ImageTemplateIdentity; - source?: ImageTemplateSourceUnion; +export interface ImageTemplate extends TrackedResource { + buildTimeoutInMinutes?: number; customize?: ImageTemplateCustomizerUnion[]; - validate?: ImageTemplatePropertiesValidate; distribute?: ImageTemplateDistributorUnion[]; - readonly provisioningState?: ProvisioningState; - readonly provisioningError?: ProvisioningError; + readonly exactStagingResourceGroup?: string; + identity: ImageTemplateIdentity; readonly lastRunStatus?: ImageTemplateLastRunStatus; - buildTimeoutInMinutes?: number; - vmProfile?: ImageTemplateVmProfile; + readonly provisioningError?: ProvisioningError; + readonly provisioningState?: ProvisioningState; + source?: ImageTemplateSourceUnion; stagingResourceGroup?: string; - readonly exactStagingResourceGroup?: string; -}; + validate?: ImageTemplatePropertiesValidate; + vmProfile?: ImageTemplateVmProfile; +} // @public export interface ImageTemplateCustomizer { @@ -92,12 +92,12 @@ export interface ImageTemplateDistributor { export type ImageTemplateDistributorUnion = ImageTemplateDistributor | ImageTemplateManagedImageDistributor | ImageTemplateSharedImageDistributor | ImageTemplateVhdDistributor; // @public -export type ImageTemplateFileCustomizer = ImageTemplateCustomizer & { - type: "File"; - sourceUri?: string; - sha256Checksum?: string; +export interface ImageTemplateFileCustomizer extends ImageTemplateCustomizer { destination?: string; -}; + sha256Checksum?: string; + sourceUri?: string; + type: "File"; +} // @public export interface ImageTemplateIdentity { @@ -132,50 +132,50 @@ export interface ImageTemplateListResult { } // @public -export type ImageTemplateManagedImageDistributor = ImageTemplateDistributor & { - type: "ManagedImage"; +export interface ImageTemplateManagedImageDistributor extends ImageTemplateDistributor { imageId: string; location: string; -}; + type: "ManagedImage"; +} // @public -export type ImageTemplateManagedImageSource = ImageTemplateSource & { - type: "ManagedImage"; +export interface ImageTemplateManagedImageSource extends ImageTemplateSource { imageId: string; -}; + type: "ManagedImage"; +} // @public -export type ImageTemplatePlatformImageSource = ImageTemplateSource & { - type: "PlatformImage"; - publisher?: string; +export interface ImageTemplatePlatformImageSource extends ImageTemplateSource { + readonly exactVersion?: string; offer?: string; + planInfo?: PlatformImagePurchasePlan; + publisher?: string; sku?: string; + type: "PlatformImage"; version?: string; - readonly exactVersion?: string; - planInfo?: PlatformImagePurchasePlan; -}; +} // @public -export type ImageTemplatePowerShellCustomizer = ImageTemplateCustomizer & { - type: "PowerShell"; - scriptUri?: string; - sha256Checksum?: string; +export interface ImageTemplatePowerShellCustomizer extends ImageTemplateCustomizer { inline?: string[]; - runElevated?: boolean; runAsSystem?: boolean; + runElevated?: boolean; + scriptUri?: string; + sha256Checksum?: string; + type: "PowerShell"; validExitCodes?: number[]; -}; +} // @public -export type ImageTemplatePowerShellValidator = ImageTemplateInVMValidator & { - type: "PowerShell"; - scriptUri?: string; - sha256Checksum?: string; +export interface ImageTemplatePowerShellValidator extends ImageTemplateInVMValidator { inline?: string[]; - runElevated?: boolean; runAsSystem?: boolean; + runElevated?: boolean; + scriptUri?: string; + sha256Checksum?: string; + type: "PowerShell"; validExitCodes?: number[]; -}; +} // @public export interface ImageTemplatePropertiesValidate { @@ -185,43 +185,43 @@ export interface ImageTemplatePropertiesValidate { } // @public -export type ImageTemplateRestartCustomizer = ImageTemplateCustomizer & { - type: "WindowsRestart"; - restartCommand?: string; +export interface ImageTemplateRestartCustomizer extends ImageTemplateCustomizer { restartCheckCommand?: string; + restartCommand?: string; restartTimeout?: string; -}; + type: "WindowsRestart"; +} // @public -export type ImageTemplateSharedImageDistributor = ImageTemplateDistributor & { - type: "SharedImage"; +export interface ImageTemplateSharedImageDistributor extends ImageTemplateDistributor { + excludeFromLatest?: boolean; galleryImageId: string; replicationRegions: string[]; - excludeFromLatest?: boolean; storageAccountType?: SharedImageStorageAccountType; -}; + type: "SharedImage"; +} // @public -export type ImageTemplateSharedImageVersionSource = ImageTemplateSource & { - type: "SharedImageVersion"; +export interface ImageTemplateSharedImageVersionSource extends ImageTemplateSource { imageVersionId: string; -}; + type: "SharedImageVersion"; +} // @public -export type ImageTemplateShellCustomizer = ImageTemplateCustomizer & { - type: "Shell"; +export interface ImageTemplateShellCustomizer extends ImageTemplateCustomizer { + inline?: string[]; scriptUri?: string; sha256Checksum?: string; - inline?: string[]; -}; + type: "Shell"; +} // @public -export type ImageTemplateShellValidator = ImageTemplateInVMValidator & { - type: "Shell"; +export interface ImageTemplateShellValidator extends ImageTemplateInVMValidator { + inline?: string[]; scriptUri?: string; sha256Checksum?: string; - inline?: string[]; -}; + type: "Shell"; +} // @public export interface ImageTemplateSource { @@ -240,9 +240,9 @@ export interface ImageTemplateUpdateParameters { } // @public -export type ImageTemplateVhdDistributor = ImageTemplateDistributor & { +export interface ImageTemplateVhdDistributor extends ImageTemplateDistributor { type: "VHD"; -}; +} // @public export interface ImageTemplateVmProfile { @@ -253,64 +253,43 @@ export interface ImageTemplateVmProfile { } // @public -export type ImageTemplateWindowsUpdateCustomizer = ImageTemplateCustomizer & { - type: "WindowsUpdate"; - searchCriteria?: string; +export interface ImageTemplateWindowsUpdateCustomizer extends ImageTemplateCustomizer { filters?: string[]; + searchCriteria?: string; + type: "WindowsUpdate"; updateLimit?: number; -}; +} // @public export enum KnownCreatedByType { - // (undocumented) Application = "Application", - // (undocumented) Key = "Key", - // (undocumented) ManagedIdentity = "ManagedIdentity", - // (undocumented) User = "User" } // @public export enum KnownProvisioningErrorCode { - // (undocumented) BadCustomizerType = "BadCustomizerType", - // (undocumented) BadDistributeType = "BadDistributeType", - // (undocumented) BadManagedImageSource = "BadManagedImageSource", - // (undocumented) BadPIRSource = "BadPIRSource", - // (undocumented) BadSharedImageDistribute = "BadSharedImageDistribute", - // (undocumented) BadSharedImageVersionSource = "BadSharedImageVersionSource", - // (undocumented) BadSourceType = "BadSourceType", - // (undocumented) BadStagingResourceGroup = "BadStagingResourceGroup", - // (undocumented) BadValidatorType = "BadValidatorType", - // (undocumented) NoCustomizerScript = "NoCustomizerScript", - // (undocumented) NoValidatorScript = "NoValidatorScript", - // (undocumented) Other = "Other", - // (undocumented) ServerError = "ServerError", - // (undocumented) UnsupportedCustomizerType = "UnsupportedCustomizerType", - // (undocumented) UnsupportedValidatorType = "UnsupportedValidatorType" } // @public export enum KnownSharedImageStorageAccountType { - // (undocumented) StandardLRS = "Standard_LRS", - // (undocumented) StandardZRS = "Standard_ZRS" } @@ -376,7 +355,8 @@ export type ProvisioningErrorCode = string; export type ProvisioningState = "Creating" | "Updating" | "Succeeded" | "Failed" | "Deleting"; // @public -export type ProxyResource = Resource; +export interface ProxyResource extends Resource { +} // @public export interface Resource { @@ -390,11 +370,11 @@ export interface Resource { export type ResourceIdentityType = "UserAssigned" | "None"; // @public -export type RunOutput = ProxyResource & { +export interface RunOutput extends ProxyResource { artifactId?: string; artifactUri?: string; readonly provisioningState?: ProvisioningState; -}; +} // @public export interface RunOutputCollection { @@ -422,12 +402,12 @@ export interface SystemData { } // @public -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { + location: string; tags?: { [propertyName: string]: string; }; - location: string; -}; +} // @public export interface VirtualMachineImageTemplates { diff --git a/sdk/imagebuilder/arm-imagebuilder/src/imageBuilderClient.ts b/sdk/imagebuilder/arm-imagebuilder/src/imageBuilderClient.ts index f35722f89c97..f223f89ba1ad 100644 --- a/sdk/imagebuilder/arm-imagebuilder/src/imageBuilderClient.ts +++ b/sdk/imagebuilder/arm-imagebuilder/src/imageBuilderClient.ts @@ -54,7 +54,7 @@ export class ImageBuilderClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-imagebuilder/2.0.1`; + const packageDetails = `azsdk-js-arm-imagebuilder/2.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -124,7 +124,7 @@ export class ImageBuilderClient extends coreClient.ServiceClient { if (param.length > 1) { const newParams = param[1].split("&").map((item) => { if (item.indexOf("api-version") > -1) { - return item.replace(/(?<==).*$/, apiVersion); + return "api-version=" + apiVersion; } else { return item; } diff --git a/sdk/imagebuilder/arm-imagebuilder/src/models/index.ts b/sdk/imagebuilder/arm-imagebuilder/src/models/index.ts index 59b8da1db0e5..1b6ae1ffd9e8 100644 --- a/sdk/imagebuilder/arm-imagebuilder/src/models/index.ts +++ b/sdk/imagebuilder/arm-imagebuilder/src/models/index.ts @@ -235,7 +235,7 @@ export interface Operation { display?: OperationDisplay; /** The intended executor of the operation. */ origin?: string; - /** Any object */ + /** Properties of the operation. */ properties?: Record; /** The flag that indicates whether the operation applies to data plane. */ isDataAction?: boolean; @@ -264,7 +264,7 @@ export interface PlatformImagePurchasePlan { } /** Describes an image source from [Azure Gallery Images](https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages). */ -export type ImageTemplatePlatformImageSource = ImageTemplateSource & { +export interface ImageTemplatePlatformImageSource extends ImageTemplateSource { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "PlatformImage"; /** Image Publisher in [Azure Gallery Images](https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages). */ @@ -282,26 +282,27 @@ export type ImageTemplatePlatformImageSource = ImageTemplateSource & { readonly exactVersion?: string; /** Optional configuration of purchase plan for platform image. */ planInfo?: PlatformImagePurchasePlan; -}; +} /** Describes an image source that is a managed image in customer subscription. This image must reside in the same subscription and region as the Image Builder template. */ -export type ImageTemplateManagedImageSource = ImageTemplateSource & { +export interface ImageTemplateManagedImageSource extends ImageTemplateSource { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "ManagedImage"; /** ARM resource id of the managed image in customer subscription */ imageId: string; -}; +} /** Describes an image source that is an image version in a shared image gallery. */ -export type ImageTemplateSharedImageVersionSource = ImageTemplateSource & { +export interface ImageTemplateSharedImageVersionSource + extends ImageTemplateSource { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "SharedImageVersion"; /** ARM resource id of the image version in the shared image gallery */ imageVersionId: string; -}; +} /** Runs a shell script during the customization phase (Linux). Corresponds to Packer shell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified. */ -export type ImageTemplateShellCustomizer = ImageTemplateCustomizer & { +export interface ImageTemplateShellCustomizer extends ImageTemplateCustomizer { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "Shell"; /** URI of the shell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc */ @@ -310,10 +311,11 @@ export type ImageTemplateShellCustomizer = ImageTemplateCustomizer & { sha256Checksum?: string; /** Array of shell commands to execute */ inline?: string[]; -}; +} /** Reboots a VM and waits for it to come back online (Windows). Corresponds to Packer windows-restart provisioner */ -export type ImageTemplateRestartCustomizer = ImageTemplateCustomizer & { +export interface ImageTemplateRestartCustomizer + extends ImageTemplateCustomizer { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "WindowsRestart"; /** Command to execute the restart [Default: 'shutdown /r /f /t 0 /c "packer restart"'] */ @@ -322,10 +324,11 @@ export type ImageTemplateRestartCustomizer = ImageTemplateCustomizer & { restartCheckCommand?: string; /** Restart timeout specified as a string of magnitude and unit, e.g. '5m' (5 minutes) or '2h' (2 hours) [Default: '5m'] */ restartTimeout?: string; -}; +} /** Installs Windows Updates. Corresponds to Packer Windows Update Provisioner (https://github.com/rgl/packer-provisioner-windows-update) */ -export type ImageTemplateWindowsUpdateCustomizer = ImageTemplateCustomizer & { +export interface ImageTemplateWindowsUpdateCustomizer + extends ImageTemplateCustomizer { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "WindowsUpdate"; /** Criteria to search updates. Omit or specify empty string to use the default (search all). Refer to above link for examples and detailed description of this field. */ @@ -334,10 +337,11 @@ export type ImageTemplateWindowsUpdateCustomizer = ImageTemplateCustomizer & { filters?: string[]; /** Maximum number of updates to apply at a time. Omit or specify 0 to use the default (1000) */ updateLimit?: number; -}; +} /** Runs the specified PowerShell on the VM (Windows). Corresponds to Packer powershell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified. */ -export type ImageTemplatePowerShellCustomizer = ImageTemplateCustomizer & { +export interface ImageTemplatePowerShellCustomizer + extends ImageTemplateCustomizer { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "PowerShell"; /** URI of the PowerShell script to be run for customizing. It can be a github link, SAS URI for Azure Storage, etc */ @@ -352,10 +356,10 @@ export type ImageTemplatePowerShellCustomizer = ImageTemplateCustomizer & { runAsSystem?: boolean; /** Valid exit codes for the PowerShell script. [Default: 0] */ validExitCodes?: number[]; -}; +} /** Uploads files to VMs (Linux, Windows). Corresponds to Packer file provisioner */ -export type ImageTemplateFileCustomizer = ImageTemplateCustomizer & { +export interface ImageTemplateFileCustomizer extends ImageTemplateCustomizer { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "File"; /** The URI of the file to be uploaded for customizing the VM. It can be a github link, SAS URI for Azure Storage, etc */ @@ -364,10 +368,11 @@ export type ImageTemplateFileCustomizer = ImageTemplateCustomizer & { sha256Checksum?: string; /** The absolute path to a file (with nested directory structures already created) where the file (from sourceUri) will be uploaded to in the VM */ destination?: string; -}; +} /** Runs the specified shell script during the validation phase (Linux). Corresponds to Packer shell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified. */ -export type ImageTemplateShellValidator = ImageTemplateInVMValidator & { +export interface ImageTemplateShellValidator + extends ImageTemplateInVMValidator { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "Shell"; /** URI of the shell script to be run for validation. It can be a github link, Azure Storage URI, etc */ @@ -376,10 +381,11 @@ export type ImageTemplateShellValidator = ImageTemplateInVMValidator & { sha256Checksum?: string; /** Array of shell commands to execute */ inline?: string[]; -}; +} /** Runs the specified PowerShell script during the validation phase (Windows). Corresponds to Packer powershell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified. */ -export type ImageTemplatePowerShellValidator = ImageTemplateInVMValidator & { +export interface ImageTemplatePowerShellValidator + extends ImageTemplateInVMValidator { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "PowerShell"; /** URI of the PowerShell script to be run for validation. It can be a github link, Azure Storage URI, etc */ @@ -394,20 +400,22 @@ export type ImageTemplatePowerShellValidator = ImageTemplateInVMValidator & { runAsSystem?: boolean; /** Valid exit codes for the PowerShell script. [Default: 0] */ validExitCodes?: number[]; -}; +} /** Distribute as a Managed Disk Image. */ -export type ImageTemplateManagedImageDistributor = ImageTemplateDistributor & { +export interface ImageTemplateManagedImageDistributor + extends ImageTemplateDistributor { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "ManagedImage"; /** Resource Id of the Managed Disk Image */ imageId: string; /** Azure location for the image, should match if image already exists */ location: string; -}; +} /** Distribute via Shared Image Gallery. */ -export type ImageTemplateSharedImageDistributor = ImageTemplateDistributor & { +export interface ImageTemplateSharedImageDistributor + extends ImageTemplateDistributor { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "SharedImage"; /** Resource Id of the Shared Image Gallery image */ @@ -418,27 +426,27 @@ export type ImageTemplateSharedImageDistributor = ImageTemplateDistributor & { excludeFromLatest?: boolean; /** Storage account type to be used to store the shared image. Omit to use the default (Standard_LRS). */ storageAccountType?: SharedImageStorageAccountType; -}; +} /** Distribute via VHD in a storage account. */ -export type ImageTemplateVhdDistributor = ImageTemplateDistributor & { +export interface ImageTemplateVhdDistributor extends ImageTemplateDistributor { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "VHD"; -}; +} /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { /** Resource tags. */ tags?: { [propertyName: string]: string }; /** The geo-location where the resource lives */ location: string; -}; +} /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export type ProxyResource = Resource; +export interface ProxyResource extends Resource {} /** Image template is an ARM resource managed by Microsoft.VirtualMachineImages provider */ -export type ImageTemplate = TrackedResource & { +export interface ImageTemplate extends TrackedResource { /** The identity of the image template, if configured. */ identity: ImageTemplateIdentity; /** Specifies the properties used to describe the source image. */ @@ -475,10 +483,10 @@ export type ImageTemplate = TrackedResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly exactStagingResourceGroup?: string; -}; +} /** Represents an output that was created by running an image template. */ -export type RunOutput = ProxyResource & { +export interface RunOutput extends ProxyResource { /** The resource id of the artifact. */ artifactId?: string; /** The location URI of the artifact. */ @@ -488,24 +496,39 @@ export type RunOutput = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; -}; +} /** Known values of {@link ProvisioningErrorCode} that the service accepts. */ export enum KnownProvisioningErrorCode { + /** BadSourceType */ BadSourceType = "BadSourceType", + /** BadPIRSource */ BadPIRSource = "BadPIRSource", + /** BadManagedImageSource */ BadManagedImageSource = "BadManagedImageSource", + /** BadSharedImageVersionSource */ BadSharedImageVersionSource = "BadSharedImageVersionSource", + /** BadCustomizerType */ BadCustomizerType = "BadCustomizerType", + /** UnsupportedCustomizerType */ UnsupportedCustomizerType = "UnsupportedCustomizerType", + /** NoCustomizerScript */ NoCustomizerScript = "NoCustomizerScript", + /** BadValidatorType */ BadValidatorType = "BadValidatorType", + /** UnsupportedValidatorType */ UnsupportedValidatorType = "UnsupportedValidatorType", + /** NoValidatorScript */ NoValidatorScript = "NoValidatorScript", + /** BadDistributeType */ BadDistributeType = "BadDistributeType", + /** BadSharedImageDistribute */ BadSharedImageDistribute = "BadSharedImageDistribute", + /** BadStagingResourceGroup */ BadStagingResourceGroup = "BadStagingResourceGroup", + /** ServerError */ ServerError = "ServerError", + /** Other */ Other = "Other" } @@ -534,9 +557,13 @@ export type ProvisioningErrorCode = string; /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { + /** User */ User = "User", + /** Application */ Application = "Application", + /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", + /** Key */ Key = "Key" } @@ -554,7 +581,9 @@ export type CreatedByType = string; /** Known values of {@link SharedImageStorageAccountType} that the service accepts. */ export enum KnownSharedImageStorageAccountType { + /** StandardLRS */ StandardLRS = "Standard_LRS", + /** StandardZRS */ StandardZRS = "Standard_ZRS" } diff --git a/sdk/imagebuilder/arm-imagebuilder/test/sampleTest.ts b/sdk/imagebuilder/arm-imagebuilder/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/imagebuilder/arm-imagebuilder/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/imagebuilder/arm-imagebuilder/tsconfig.json b/sdk/imagebuilder/arm-imagebuilder/tsconfig.json index 685d3a99e92a..3e6ae96443f3 100644 --- a/sdk/imagebuilder/arm-imagebuilder/tsconfig.json +++ b/sdk/imagebuilder/arm-imagebuilder/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-imagebuilder": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"