Skip to content

Commit

Permalink
CodeGen from PR 31527 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 6d3e3f138bef146d09e2a331b92e8c517032fbcb into e838027e88cca634c1545e744630de9262a6e72a
  • Loading branch information
SDKAuto committed Nov 18, 2024
1 parent 43142d2 commit 9e66221
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 104 deletions.
9 changes: 6 additions & 3 deletions common/config/rush/pnpm-lock.yaml

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

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": "71672e845eba644312dbfa6f44d3a6a5993a635b",
"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].16",
"use": "@autorest/typescript@^6.0.12"
}
66 changes: 30 additions & 36 deletions sdk/batch/arm-batch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"node": ">=18.0.0"
},
"dependencies": {
"@azure/abort-controller": "^2.1.2",
"@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,22 @@
"module": "./dist-esm/src/index.js",
"types": "./types/arm-batch.d.ts",
"devDependencies": {
"@azure-tools/test-credential": "^1.1.0",
"@azure-tools/test-recorder": "^3.0.0",
"@azure/arm-storage": "^18.0.0",
"@microsoft/api-extractor": "^7.31.1",
"typescript": "~5.6.2",
"uglify-js": "^3.4.9",
"dotenv": "^16.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/identity": "^4.2.1",
"@types/chai": "^4.2.8",
"@types/mocha": "^10.0.0",
"@types/node": "^18.0.0",
"chai": "^4.2.0",
"dotenv": "^16.0.0",
"@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",
"cross-env": "^7.0.2",
"@types/node": "^18.0.0",
"ts-node": "^10.0.0"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -69,28 +71,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": "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:node": "cross-env TEST_MODE=playback npm run integration-test:node",
"unit-test:browser": "echo skipped",
"unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node",
"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 +105,5 @@
]
},
"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"
}
}
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch"
}
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.
4 changes: 2 additions & 2 deletions sdk/batch/arm-batch/src/models/index.ts
Original file line number Diff line number Diff line change
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://docs.microsoft.com/en-us/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
84 changes: 42 additions & 42 deletions sdk/batch/arm-batch/src/operations/batchAccountOperations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations {
* you must make sure your network allows outbound access to these endpoints. Failure to allow access
* to these endpoints may cause Batch to mark the affected nodes as unusable. For more information
* about creating a pool inside of a virtual network, see
* https://docs.microsoft.com/azure/batch/batch-virtual-network.
* https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network.
* @param resourceGroupName The name of the resource group that contains the Batch account.
* @param accountName The name of the Batch account.
* @param options The options parameters.
Expand Down Expand Up @@ -715,7 +715,7 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations {
* you must make sure your network allows outbound access to these endpoints. Failure to allow access
* to these endpoints may cause Batch to mark the affected nodes as unusable. For more information
* about creating a pool inside of a virtual network, see
* https://docs.microsoft.com/azure/batch/batch-virtual-network.
* https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network.
* @param resourceGroupName The name of the resource group that contains the Batch account.
* @param accountName The name of the Batch account.
* @param options The options parameters.
Expand Down Expand Up @@ -1046,27 +1046,27 @@ const getDetectorOperationSpec: coreClient.OperationSpec = {
serializer,
};
const listOutboundNetworkDependenciesEndpointsOperationSpec: coreClient.OperationSpec =
{
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.OutboundEnvironmentEndpointCollection,
},
default: {
bodyMapper: Mappers.CloudError,
{
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.OutboundEnvironmentEndpointCollection,
},
default: {
bodyMapper: Mappers.CloudError,
},
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.subscriptionId,
Parameters.accountName1,
],
headerParameters: [Parameters.accept],
serializer,
};
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.subscriptionId,
Parameters.accountName1,
],
headerParameters: [Parameters.accept],
serializer,
};
const listNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
Expand Down Expand Up @@ -1128,24 +1128,24 @@ const listDetectorsNextOperationSpec: coreClient.OperationSpec = {
serializer,
};
const listOutboundNetworkDependenciesEndpointsNextOperationSpec: coreClient.OperationSpec =
{
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.OutboundEnvironmentEndpointCollection,
},
default: {
bodyMapper: Mappers.CloudError,
{
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.OutboundEnvironmentEndpointCollection,
},
default: {
bodyMapper: Mappers.CloudError,
},
},
},
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.subscriptionId,
Parameters.accountName1,
Parameters.nextLink,
],
headerParameters: [Parameters.accept],
serializer,
};
urlParameters: [
Parameters.$host,
Parameters.resourceGroupName,
Parameters.subscriptionId,
Parameters.accountName1,
Parameters.nextLink,
],
headerParameters: [Parameters.accept],
serializer,
};
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export interface BatchAccountOperations {
* you must make sure your network allows outbound access to these endpoints. Failure to allow access
* to these endpoints may cause Batch to mark the affected nodes as unusable. For more information
* about creating a pool inside of a virtual network, see
* https://docs.microsoft.com/azure/batch/batch-virtual-network.
* https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network.
* @param resourceGroupName The name of the resource group that contains the Batch account.
* @param accountName The name of the Batch account.
* @param options The options parameters.
Expand Down
43 changes: 43 additions & 0 deletions sdk/batch/arm-batch/test/sampleTest.ts
Original file line number Diff line number Diff line change
@@ -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<string, string> = {
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!");
});
});
12 changes: 3 additions & 9 deletions sdk/batch/arm-batch/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,11 @@
],
"declaration": true,
"outDir": "./dist-esm",
"importHelpers": true,
"paths": {
"@azure/arm-batch": [
"./src/index"
]
}
"importHelpers": true
},
"include": [
"./src/**/*.ts",
"./test/**/*.ts",
"samples-dev/**/*.ts"
"src/**/*.ts",
"test/**/*.ts"
],
"exclude": [
"node_modules"
Expand Down
Loading

0 comments on commit 9e66221

Please sign in to comment.