Skip to content
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
30 changes: 20 additions & 10 deletions sdk/batch/arm-batch/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
# Release History

## 7.2.0 (2022-07-05)

**Features**

## 7.1.2 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

- Added operation PrivateEndpointConnectionOperations.beginDelete
- Added operation PrivateEndpointConnectionOperations.beginDeleteAndWait
- Added Interface EndpointAccessProfile
- Added Interface IPRule
- Added Interface NetworkProfile
- Added Interface PrivateEndpointConnectionDeleteHeaders
- Added Interface PrivateEndpointConnectionDeleteOptionalParams
- Added Type Alias EndpointAccessDefaultAction
- Added Type Alias PrivateEndpointConnectionDeleteResponse
- Interface BatchAccountCreateParameters has a new optional parameter networkProfile
- Interface BatchAccountUpdateParameters has a new optional parameter networkProfile
- Interface BatchAccountUpdateParameters has a new optional parameter publicNetworkAccess
- Type Alias BatchAccount has a new parameter nodeManagementEndpoint
- Type Alias BatchAccount has a new parameter networkProfile
- Type Alias PrivateEndpointConnection has a new parameter groupIds

## 7.1.1 (2022-04-11)

**features**
Expand Down
10 changes: 5 additions & 5 deletions sdk/batch/arm-batch/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "4042a47cff72c950d35dd72149895b044ed79713",
"readme": "specification\\batch\\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\\batch\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.18.20220329.1 --generate-sample=true",
"commit": "2c233e25b552f7a367a453f2bc098e12f0fa39d4",
"readme": "specification/batch/resource-manager/readme.md",
"autorest_command": "autorest --version=3.7.3 --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.0-alpha.19.20220425.1",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.2.1",
"use": "@autorest/typescript@6.0.0-alpha.18.20220329.1"
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.0",
"use": "@autorest/typescript@6.0.0-alpha.19.20220425.1"
}
25 changes: 9 additions & 16 deletions sdk/batch/arm-batch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for BatchManagementClient.",
"version": "7.1.2",
"version": "7.2.0",
"engines": {
"node": ">=12.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.2.0",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.0.0",
"@azure/core-client": "^1.5.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.1.0",
"@azure/core-rest-pipeline": "^1.8.0",
"tslib": "^2.2.0"
},
"keywords": [
Expand All @@ -40,10 +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-storage": "^17.1.0"
"@azure/dev-tool": "^1.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch",
"repository": {
Expand Down Expand Up @@ -94,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 @@ -107,13 +108,5 @@
}
]
},
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-batch?view=azure-node-preview"
}
}
"autoPublish": true
}
50 changes: 47 additions & 3 deletions sdk/batch/arm-batch/review/arm-batch.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,12 @@ export interface AzureFileShareConfiguration {
export type BatchAccount = Resource & {
identity?: BatchAccountIdentity;
readonly accountEndpoint?: string;
readonly nodeManagementEndpoint?: string;
readonly provisioningState?: ProvisioningState;
readonly poolAllocationMode?: PoolAllocationMode;
readonly keyVaultReference?: KeyVaultReference;
readonly publicNetworkAccess?: PublicNetworkAccessType;
publicNetworkAccess?: PublicNetworkAccessType;
networkProfile?: NetworkProfile;
readonly privateEndpointConnections?: PrivateEndpointConnection[];
readonly autoStorage?: AutoStorageProperties;
readonly encryption?: EncryptionProperties;
Expand Down Expand Up @@ -252,6 +254,7 @@ export interface BatchAccountCreateParameters {
identity?: BatchAccountIdentity;
keyVaultReference?: KeyVaultReference;
location: string;
networkProfile?: NetworkProfile;
poolAllocationMode?: PoolAllocationMode;
publicNetworkAccess?: PublicNetworkAccessType;
tags?: {
Expand Down Expand Up @@ -418,6 +421,8 @@ export interface BatchAccountUpdateParameters {
autoStorage?: AutoStorageBaseProperties;
encryption?: EncryptionProperties;
identity?: BatchAccountIdentity;
networkProfile?: NetworkProfile;
publicNetworkAccess?: PublicNetworkAccessType;
tags?: {
[propertyName: string]: string;
};
Expand Down Expand Up @@ -765,6 +770,15 @@ export interface EncryptionProperties {
keyVaultProperties?: KeyVaultProperties;
}

// @public
export type EndpointAccessDefaultAction = "Allow" | "Deny";

// @public
export interface EndpointAccessProfile {
defaultAction: EndpointAccessDefaultAction;
ipRules?: IPRule[];
}

// @public
export interface EndpointDependency {
readonly description?: string;
Expand Down Expand Up @@ -819,6 +833,12 @@ export type InterNodeCommunicationState = "Enabled" | "Disabled";
// @public
export type IPAddressProvisioningType = "BatchManaged" | "UserManaged" | "NoPublicIPAddresses";

// @public
export interface IPRule {
action: "Allow";
value: string;
}

// @public
export type KeySource = "Microsoft.Batch" | "Microsoft.KeyVault";

Expand Down Expand Up @@ -963,6 +983,12 @@ export interface NetworkConfiguration {
subnetId?: string;
}

// @public
export interface NetworkProfile {
accountAccess?: EndpointAccessProfile;
nodeManagementAccess?: EndpointAccessProfile;
}

// @public
export interface NetworkSecurityGroupRule {
access: NetworkSecurityGroupRuleAccess;
Expand Down Expand Up @@ -1210,10 +1236,26 @@ export interface PrivateEndpoint {
// @public
export type PrivateEndpointConnection = ProxyResource & {
readonly provisioningState?: PrivateEndpointConnectionProvisioningState;
privateEndpoint?: PrivateEndpoint;
readonly privateEndpoint?: PrivateEndpoint;
readonly groupIds?: string[];
privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState;
};

// @public
export interface PrivateEndpointConnectionDeleteHeaders {
location?: string;
retryAfter?: number;
}

// @public
export interface PrivateEndpointConnectionDeleteOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
updateIntervalInMs?: number;
}

// @public
export type PrivateEndpointConnectionDeleteResponse = PrivateEndpointConnectionDeleteHeaders;

// @public
export interface PrivateEndpointConnectionGetOptionalParams extends coreClient.OperationOptions {
}
Expand All @@ -1239,14 +1281,16 @@ export type PrivateEndpointConnectionListByBatchAccountResponse = ListPrivateEnd

// @public
export interface PrivateEndpointConnectionOperations {
beginDelete(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionDeleteOptionalParams): Promise<PollerLike<PollOperationState<PrivateEndpointConnectionDeleteResponse>, PrivateEndpointConnectionDeleteResponse>>;
beginDeleteAndWait(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionDeleteOptionalParams): Promise<PrivateEndpointConnectionDeleteResponse>;
beginUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionUpdateOptionalParams): Promise<PollerLike<PollOperationState<PrivateEndpointConnectionUpdateResponse>, PrivateEndpointConnectionUpdateResponse>>;
beginUpdateAndWait(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionUpdateOptionalParams): Promise<PrivateEndpointConnectionUpdateResponse>;
get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionGetOptionalParams): Promise<PrivateEndpointConnectionGetResponse>;
listByBatchAccount(resourceGroupName: string, accountName: string, options?: PrivateEndpointConnectionListByBatchAccountOptionalParams): PagedAsyncIterableIterator<PrivateEndpointConnection>;
}

// @public
export type PrivateEndpointConnectionProvisioningState = "Succeeded" | "Updating" | "Failed";
export type PrivateEndpointConnectionProvisioningState = "Creating" | "Updating" | "Deleting" | "Succeeded" | "Failed" | "Cancelled";

// @public
export interface PrivateEndpointConnectionUpdateHeaders {
Expand Down
62 changes: 60 additions & 2 deletions sdk/batch/arm-batch/src/batchManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
*/

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 {
BatchAccountOperationsImpl,
Expand Down Expand Up @@ -65,7 +71,7 @@ export class BatchManagementClient extends coreClient.ServiceClient {
credential: credentials
};

const packageDetails = `azsdk-js-arm-batch/7.1.2`;
const packageDetails = `azsdk-js-arm-batch/7.2.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand All @@ -84,12 +90,35 @@ export class BatchManagementClient extends coreClient.ServiceClient {
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
};
super(optionsWithDefaults);

if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
(pipelinePolicy) =>
pipelinePolicy.name ===
coreRestPipeline.bearerTokenAuthenticationPolicyName
);
if (!bearerTokenAuthenticationPolicyFound) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
scopes: `${optionsWithDefaults.baseUri}/.default`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge
}
})
);
}
}
// Parameter assignments
this.subscriptionId = subscriptionId;

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2022-01-01";
this.apiVersion = options.apiVersion || "2022-06-01";
this.batchAccountOperations = new BatchAccountOperationsImpl(this);
this.applicationPackageOperations = new ApplicationPackageOperationsImpl(
this
Expand All @@ -105,6 +134,35 @@ export class BatchManagementClient extends coreClient.ServiceClient {
this
);
this.poolOperations = new PoolOperationsImpl(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);
}

batchAccountOperations: BatchAccountOperations;
Expand Down
Loading