Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ReleasePR @azure/arm-imagebuilder] [API 2023-07-01 Update] Fixing distribute in ImageTemplateUpdateParameters #21972

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions sdk/imagebuilder/arm-imagebuilder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
# Release History

## 2.0.0 (2022-05-24)

**Features**

## 1.0.3 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

- Added Interface ImageTemplateInVMValidator
- Added Interface ImageTemplatePropertiesValidate
- Added Type Alias ImageTemplateInVMValidatorUnion
- Added Type Alias ImageTemplatePowerShellValidator
- Added Type Alias ImageTemplateShellValidator
- Added Type Alias ProxyResource
- Interface Resource has a new optional parameter systemData
- Add parameters of ProxyResource to TypeAlias RunOutput
- Type Alias ImageTemplate has a new parameter validate
- Type Alias ImageTemplate has a new parameter stagingResourceGroup
- Type Alias ImageTemplate has a new parameter exactStagingResourceGroup
- Enum KnownProvisioningErrorCode has a new value BadStagingResourceGroup
- Enum KnownProvisioningErrorCode has a new value BadValidatorType
- Enum KnownProvisioningErrorCode has a new value NoValidatorScript
- Enum KnownProvisioningErrorCode has a new value UnsupportedValidatorType

**Breaking Changes**

- Delete parameters of SubResource in TypeAlias RunOutput
- Type Alias ImageTemplate no longer has parameter systemData

## 1.0.2 (2022-04-26)

**Features**
Expand Down
10 changes: 5 additions & 5 deletions sdk/imagebuilder/arm-imagebuilder/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "1f1d5b0b9ce6cc94605b2fd619dce374fb6e033a",
"readme": "specification\\frontdoor\\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:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\frontdoor\\resource-manager\\readme.md --use=@autorest/[email protected].20220408.1 --generate-sample=true",
"commit": "9f3ac7b135ac83007b7f3f68ca8ca9705284cff9",
"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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/imagebuilder/resource-manager/readme.md --use=@autorest/[email protected].20220425.1",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.2.6",
"use": "@autorest/[email protected].20220408.1"
"release_tool": "@azure-tools/js-sdk-release-tools@2.3.0",
"use": "@autorest/[email protected].20220425.1"
}
23 changes: 7 additions & 16 deletions sdk/imagebuilder/arm-imagebuilder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for ImageBuilderClient.",
"version": "1.0.3",
"version": "2.0.0",
"engines": {
"node": ">=12.0.0"
},
Expand Down Expand Up @@ -40,12 +40,11 @@
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^1.0.0",
"@azure-tools/test-recorder": "^2.0.0",
"@azure-tools/test-credential": "^1.0.0",
"mocha": "^7.1.1",
"cross-env": "^7.0.2",
"@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": {
Expand Down Expand Up @@ -96,7 +95,7 @@
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
"unit-test:browser": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:browser": "echo skipped",
"docs": "echo skipped"
},
Expand All @@ -109,13 +108,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
}
64 changes: 53 additions & 11 deletions sdk/imagebuilder/arm-imagebuilder/review/arm-imagebuilder.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,17 @@ export interface ImageBuilderClientOptionalParams extends coreClient.ServiceClie
// @public
export type ImageTemplate = TrackedResource & {
identity: ImageTemplateIdentity;
readonly systemData?: SystemData;
source?: ImageTemplateSourceUnion;
customize?: ImageTemplateCustomizerUnion[];
validate?: ImageTemplatePropertiesValidate;
distribute?: ImageTemplateDistributorUnion[];
readonly provisioningState?: ProvisioningState;
readonly provisioningError?: ProvisioningError;
readonly lastRunStatus?: ImageTemplateLastRunStatus;
buildTimeoutInMinutes?: number;
vmProfile?: ImageTemplateVmProfile;
stagingResourceGroup?: string;
readonly exactStagingResourceGroup?: string;
};

// @public
Expand Down Expand Up @@ -105,6 +107,15 @@ export interface ImageTemplateIdentity {
};
}

// @public
export interface ImageTemplateInVMValidator {
name?: string;
type: "Shell" | "PowerShell";
}

// @public (undocumented)
export type ImageTemplateInVMValidatorUnion = ImageTemplateInVMValidator | ImageTemplateShellValidator | ImageTemplatePowerShellValidator;

// @public
export interface ImageTemplateLastRunStatus {
endTime?: Date;
Expand Down Expand Up @@ -155,6 +166,24 @@ export type ImageTemplatePowerShellCustomizer = ImageTemplateCustomizer & {
validExitCodes?: number[];
};

// @public
export type ImageTemplatePowerShellValidator = ImageTemplateInVMValidator & {
type: "PowerShell";
scriptUri?: string;
sha256Checksum?: string;
inline?: string[];
runElevated?: boolean;
runAsSystem?: boolean;
validExitCodes?: number[];
};

// @public
export interface ImageTemplatePropertiesValidate {
continueDistributeOnFailure?: boolean;
inVMValidations?: ImageTemplateInVMValidatorUnion[];
sourceValidationOnly?: boolean;
}

// @public
export type ImageTemplateRestartCustomizer = ImageTemplateCustomizer & {
type: "WindowsRestart";
Expand Down Expand Up @@ -186,6 +215,14 @@ export type ImageTemplateShellCustomizer = ImageTemplateCustomizer & {
inline?: string[];
};

// @public
export type ImageTemplateShellValidator = ImageTemplateInVMValidator & {
type: "Shell";
scriptUri?: string;
sha256Checksum?: string;
inline?: string[];
};

// @public
export interface ImageTemplateSource {
type: "PlatformImage" | "ManagedImage" | "SharedImageVersion";
Expand Down Expand Up @@ -252,13 +289,21 @@ export enum KnownProvisioningErrorCode {
// (undocumented)
BadSourceType = "BadSourceType",
// (undocumented)
BadStagingResourceGroup = "BadStagingResourceGroup",
// (undocumented)
BadValidatorType = "BadValidatorType",
// (undocumented)
NoCustomizerScript = "NoCustomizerScript",
// (undocumented)
NoValidatorScript = "NoValidatorScript",
// (undocumented)
Other = "Other",
// (undocumented)
ServerError = "ServerError",
// (undocumented)
UnsupportedCustomizerType = "UnsupportedCustomizerType"
UnsupportedCustomizerType = "UnsupportedCustomizerType",
// (undocumented)
UnsupportedValidatorType = "UnsupportedValidatorType"
}

// @public
Expand Down Expand Up @@ -330,18 +375,22 @@ export type ProvisioningErrorCode = string;
// @public
export type ProvisioningState = "Creating" | "Updating" | "Succeeded" | "Failed" | "Deleting";

// @public
export type ProxyResource = Resource & {};

// @public
export interface Resource {
readonly id?: string;
readonly name?: string;
readonly systemData?: SystemData;
readonly type?: string;
}

// @public
export type ResourceIdentityType = "UserAssigned" | "None";

// @public
export type RunOutput = SubResource & {
export type RunOutput = ProxyResource & {
artifactId?: string;
artifactUri?: string;
readonly provisioningState?: ProvisioningState;
Expand All @@ -357,18 +406,11 @@ export interface RunOutputCollection {
export type RunState = "Running" | "Canceling" | "Succeeded" | "PartiallySucceeded" | "Failed" | "Canceled";

// @public
export type RunSubState = "Queued" | "Building" | "Customizing" | "Distributing";
export type RunSubState = "Queued" | "Building" | "Customizing" | "Validating" | "Distributing";

// @public
export type SharedImageStorageAccountType = string;

// @public
export interface SubResource {
readonly id?: string;
name: string;
readonly type?: string;
}

// @public
export interface SystemData {
createdAt?: Date;
Expand Down
38 changes: 36 additions & 2 deletions sdk/imagebuilder/arm-imagebuilder/src/imageBuilderClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

import * as coreClient from "@azure/core-client";
import * as coreRestPipeline from "@azure/core-rest-pipeline";
import {
PipelineRequest,
PipelineResponse,
SendRequest
} from "@azure/core-rest-pipeline";
import * as coreAuth from "@azure/core-auth";
import { VirtualMachineImageTemplatesImpl, OperationsImpl } from "./operations";
import {
Expand Down Expand Up @@ -49,7 +54,7 @@ export class ImageBuilderClient extends coreClient.ServiceClient {
credential: credentials
};

const packageDetails = `azsdk-js-arm-imagebuilder/1.0.3`;
const packageDetails = `azsdk-js-arm-imagebuilder/2.0.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand Down Expand Up @@ -96,11 +101,40 @@ export class ImageBuilderClient extends coreClient.ServiceClient {

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2021-10-01";
this.apiVersion = options.apiVersion || "2022-02-14";
this.virtualMachineImageTemplates = new VirtualMachineImageTemplatesImpl(
this
);
this.operations = new OperationsImpl(this);
this.addCustomApiVersionPolicy(options.apiVersion);
}

/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
private addCustomApiVersionPolicy(apiVersion?: string) {
if (!apiVersion) {
return;
}
const apiVersionPolicy = {
name: "CustomApiVersionPolicy",
async sendRequest(
request: PipelineRequest,
next: SendRequest
): Promise<PipelineResponse> {
const param = request.url.split("?");
if (param.length > 1) {
const newParams = param[1].split("&").map((item) => {
if (item.indexOf("api-version") > -1) {
return item.replace(/(?<==).*$/, apiVersion);
} else {
return item;
}
});
request.url = param[0] + "?" + newParams.join("&");
}
return next(request);
}
};
this.pipeline.addPolicy(apiVersionPolicy);
}

virtualMachineImageTemplates: VirtualMachineImageTemplates;
Expand Down
Loading