diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index e2ac4a887b9b..8098dac1ecc5 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -13366,23 +13366,26 @@ packages: dev: false file:projects/arm-batch.tgz: - resolution: {integrity: sha512-l71U4B8PypyscPdpEk6BSRA0kLTanf4kg/yLBZkpp+vRVwwWTuX/0li16uGOGqrC+iqlN2msnCwqWNjVOtBE/w==, tarball: file:projects/arm-batch.tgz} + resolution: {integrity: sha512-orkls+0mwe9B4cNxQ4QG/7V8BIhsxjB/bL3nhqhvaxwswuX3BW/EHvg9ffdo6roRRLQ2B71Vtpx9yZBRItMEnw==, tarball: file:projects/arm-batch.tgz} name: '@rush-temp/arm-batch' version: 0.0.0 dependencies: '@azure-tools/test-credential': 1.3.1 '@azure-tools/test-recorder': 3.5.2 '@azure/core-lro': 2.7.2 + '@microsoft/api-extractor': 7.47.11(@types/node@18.19.64) '@types/chai': 4.3.20 '@types/mocha': 10.0.9 '@types/node': 18.19.64 chai: 4.3.10 + cross-env: 7.0.3 dotenv: 16.4.5 mocha: 10.8.2 ts-node: 10.9.2(@types/node@18.19.64)(typescript@5.6.3) tslib: 2.8.1 tsx: 4.19.2 typescript: 5.6.3 + uglify-js: 3.19.3 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' @@ -15416,7 +15419,7 @@ packages: dev: false file:projects/arm-hybridcompute.tgz: - resolution: {integrity: sha512-+DX7eIMt7WAbn6AD+QZpjVyoMuXdNpGH452FuoUH2UvFhOBtlZD3B5y8bwW/oE8d3E/u2eZ3B4N2cAFV32bgbw==, tarball: file:projects/arm-hybridcompute.tgz} + resolution: {integrity: sha512-IxFMCCeH0D2P6u+4Vwi9ROrWBKeO0DJEfs2jxyfJnrGNMrRKAWfplx0QVZY6ETK5Thjlm3myTMffxO2BT5PBiA==, tarball: file:projects/arm-hybridcompute.tgz} name: '@rush-temp/arm-hybridcompute' version: 0.0.0 dependencies: @@ -19240,7 +19243,7 @@ packages: dev: false file:projects/communication-job-router.tgz: - resolution: {integrity: sha512-xPt7oEFIEnDcZHXkEsgPlaOBwbjSF6dQq4uDtXsp/yeslQgiTdGNnO5bUMfuqpTTiiwSsXCyCKEy2FmmrcRHLw==, tarball: file:projects/communication-job-router.tgz} + resolution: {integrity: sha512-2asWr03USbfs287ufZkj8sgX94e8AIkX8BU9mVvBxqPp+5NwM8F2I2OeKa/ZRb9z7dcawliux8IwyB2kNGIEAg==, tarball: file:projects/communication-job-router.tgz} name: '@rush-temp/communication-job-router' version: 0.0.0 dependencies: diff --git a/sdk/batch/arm-batch/_meta.json b/sdk/batch/arm-batch/_meta.json index b313aeadc281..2c36b2761314 100644 --- a/sdk/batch/arm-batch/_meta.json +++ b/sdk/batch/arm-batch/_meta.json @@ -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/typescript@6.0.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/js-sdk-release-tools@2.7.12", - "use": "@autorest/typescript@6.0.27" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/batch/arm-batch/package.json b/sdk/batch/arm-batch/package.json index ae252aa07e74..f64adf33021c 100644 --- a/sdk/batch/arm-batch/package.json +++ b/sdk/batch/arm-batch/package.json @@ -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" }, @@ -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", @@ -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, @@ -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" +} \ No newline at end of file diff --git a/sdk/batch/arm-batch/sample.env b/sdk/batch/arm-batch/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/batch/arm-batch/sample.env +++ b/sdk/batch/arm-batch/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/batch/arm-batch/src/models/index.ts b/sdk/batch/arm-batch/src/models/index.ts index 2378f28b57ea..60c69d5f97e9 100644 --- a/sdk/batch/arm-batch/src/models/index.ts +++ b/sdk/batch/arm-batch/src/models/index.ts @@ -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; @@ -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; diff --git a/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts b/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts index f20ea46f8698..b7b7eedac253 100644 --- a/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts +++ b/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts @@ -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. @@ -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. @@ -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", @@ -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, + }; diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts index 51b0b03865a8..973966fb8a00 100644 --- a/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts +++ b/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts @@ -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. diff --git a/sdk/batch/arm-batch/test/sampleTest.ts b/sdk/batch/arm-batch/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/batch/arm-batch/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/batch/arm-batch/tsconfig.json b/sdk/batch/arm-batch/tsconfig.json index 0e82052bd8fa..b35d05ad6e9d 100644 --- a/sdk/batch/arm-batch/tsconfig.json +++ b/sdk/batch/arm-batch/tsconfig.json @@ -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" diff --git a/sdk/batch/ci.yml b/sdk/batch/ci.yml index 7295c390487e..b27059362245 100644 --- a/sdk/batch/ci.yml +++ b/sdk/batch/ci.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -11,7 +11,9 @@ trigger: include: - sdk/batch/ci.yml - sdk/batch/batch-rest - + exclude: + - sdk/batch/arm-batch + - sdk/batch/ci.mgmt.yml pr: branches: include: @@ -24,7 +26,9 @@ pr: include: - sdk/batch/ci.yml - sdk/batch/batch-rest - + exclude: + - sdk/batch/arm-batch + - sdk/batch/ci.mgmt.yml extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: