Skip to content

Commit

Permalink
CodeGen from PR 32069 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge b5338dd16d290d4b5f2d1c8314a587e4e1a70618 into 8a4eca6b060cf70da696963245656fdc440b666b
  • Loading branch information
SDKAuto committed Jan 9, 2025
1 parent f93ec86 commit 45570ed
Show file tree
Hide file tree
Showing 15 changed files with 148 additions and 113 deletions.
14 changes: 6 additions & 8 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/batch/arm-batch/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2024 Microsoft
Copyright (c) 2025 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
9 changes: 4 additions & 5 deletions sdk/batch/arm-batch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Batch Client

[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-batch) |
[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-batch) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-batch?view=azure-node-preview) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)

## Getting started
Expand Down Expand Up @@ -44,9 +44,8 @@ npm install @azure/identity
```

You will also need to **register a new AAD application and grant access to Azure BatchManagement** 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://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
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).

```javascript
const { BatchManagementClient } = require("@azure/arm-batch");
Expand All @@ -64,8 +63,8 @@ const client = new BatchManagementClient(new DefaultAzureCredential(), subscript
// const client = new BatchManagementClient(credential, subscriptionId);
```

### JavaScript Bundle

### JavaScript Bundle
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).

## Key concepts
Expand Down Expand Up @@ -101,7 +100,7 @@ If you'd like to contribute to this library, please read the [contributing guide

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fbatch%2Farm-batch%2FREADME.png)

[azure_cli]: https://learn.microsoft.com/cli/azure
[azure_cli]: https://docs.microsoft.com/cli/azure
[azure_sub]: https://azure.microsoft.com/free/
[azure_sub]: https://azure.microsoft.com/free/
[azure_portal]: https://portal.azure.com
Expand Down
8 changes: 4 additions & 4 deletions sdk/batch/arm-batch/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "3519c80fe510a268f6e59a29ccac8a53fdec15b6",
"commit": "54ee12bac25591f22a6d377baaaf2cfe9c6f7fce",
"readme": "specification/batch/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\\batch\\resource-manager\\readme.md --use=@autorest/[email protected].27 --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/batch/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].12",
"use": "@autorest/[email protected].27"
"release_tool": "@azure-tools/[email protected].18",
"use": "@autorest/typescript@^6.0.12"
}
6 changes: 3 additions & 3 deletions sdk/batch/arm-batch/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "dist/esm/index.d.ts",
"mainEntryPointFilePath": "./dist-esm/src/index.d.ts",
"docModel": {
"enabled": true
},
Expand All @@ -11,7 +11,7 @@
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "dist/arm-batch.d.ts"
"publicTrimmedFilePath": "./types/arm-batch.d.ts"
},
"messages": {
"tsdocMessageReporting": {
Expand All @@ -28,4 +28,4 @@
}
}
}
}
}
19 changes: 5 additions & 14 deletions sdk/batch/arm-batch/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 BatchManagementClient.",
"version": "10.0.1",
"version": "1.0.0-beta.1",
"engines": {
"node": ">=18.0.0"
},
Expand All @@ -25,13 +25,12 @@
],
"license": "MIT",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
"module": "./dist-esm/src/index.js",
"types": "./dist/commonjs/index.d.ts",
"devDependencies": {
"@azure-tools/test-credential": "^2.0.0",
"@azure-tools/test-recorder": "^4.1.0",
"@azure-tools/test-utils-vitest": "^1.0.0",
"@azure/arm-storage": "^18.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/identity": "^4.2.1",
"@types/node": "^18.0.0",
Expand All @@ -40,7 +39,7 @@
"dotenv": "^16.0.0",
"playwright": "^1.49.1",
"tsx": "^4.7.1",
"typescript": "~5.7.2",
"typescript": "~5.6.2",
"vitest": "^2.1.8"
},
"repository": {
Expand Down Expand Up @@ -79,7 +78,7 @@
"test:browser": "echo skipped",
"test:node": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "echo skipped",
"unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
"unit-test:node": "dev-tool run test:vitest",
"update-snippets": "echo skipped"
},
Expand All @@ -94,14 +93,6 @@
},
"autoPublish": true,
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch",
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-batch?view=azure-node-preview"
},
"type": "module",
"tshy": {
"project": "./tsconfig.src.json",
Expand Down Expand Up @@ -142,4 +133,4 @@
}
}
}
}
}
5 changes: 1 addition & 4 deletions sdk/batch/arm-batch/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/batch/arm-batch/src/batchManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class BatchManagementClient extends coreClient.ServiceClient {
credential: credentials,
};

const packageDetails = `azsdk-js-arm-batch/10.0.1`;
const packageDetails = `azsdk-js-arm-batch/1.0.0-beta.1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand Down
12 changes: 6 additions & 6 deletions sdk/batch/arm-batch/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ export interface ImageReference {
sku?: string;
/** A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. */
version?: string;
/** This property is mutually exclusive with other properties. The Azure Compute Gallery Image must have replicas in the same region as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. */
/** This property is mutually exclusive with other properties. The Azure Compute Gallery Image must have replicas in the same region as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. */
id?: string;
/** This property is mutually exclusive with other properties and can be fetched from shared gallery image GET call. */
sharedGalleryImageId?: string;
Expand Down Expand Up @@ -655,7 +655,7 @@ export interface OSDisk {

/** Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. */
export interface DiffDiskSettings {
/** This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. */
/** This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. */
placement?: "CacheDisk";
}

Expand Down Expand Up @@ -746,7 +746,7 @@ export interface AutoScaleRunError {

/** The network configuration for a pool. */
export interface NetworkConfiguration {
/** The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. Enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration */
/** The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication,including ports 29876 and 29877. Also enable outbound connections to Azure Storage on port 443. For more details see: https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration */
subnetId?: string;
/** The scope of dynamic vnet assignment. */
dynamicVnetAssignmentScope?: DynamicVNetAssignmentScope;
Expand All @@ -770,7 +770,7 @@ export interface InboundNatPool {
name: string;
/** The protocol of the endpoint. */
protocol: InboundEndpointProtocol;
/** This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. */
/** This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. */
backendPort: number;
/** Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. */
frontendPortRangeStart: number;
Expand Down Expand Up @@ -1054,7 +1054,7 @@ export interface UpgradePolicy {
export interface AutomaticOSUpgradePolicy {
/** Whether OS image rollback feature should be disabled. */
disableAutomaticRollback?: boolean;
/** Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchmanagement/pool/create?tabs=HTTP#windowsconfiguration) cannot be set to true. */
/** Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchmanagement/pool/create?tabs=HTTP#windowsconfiguration) cannot be set to true. */
enableAutomaticOSUpgrade?: boolean;
/** Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS. */
useRollingUpgradePolicy?: boolean;
Expand Down Expand Up @@ -1544,7 +1544,7 @@ export interface Pool extends AzureProxyResource {
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly allocationStateTransitionTime?: Date;
/** For information about available VM sizes, see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). */
/** For information about available VM sizes, see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). */
vmSize?: string;
/** Deployment configuration properties. */
deploymentConfiguration?: DeploymentConfiguration;
Expand Down
Loading

0 comments on commit 45570ed

Please sign in to comment.