diff --git a/sdk/batch/arm-batch/CHANGELOG.md b/sdk/batch/arm-batch/CHANGELOG.md index 8eb858dfd780..9185cbad912c 100644 --- a/sdk/batch/arm-batch/CHANGELOG.md +++ b/sdk/batch/arm-batch/CHANGELOG.md @@ -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** diff --git a/sdk/batch/arm-batch/_meta.json b/sdk/batch/arm-batch/_meta.json index c07ae32f85b8..2d99165504cc 100644 --- a/sdk/batch/arm-batch/_meta.json +++ b/sdk/batch/arm-batch/_meta.json @@ -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" } \ No newline at end of file diff --git a/sdk/batch/arm-batch/package.json b/sdk/batch/arm-batch/package.json index ab72253fd6ea..2d31a88449b5 100644 --- a/sdk/batch/arm-batch/package.json +++ b/sdk/batch/arm-batch/package.json @@ -3,7 +3,7 @@ "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" }, @@ -11,9 +11,9 @@ "@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": [ @@ -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": { @@ -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" }, @@ -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 +} \ No newline at end of file diff --git a/sdk/batch/arm-batch/review/arm-batch.api.md b/sdk/batch/arm-batch/review/arm-batch.api.md index bf8a2382e4d0..e672aef950f4 100644 --- a/sdk/batch/arm-batch/review/arm-batch.api.md +++ b/sdk/batch/arm-batch/review/arm-batch.api.md @@ -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; @@ -252,6 +254,7 @@ export interface BatchAccountCreateParameters { identity?: BatchAccountIdentity; keyVaultReference?: KeyVaultReference; location: string; + networkProfile?: NetworkProfile; poolAllocationMode?: PoolAllocationMode; publicNetworkAccess?: PublicNetworkAccessType; tags?: { @@ -418,6 +421,8 @@ export interface BatchAccountUpdateParameters { autoStorage?: AutoStorageBaseProperties; encryption?: EncryptionProperties; identity?: BatchAccountIdentity; + networkProfile?: NetworkProfile; + publicNetworkAccess?: PublicNetworkAccessType; tags?: { [propertyName: string]: string; }; @@ -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; @@ -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"; @@ -963,6 +983,12 @@ export interface NetworkConfiguration { subnetId?: string; } +// @public +export interface NetworkProfile { + accountAccess?: EndpointAccessProfile; + nodeManagementAccess?: EndpointAccessProfile; +} + // @public export interface NetworkSecurityGroupRule { access: NetworkSecurityGroupRuleAccess; @@ -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 { } @@ -1239,6 +1281,8 @@ export type PrivateEndpointConnectionListByBatchAccountResponse = ListPrivateEnd // @public export interface PrivateEndpointConnectionOperations { + beginDelete(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionDeleteOptionalParams): Promise, PrivateEndpointConnectionDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionDeleteOptionalParams): Promise; beginUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionUpdateOptionalParams): Promise, PrivateEndpointConnectionUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionUpdateOptionalParams): Promise; get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionGetOptionalParams): Promise; @@ -1246,7 +1290,7 @@ export interface PrivateEndpointConnectionOperations { } // @public -export type PrivateEndpointConnectionProvisioningState = "Succeeded" | "Updating" | "Failed"; +export type PrivateEndpointConnectionProvisioningState = "Creating" | "Updating" | "Deleting" | "Succeeded" | "Failed" | "Cancelled"; // @public export interface PrivateEndpointConnectionUpdateHeaders { diff --git a/sdk/batch/arm-batch/src/batchManagementClient.ts b/sdk/batch/arm-batch/src/batchManagementClient.ts index 36b6d6a7d288..c865b9933925 100644 --- a/sdk/batch/arm-batch/src/batchManagementClient.ts +++ b/sdk/batch/arm-batch/src/batchManagementClient.ts @@ -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, @@ -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}` @@ -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 @@ -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 { + 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; diff --git a/sdk/batch/arm-batch/src/models/index.ts b/sdk/batch/arm-batch/src/models/index.ts index 80de72fc780b..32af146eaa82 100644 --- a/sdk/batch/arm-batch/src/models/index.ts +++ b/sdk/batch/arm-batch/src/models/index.ts @@ -24,6 +24,8 @@ export interface BatchAccountCreateParameters { keyVaultReference?: KeyVaultReference; /** If not specified, the default value is 'enabled'. */ publicNetworkAccess?: PublicNetworkAccessType; + /** The network profile only takes effect when publicNetworkAccess is enabled. */ + networkProfile?: NetworkProfile; /** Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. */ encryption?: EncryptionProperties; /** List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. */ @@ -54,6 +56,30 @@ export interface KeyVaultReference { url: string; } +/** Network profile for Batch account, which contains network rule settings for each endpoint. */ +export interface NetworkProfile { + /** Network access profile for batchAccount endpoint (Batch account data plane API). */ + accountAccess?: EndpointAccessProfile; + /** Network access profile for nodeManagement endpoint (Batch service managing compute nodes for Batch pools). */ + nodeManagementAccess?: EndpointAccessProfile; +} + +/** Network access profile for Batch endpoint. */ +export interface EndpointAccessProfile { + /** Default action for endpoint access. It is only applicable when publicNetworkAccess is enabled. */ + defaultAction: EndpointAccessDefaultAction; + /** Array of IP ranges to filter client IP address. */ + ipRules?: IPRule[]; +} + +/** Rule to filter client IP address. */ +export interface IPRule { + /** Action when client IP address is matched. */ + action: "Allow"; + /** IPv4 address, or IPv4 address range in CIDR format. */ + value: string; +} + /** Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. */ export interface EncryptionProperties { /** Type of the key source. */ @@ -225,6 +251,10 @@ export interface BatchAccountUpdateParameters { encryption?: EncryptionProperties; /** List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. */ allowedAuthenticationModes?: AuthenticationMode[]; + /** If not specified, the default value is 'enabled'. */ + publicNetworkAccess?: PublicNetworkAccessType; + /** The network profile only takes effect when publicNetworkAccess is enabled. */ + networkProfile?: NetworkProfile; } /** Values returned by the List operation. */ @@ -1021,8 +1051,16 @@ export type PrivateEndpointConnection = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: PrivateEndpointConnectionProvisioningState; - /** The private endpoint of the private endpoint connection. */ - privateEndpoint?: PrivateEndpoint; + /** + * The private endpoint of the private endpoint connection. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpoint?: PrivateEndpoint; + /** + * The value has one and only one group id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupIds?: string[]; /** The private link service connection state of the private endpoint connection */ privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; }; @@ -1237,6 +1275,11 @@ export type BatchAccount = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly accountEndpoint?: string; + /** + * The endpoint used by compute node to connect to the Batch node management service. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nodeManagementEndpoint?: string; /** * The provisioned state of the resource * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1252,11 +1295,10 @@ export type BatchAccount = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly keyVaultReference?: KeyVaultReference; - /** - * If not specified, the default value is 'enabled'. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publicNetworkAccess?: PublicNetworkAccessType; + /** If not specified, the default value is 'enabled'. */ + publicNetworkAccess?: PublicNetworkAccessType; + /** The network profile only takes effect when publicNetworkAccess is enabled. */ + networkProfile?: NetworkProfile; /** * List of private endpoint connections associated with the Batch account * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1288,7 +1330,7 @@ export type BatchAccount = Resource & { */ readonly dedicatedCoreQuotaPerVMFamily?: VirtualMachineFamilyCoreQuota[]; /** - * Batch is transitioning its core quota system for dedicated cores to be enforced per Virtual Machine family. During this transitional phase, the dedicated core quota per Virtual Machine family may not yet be enforced. If this flag is false, dedicated core quota is enforced via the old dedicatedCoreQuota property on the account and does not consider Virtual Machine family. If this flag is true, dedicated core quota is enforced via the dedicatedCoreQuotaPerVMFamily property on the account, and the old dedicatedCoreQuota does not apply. + * If this flag is true, dedicated core quota is enforced via both the dedicatedCoreQuotaPerVMFamily and dedicatedCoreQuota properties on the account. If this flag is false, dedicated core quota is enforced only via the dedicatedCoreQuota property on the account and does not consider Virtual Machine family. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly dedicatedCoreQuotaPerVMFamilyEnforced?: boolean; @@ -1404,6 +1446,14 @@ export interface PrivateEndpointConnectionUpdateHeaders { retryAfter?: number; } +/** Defines headers for PrivateEndpointConnection_delete operation. */ +export interface PrivateEndpointConnectionDeleteHeaders { + /** The URL of the resource used to check the status of the asynchronous operation. */ + location?: string; + /** Suggested delay to check the status of the asynchronous operation. The value is an integer that specifies the delay in seconds. */ + retryAfter?: number; +} + /** Defines headers for Pool_create operation. */ export interface PoolCreateHeaders { /** The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. */ @@ -1450,6 +1500,8 @@ export type AutoStorageAuthenticationMode = export type PoolAllocationMode = "BatchService" | "UserSubscription"; /** Defines values for PublicNetworkAccessType. */ export type PublicNetworkAccessType = "Enabled" | "Disabled"; +/** Defines values for EndpointAccessDefaultAction. */ +export type EndpointAccessDefaultAction = "Allow" | "Deny"; /** Defines values for KeySource. */ export type KeySource = "Microsoft.Batch" | "Microsoft.KeyVault"; /** Defines values for AuthenticationMode. */ @@ -1469,9 +1521,12 @@ export type ProvisioningState = | "Cancelled"; /** Defines values for PrivateEndpointConnectionProvisioningState. */ export type PrivateEndpointConnectionProvisioningState = - | "Succeeded" + | "Creating" | "Updating" - | "Failed"; + | "Deleting" + | "Succeeded" + | "Failed" + | "Cancelled"; /** Defines values for PrivateLinkServiceConnectionStatus. */ export type PrivateLinkServiceConnectionStatus = | "Approved" @@ -1958,6 +2013,18 @@ export interface PrivateEndpointConnectionUpdateOptionalParams /** Contains response data for the update operation. */ export type PrivateEndpointConnectionUpdateResponse = PrivateEndpointConnection; +/** Optional parameters. */ +export interface PrivateEndpointConnectionDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type PrivateEndpointConnectionDeleteResponse = PrivateEndpointConnectionDeleteHeaders; + /** Optional parameters. */ export interface PrivateEndpointConnectionListByBatchAccountNextOptionalParams extends coreClient.OperationOptions { diff --git a/sdk/batch/arm-batch/src/models/mappers.ts b/sdk/batch/arm-batch/src/models/mappers.ts index 734a747f9fbd..6f7969ac3ae4 100644 --- a/sdk/batch/arm-batch/src/models/mappers.ts +++ b/sdk/batch/arm-batch/src/models/mappers.ts @@ -63,6 +63,13 @@ export const BatchAccountCreateParameters: coreClient.CompositeMapper = { allowedValues: ["Enabled", "Disabled"] } }, + networkProfile: { + serializedName: "properties.networkProfile", + type: { + name: "Composite", + className: "NetworkProfile" + } + }, encryption: { serializedName: "properties.encryption", type: { @@ -156,6 +163,82 @@ export const KeyVaultReference: coreClient.CompositeMapper = { } }; +export const NetworkProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkProfile", + modelProperties: { + accountAccess: { + serializedName: "accountAccess", + type: { + name: "Composite", + className: "EndpointAccessProfile" + } + }, + nodeManagementAccess: { + serializedName: "nodeManagementAccess", + type: { + name: "Composite", + className: "EndpointAccessProfile" + } + } + } + } +}; + +export const EndpointAccessProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EndpointAccessProfile", + modelProperties: { + defaultAction: { + serializedName: "defaultAction", + required: true, + type: { + name: "Enum", + allowedValues: ["Allow", "Deny"] + } + }, + ipRules: { + serializedName: "ipRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IPRule" + } + } + } + } + } + } +}; + +export const IPRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IPRule", + modelProperties: { + action: { + defaultValue: "Allow", + isConstant: true, + serializedName: "action", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + required: true, + type: { + name: "String" + } + } + } + } +}; + export const EncryptionProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -508,6 +591,21 @@ export const BatchAccountUpdateParameters: coreClient.CompositeMapper = { } } } + }, + publicNetworkAccess: { + defaultValue: "Enabled", + serializedName: "properties.publicNetworkAccess", + type: { + name: "Enum", + allowedValues: ["Enabled", "Disabled"] + } + }, + networkProfile: { + serializedName: "properties.networkProfile", + type: { + name: "Composite", + className: "NetworkProfile" + } } } } @@ -2760,7 +2858,14 @@ export const PrivateEndpointConnection: coreClient.CompositeMapper = { readOnly: true, type: { name: "Enum", - allowedValues: ["Succeeded", "Updating", "Failed"] + allowedValues: [ + "Creating", + "Updating", + "Deleting", + "Succeeded", + "Failed", + "Cancelled" + ] } }, privateEndpoint: { @@ -2770,6 +2875,18 @@ export const PrivateEndpointConnection: coreClient.CompositeMapper = { className: "PrivateEndpoint" } }, + groupIds: { + serializedName: "properties.groupIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, privateLinkServiceConnectionState: { serializedName: "properties.privateLinkServiceConnectionState", type: { @@ -3266,6 +3383,13 @@ export const BatchAccount: coreClient.CompositeMapper = { name: "String" } }, + nodeManagementEndpoint: { + serializedName: "properties.nodeManagementEndpoint", + readOnly: true, + type: { + name: "String" + } + }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, @@ -3299,13 +3423,19 @@ export const BatchAccount: coreClient.CompositeMapper = { publicNetworkAccess: { defaultValue: "Enabled", serializedName: "properties.publicNetworkAccess", - readOnly: true, nullable: true, type: { name: "Enum", allowedValues: ["Enabled", "Disabled"] } }, + networkProfile: { + serializedName: "properties.networkProfile", + type: { + name: "Composite", + className: "NetworkProfile" + } + }, privateEndpointConnections: { serializedName: "properties.privateEndpointConnections", readOnly: true, @@ -3623,6 +3753,27 @@ export const PrivateEndpointConnectionUpdateHeaders: coreClient.CompositeMapper } }; +export const PrivateEndpointConnectionDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + } + } + } +}; + export const PoolCreateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/batch/arm-batch/src/models/parameters.ts b/sdk/batch/arm-batch/src/models/parameters.ts index 1610c3503209..ef51c04a09f0 100644 --- a/sdk/batch/arm-batch/src/models/parameters.ts +++ b/sdk/batch/arm-batch/src/models/parameters.ts @@ -95,7 +95,7 @@ export const accountName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-01-01", + defaultValue: "2022-06-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts b/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts index 4968ed41637d..2579d3048405 100644 --- a/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts +++ b/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts @@ -50,7 +50,7 @@ import { BatchAccountListNextResponse, BatchAccountListByResourceGroupNextResponse, BatchAccountListDetectorsNextResponse, - BatchAccountListOutboundNetworkDependenciesEndpointsNextResponse, + BatchAccountListOutboundNetworkDependenciesEndpointsNextResponse } from "../models"; /// @@ -70,7 +70,9 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { * Gets information about the Batch accounts associated with the subscription. * @param options The options parameters. */ - public list(options?: BatchAccountListOptionalParams): PagedAsyncIterableIterator { + public list( + options?: BatchAccountListOptionalParams + ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { next() { @@ -81,7 +83,7 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { }, byPage: () => { return this.listPagingPage(options); - }, + } }; } @@ -125,7 +127,7 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { }, byPage: () => { return this.listByResourceGroupPagingPage(resourceGroupName, options); - }, + } }; } @@ -137,7 +139,11 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { yield result.value || []; let continuationToken = result.nextLink; while (continuationToken) { - result = await this._listByResourceGroupNext(resourceGroupName, continuationToken, options); + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); continuationToken = result.nextLink; yield result.value || []; } @@ -147,7 +153,10 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { resourceGroupName: string, options?: BatchAccountListByResourceGroupOptionalParams ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage(resourceGroupName, options)) { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { yield* page; } } @@ -163,7 +172,11 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { accountName: string, options?: BatchAccountListDetectorsOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listDetectorsPagingAll(resourceGroupName, accountName, options); + const iter = this.listDetectorsPagingAll( + resourceGroupName, + accountName, + options + ); return { next() { return iter.next(); @@ -172,8 +185,12 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { return this; }, byPage: () => { - return this.listDetectorsPagingPage(resourceGroupName, accountName, options); - }, + return this.listDetectorsPagingPage( + resourceGroupName, + accountName, + options + ); + } }; } @@ -182,7 +199,11 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { accountName: string, options?: BatchAccountListDetectorsOptionalParams ): AsyncIterableIterator { - let result = await this._listDetectors(resourceGroupName, accountName, options); + let result = await this._listDetectors( + resourceGroupName, + accountName, + options + ); yield result.value || []; let continuationToken = result.nextLink; while (continuationToken) { @@ -217,7 +238,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. @@ -245,7 +266,7 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { accountName, options ); - }, + } }; } @@ -304,7 +325,10 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { parameters: BatchAccountCreateParameters, options?: BatchAccountCreateOptionalParams ): Promise< - PollerLike, BatchAccountCreateResponse> + PollerLike< + PollOperationState, + BatchAccountCreateResponse + > > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -316,7 +340,9 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -329,8 +355,8 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { ...args, options: { ...args.options, - onResponse: callback, - }, + onResponse: callback + } }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -338,8 +364,8 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, + headers: currentRawResponse!.headers.toJSON() + } }; }; @@ -351,7 +377,7 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location", + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -374,7 +400,12 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { parameters: BatchAccountCreateParameters, options?: BatchAccountCreateOptionalParams ): Promise { - const poller = await this.beginCreate(resourceGroupName, accountName, parameters, options); + const poller = await this.beginCreate( + resourceGroupName, + accountName, + parameters, + options + ); return poller.pollUntilDone(); } @@ -418,7 +449,9 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -431,8 +464,8 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { ...args, options: { ...args.options, - onResponse: callback, - }, + onResponse: callback + } }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -440,8 +473,8 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, + headers: currentRawResponse!.headers.toJSON() + } }; }; @@ -453,7 +486,7 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { const poller = new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location", + lroResourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -470,7 +503,11 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { accountName: string, options?: BatchAccountDeleteOptionalParams ): Promise { - const poller = await this.beginDelete(resourceGroupName, accountName, options); + const poller = await this.beginDelete( + resourceGroupName, + accountName, + options + ); return poller.pollUntilDone(); } @@ -495,7 +532,9 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { * Gets information about the Batch accounts associated with the subscription. * @param options The options parameters. */ - private _list(options?: BatchAccountListOptionalParams): Promise { + private _list( + options?: BatchAccountListOptionalParams + ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -616,7 +655,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. @@ -641,7 +680,10 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { nextLink: string, options?: BatchAccountListNextOptionalParams ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); } /** @@ -704,24 +746,25 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.BatchAccount, + bodyMapper: Mappers.BatchAccount }, 201: { - bodyMapper: Mappers.BatchAccount, + bodyMapper: Mappers.BatchAccount }, 202: { - bodyMapper: Mappers.BatchAccount, + bodyMapper: Mappers.BatchAccount }, 204: { - bodyMapper: Mappers.BatchAccount, + bodyMapper: Mappers.BatchAccount }, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, requestBody: Parameters.parameters, queryParameters: [Parameters.apiVersion], @@ -729,22 +772,23 @@ const createOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.resourceGroupName, Parameters.accountName, - Parameters.subscriptionId, + Parameters.subscriptionId ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer, + serializer }; const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.BatchAccount, + bodyMapper: Mappers.BatchAccount }, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, requestBody: Parameters.parameters1, queryParameters: [Parameters.apiVersion], @@ -752,14 +796,15 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.accountName1, + Parameters.accountName1 ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer, + serializer }; const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", httpMethod: "DELETE", responses: { 200: {}, @@ -767,101 +812,110 @@ const deleteOperationSpec: coreClient.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.accountName1, + Parameters.accountName1 ], headerParameters: [Parameters.accept], - serializer, + serializer }; const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BatchAccount, + bodyMapper: Mappers.BatchAccount }, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.accountName1, + Parameters.accountName1 ], headerParameters: [Parameters.accept], - serializer, + serializer }; const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/batchAccounts", + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/batchAccounts", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BatchAccountListResult, + bodyMapper: Mappers.BatchAccountListResult }, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer, + serializer }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts", + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BatchAccountListResult, + bodyMapper: Mappers.BatchAccountListResult }, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], headerParameters: [Parameters.accept], - serializer, + serializer }; const synchronizeAutoStorageKeysOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys", + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys", httpMethod: "POST", responses: { 204: {}, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.accountName1, + Parameters.accountName1 ], headerParameters: [Parameters.accept], - serializer, + serializer }; const regenerateKeyOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys", + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.BatchAccountKeys, + bodyMapper: Mappers.BatchAccountKeys }, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, requestBody: Parameters.parameters2, queryParameters: [Parameters.apiVersion], @@ -869,64 +923,67 @@ const regenerateKeyOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.accountName1, + Parameters.accountName1 ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", - serializer, + serializer }; const getKeysOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys", + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys", httpMethod: "POST", responses: { 200: { - bodyMapper: Mappers.BatchAccountKeys, + bodyMapper: Mappers.BatchAccountKeys }, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.accountName1, + Parameters.accountName1 ], headerParameters: [Parameters.accept], - serializer, + serializer }; const listDetectorsOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors", + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DetectorListResult, + bodyMapper: Mappers.DetectorListResult }, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.accountName1, + Parameters.accountName1 ], headerParameters: [Parameters.accept], - serializer, + serializer }; const getDetectorOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors/{detectorId}", + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors/{detectorId}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DetectorResponse, + bodyMapper: Mappers.DetectorResponse }, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -934,79 +991,84 @@ const getDetectorOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.accountName1, - Parameters.detectorId, + Parameters.detectorId ], headerParameters: [Parameters.accept], - serializer, + serializer }; const listOutboundNetworkDependenciesEndpointsOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints", + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OutboundEnvironmentEndpointCollection, + bodyMapper: Mappers.OutboundEnvironmentEndpointCollection }, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.accountName1, + Parameters.accountName1 ], headerParameters: [Parameters.accept], - serializer, + serializer }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BatchAccountListResult, + bodyMapper: Mappers.BatchAccountListResult }, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId, Parameters.nextLink], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], headerParameters: [Parameters.accept], - serializer, + serializer }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.BatchAccountListResult, + bodyMapper: Mappers.BatchAccountListResult }, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, Parameters.subscriptionId, - Parameters.nextLink, + Parameters.nextLink ], headerParameters: [Parameters.accept], - serializer, + serializer }; const listDetectorsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.DetectorListResult, + bodyMapper: Mappers.DetectorListResult }, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -1014,21 +1076,21 @@ const listDetectorsNextOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.accountName1, - Parameters.nextLink, + Parameters.nextLink ], headerParameters: [Parameters.accept], - serializer, + serializer }; const listOutboundNetworkDependenciesEndpointsNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OutboundEnvironmentEndpointCollection, + bodyMapper: Mappers.OutboundEnvironmentEndpointCollection }, default: { - bodyMapper: Mappers.CloudError, - }, + bodyMapper: Mappers.CloudError + } }, queryParameters: [Parameters.apiVersion], urlParameters: [ @@ -1036,8 +1098,8 @@ const listOutboundNetworkDependenciesEndpointsNextOperationSpec: coreClient.Oper Parameters.resourceGroupName, Parameters.subscriptionId, Parameters.accountName1, - Parameters.nextLink, + Parameters.nextLink ], headerParameters: [Parameters.accept], - serializer, + serializer }; diff --git a/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts b/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts index e57b07486b8b..cd026a3911ab 100644 --- a/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts +++ b/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts @@ -23,6 +23,8 @@ import { PrivateEndpointConnectionGetResponse, PrivateEndpointConnectionUpdateOptionalParams, PrivateEndpointConnectionUpdateResponse, + PrivateEndpointConnectionDeleteOptionalParams, + PrivateEndpointConnectionDeleteResponse, PrivateEndpointConnectionListByBatchAccountNextResponse } from "../models"; @@ -261,6 +263,106 @@ export class PrivateEndpointConnectionOperationsImpl return poller.pollUntilDone(); } + /** + * Deletes the specified private endpoint connection. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param privateEndpointConnectionName The private endpoint connection name. This must be unique + * within the account. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + accountName, + privateEndpointConnectionName, + options + }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the specified private endpoint connection. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param privateEndpointConnectionName The private endpoint connection name. This must be unique + * within the account. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + privateEndpointConnectionName, + options + ); + return poller.pollUntilDone(); + } + /** * ListByBatchAccountNext * @param resourceGroupName The name of the resource group that contains the Batch account. @@ -366,6 +468,38 @@ const updateOperationSpec: coreClient.OperationSpec = { mediaType: "json", serializer }; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.PrivateEndpointConnectionDeleteHeaders + }, + 201: { + headersMapper: Mappers.PrivateEndpointConnectionDeleteHeaders + }, + 202: { + headersMapper: Mappers.PrivateEndpointConnectionDeleteHeaders + }, + 204: { + headersMapper: Mappers.PrivateEndpointConnectionDeleteHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.accountName1, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; const listByBatchAccountNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts index 22e46f9aed1c..24c1be7d5026 100644 --- a/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts +++ b/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts @@ -32,7 +32,7 @@ import { BatchAccountGetKeysOptionalParams, BatchAccountGetKeysResponse, BatchAccountGetDetectorOptionalParams, - BatchAccountGetDetectorResponse, + BatchAccountGetDetectorResponse } from "../models"; /// @@ -42,7 +42,9 @@ export interface BatchAccountOperations { * Gets information about the Batch accounts associated with the subscription. * @param options The options parameters. */ - list(options?: BatchAccountListOptionalParams): PagedAsyncIterableIterator; + list( + options?: BatchAccountListOptionalParams + ): PagedAsyncIterableIterator; /** * Gets information about the Batch accounts associated with the specified resource group. * @param resourceGroupName The name of the resource group that contains the Batch account. @@ -69,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. @@ -96,7 +98,10 @@ export interface BatchAccountOperations { parameters: BatchAccountCreateParameters, options?: BatchAccountCreateOptionalParams ): Promise< - PollerLike, BatchAccountCreateResponse> + PollerLike< + PollOperationState, + BatchAccountCreateResponse + > >; /** * Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/privateEndpointConnectionOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/privateEndpointConnectionOperations.ts index 0943dceccc88..7157f6bea448 100644 --- a/sdk/batch/arm-batch/src/operationsInterfaces/privateEndpointConnectionOperations.ts +++ b/sdk/batch/arm-batch/src/operationsInterfaces/privateEndpointConnectionOperations.ts @@ -14,7 +14,9 @@ import { PrivateEndpointConnectionGetOptionalParams, PrivateEndpointConnectionGetResponse, PrivateEndpointConnectionUpdateOptionalParams, - PrivateEndpointConnectionUpdateResponse + PrivateEndpointConnectionUpdateResponse, + PrivateEndpointConnectionDeleteOptionalParams, + PrivateEndpointConnectionDeleteResponse } from "../models"; /// @@ -84,4 +86,37 @@ export interface PrivateEndpointConnectionOperations { parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionUpdateOptionalParams ): Promise; + /** + * Deletes the specified private endpoint connection. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param privateEndpointConnectionName The private endpoint connection name. This must be unique + * within the account. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionDeleteOptionalParams + ): Promise< + PollerLike< + PollOperationState, + PrivateEndpointConnectionDeleteResponse + > + >; + /** + * Deletes the specified private endpoint connection. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param privateEndpointConnectionName The private endpoint connection name. This must be unique + * within the account. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionDeleteOptionalParams + ): Promise; } diff --git a/sdk/batch/arm-batch/test/sampleTest.ts b/sdk/batch/arm-batch/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /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..3e6ae96443f3 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" + "./test/**/*.ts" ], "exclude": [ "node_modules"