Skip to content

Commit

Permalink
CodeGen from PR 31425 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge dd2aab91e9b782b620b1c9c4bf7b5df6c9ba294d into ca4642f6cddab6de445a69ae0f617c5ddab9c2d5
  • Loading branch information
SDKAuto committed Nov 29, 2024
1 parent 8009c43 commit 606df32
Show file tree
Hide file tree
Showing 12 changed files with 190 additions and 69 deletions.
21 changes: 11 additions & 10 deletions sdk/compute/arm-compute/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Release History

## 22.1.1 (Unreleased)

## 22.2.0 (2024-11-29)
### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

- Added Interface Placement
- Added Type Alias ZonePlacementPolicyType
- Interface StorageProfile has a new optional parameter alignRegionalDisksToVMZone
- Interface VirtualMachine has a new optional parameter placement
- Added Enum KnownZonePlacementPolicyType


## 22.1.0 (2024-08-12)

### Features Added
Expand Down Expand Up @@ -579,7 +580,7 @@

## 17.3.1 (2022-04-06)

### Features Added
**features**

- Bug fix

Expand Down
1 change: 0 additions & 1 deletion sdk/compute/arm-compute/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ npm install @azure/identity
```

You will also need to **register a new AAD application and grant access to Azure ComputeManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.

For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).

Expand Down
8 changes: 4 additions & 4 deletions sdk/compute/arm-compute/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "3cef1bf0125458cc60dfb9e644e6bc28b787beab",
"commit": "f858c60c83ddb0b647e6c4801d7f32e250fb8cc0",
"readme": "specification/compute/resource-manager/readme.md",
"autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\compute\\resource-manager\\readme.md --use=@autorest/[email protected].23 --generate-sample=true",
"autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/compute/resource-manager/readme.md --use=@autorest/typescript@^6.0.12",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/[email protected].11",
"use": "@autorest/[email protected].23"
"release_tool": "@azure-tools/[email protected].16",
"use": "@autorest/typescript@^6.0.12"
}
67 changes: 29 additions & 38 deletions sdk/compute/arm-compute/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for ComputeManagementClient.",
"version": "22.1.1",
"version": "22.2.0",
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-client": "^1.7.0",
"@azure/core-lro": "^2.5.4",
"@azure/abort-controller": "^2.1.2",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-rest-pipeline": "^1.14.0",
"tslib": "^2.2.0"
},
Expand All @@ -28,20 +28,19 @@
"module": "./dist-esm/src/index.js",
"types": "./types/arm-compute.d.ts",
"devDependencies": {
"@azure-tools/test-credential": "^1.1.0",
"@azure-tools/test-recorder": "^3.0.0",
"@azure/arm-network": "^32.2.0",
"@azure/dev-tool": "^1.0.0",
"@azure/identity": "^4.0.1",
"@types/chai": "^4.2.8",
"@types/mocha": "^10.0.0",
"@types/node": "^18.0.0",
"chai": "^4.2.0",
"typescript": "~5.6.2",
"dotenv": "^16.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/identity": "^4.2.1",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^1.1.0",
"mocha": "^10.0.0",
"ts-node": "^10.0.0",
"@types/mocha": "^10.0.0",
"tsx": "^4.7.1",
"typescript": "~5.6.2"
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"@types/node": "^18.0.0",
"ts-node": "^10.0.0"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -69,28 +68,28 @@
],
"scripts": {
"build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api",
"build:browser": "echo skipped",
"minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
"prepack": "npm run build",
"pack": "npm pack 2>&1",
"extract-api": "dev-tool run extract-api",
"lint": "echo skipped",
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:node": "echo skipped",
"build:samples": "echo skipped.",
"build:browser": "echo skipped",
"build:test": "echo skipped",
"build:samples": "echo skipped.",
"check-format": "echo skipped",
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"execute:samples": "echo skipped",
"extract-api": "dev-tool run extract-api",
"format": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "echo skipped",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"lint": "echo skipped",
"minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
"pack": "npm pack 2>&1",
"prepack": "npm run build",
"test": "npm run integration-test",
"test:browser": "echo skipped",
"test:node": "echo skipped",
"test:browser": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "echo skipped",
"unit-test:node": "dev-tool run vendored 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": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:browser": "echo skipped",
"update-snippets": "echo skipped"
},
"sideEffects": false,
Expand All @@ -103,13 +102,5 @@
]
},
"autoPublish": true,
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute",
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-compute?view=azure-node-preview"
}
}
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute"
}
17 changes: 17 additions & 0 deletions sdk/compute/arm-compute/review/arm-compute.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4063,6 +4063,11 @@ export enum KnownZonalPlatformFaultDomainAlignMode {
Unaligned = "Unaligned"
}

// @public
export enum KnownZonePlacementPolicyType {
Any = "Any"
}

// @public
export interface LastPatchInstallationSummary {
readonly error?: ApiError;
Expand Down Expand Up @@ -4459,6 +4464,13 @@ export interface PirSharedGalleryResource extends PirResource {
uniqueId?: string;
}

// @public
export interface Placement {
excludeZones?: string[];
includeZones?: string[];
zonePlacementPolicy?: ZonePlacementPolicyType;
}

// @public
export interface Plan {
name?: string;
Expand Down Expand Up @@ -5846,6 +5858,7 @@ export type StorageAccountTypes = string;

// @public
export interface StorageProfile {
alignRegionalDisksToVMZone?: boolean;
dataDisks?: DataDisk[];
diskControllerType?: DiskControllerTypes;
imageReference?: ImageReference;
Expand Down Expand Up @@ -6100,6 +6113,7 @@ export interface VirtualMachine extends Resource {
readonly managedBy?: string;
networkProfile?: NetworkProfile;
osProfile?: OSProfile;
placement?: Placement;
plan?: Plan;
platformFaultDomain?: number;
priority?: VirtualMachinePriorityTypes;
Expand Down Expand Up @@ -8387,6 +8401,9 @@ export interface WinRMListener {
// @public
export type ZonalPlatformFaultDomainAlignMode = string;

// @public
export type ZonePlacementPolicyType = string;

// (No @packageDocumentation comment for this package)

```
5 changes: 1 addition & 4 deletions sdk/compute/arm-compute/sample.env
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=
# Feel free to add your own environment variables.
2 changes: 1 addition & 1 deletion sdk/compute/arm-compute/src/computeManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class ComputeManagementClient extends coreClient.ServiceClient {
credential: credentials,
};

const packageDetails = `azsdk-js-arm-compute/22.1.1`;
const packageDetails = `azsdk-js-arm-compute/22.2.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand Down
31 changes: 30 additions & 1 deletion sdk/compute/arm-compute/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,8 @@ export interface StorageProfile {
dataDisks?: DataDisk[];
/** Specifies the disk controller type configured for the VM. **Note:** This property will be set to the default disk controller type if not specified provided virtual machine is being created with 'hyperVGeneration' set to V2 based on the capabilities of the operating system disk and VM size from the the specified minimum api version. You need to deallocate the VM before updating its disk controller type unless you are updating the VM size in the VM configuration which implicitly deallocates and reallocates the VM. Minimum api-version: 2022-08-01. */
diskControllerType?: DiskControllerTypes;
/** Specifies whether the regional disks should be aligned/moved to the VM zone. This is applicable only for VMs with placement property set. Please note that this change is irreversible. Minimum api-version: 2024-11-01. */
alignRegionalDisksToVMZone?: boolean;
}

/** Specifies information about the operating system disk used by the virtual machine. For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). */
Expand Down Expand Up @@ -1709,7 +1711,7 @@ export interface DataDisk {
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly diskMBpsReadWrite?: number;
/** Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. */
/** Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. */
detachOption?: DiskDetachOptionTypes;
/** Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**. */
deleteOption?: DiskDeleteOptionTypes;
Expand Down Expand Up @@ -2128,6 +2130,16 @@ export interface LastPatchInstallationSummary {
readonly error?: ApiError;
}

/** Describes the user-defined constraints for virtual machine hardware placement. */
export interface Placement {
/** Specifies the policy for virtual machine's placement in availability zone. Possible values are: **Any** - An availability zone will be automatically picked by system as part of virtual machine creation. */
zonePlacementPolicy?: ZonePlacementPolicyType;
/** This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any', availability zone selected by the system must be present in the list of availability zones passed with 'includeZones'. If 'includeZones' is not provided, all availability zones in region will be considered for selection. */
includeZones?: string[];
/** This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any', availability zone selected by the system must not be present in the list of availability zones passed with 'excludeZones'. If 'excludeZones' is not provided, all availability zones in region will be considered for selection. */
excludeZones?: string[];
}

/** Capture Virtual Machine parameters. */
export interface VirtualMachineCaptureParameters {
/** The captured virtual hard disk's name prefix. */
Expand Down Expand Up @@ -5363,6 +5375,8 @@ export interface VirtualMachine extends Resource {
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly etag?: string;
/** Placement section specifies the user-defined constraints for virtual machine hardware placement. This property cannot be changed once VM is provisioned. Minimum api-version: 2024-11-01. */
placement?: Placement;
/** Specifies the hardware settings for the virtual machine. */
hardwareProfile?: HardwareProfile;
/** Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the virtual machine. */
Expand Down Expand Up @@ -8313,6 +8327,21 @@ export enum KnownPatchOperationStatus {
*/
export type PatchOperationStatus = string;

/** Known values of {@link ZonePlacementPolicyType} that the service accepts. */
export enum KnownZonePlacementPolicyType {
/** Any */
Any = "Any",
}

/**
* Defines values for ZonePlacementPolicyType. \
* {@link KnownZonePlacementPolicyType} can be used interchangeably with ZonePlacementPolicyType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Any**
*/
export type ZonePlacementPolicyType = string;

/** Known values of {@link ExpandTypeForListVMs} that the service accepts. */
export enum KnownExpandTypeForListVMs {
/** InstanceView */
Expand Down
50 changes: 50 additions & 0 deletions sdk/compute/arm-compute/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4573,6 +4573,12 @@ export const StorageProfile: coreClient.CompositeMapper = {
name: "String",
},
},
alignRegionalDisksToVMZone: {
serializedName: "alignRegionalDisksToVMZone",
type: {
name: "Boolean",
},
},
},
},
};
Expand Down Expand Up @@ -5866,6 +5872,43 @@ export const LastPatchInstallationSummary: coreClient.CompositeMapper = {
},
};

export const Placement: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "Placement",
modelProperties: {
zonePlacementPolicy: {
serializedName: "zonePlacementPolicy",
type: {
name: "String",
},
},
includeZones: {
serializedName: "includeZones",
type: {
name: "Sequence",
element: {
type: {
name: "String",
},
},
},
},
excludeZones: {
serializedName: "excludeZones",
type: {
name: "Sequence",
element: {
type: {
name: "String",
},
},
},
},
},
},
};

export const VirtualMachineCaptureParameters: coreClient.CompositeMapper = {
type: {
name: "Composite",
Expand Down Expand Up @@ -13880,6 +13923,13 @@ export const VirtualMachine: coreClient.CompositeMapper = {
name: "String",
},
},
placement: {
serializedName: "placement",
type: {
name: "Composite",
className: "Placement",
},
},
hardwareProfile: {
serializedName: "properties.hardwareProfile",
type: {
Expand Down
2 changes: 1 addition & 1 deletion sdk/compute/arm-compute/src/models/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const $host: OperationURLParameter = {
export const apiVersion: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
defaultValue: "2024-07-01",
defaultValue: "2024-11-01",
isConstant: true,
serializedName: "api-version",
type: {
Expand Down
Loading

0 comments on commit 606df32

Please sign in to comment.