diff --git a/sdk/batch/arm-batch/LICENSE.txt b/sdk/batch/arm-batch/LICENSE.txt index ea8fb1516028..2d3163745319 100644 --- a/sdk/batch/arm-batch/LICENSE.txt +++ b/sdk/batch/arm-batch/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Microsoft +Copyright (c) 2021 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/batch/arm-batch/README.md b/sdk/batch/arm-batch/README.md index 7b0d748b036c..dea98e284e4a 100644 --- a/sdk/batch/arm-batch/README.md +++ b/sdk/batch/arm-batch/README.md @@ -1,11 +1,11 @@ ## Azure BatchManagementClient SDK for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for BatchManagementClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for BatchManagementClient. ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites @@ -21,7 +21,6 @@ Install both packages using the below command: ```bash npm install --save @azure/arm-batch @azure/identity ``` - > **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. @@ -37,7 +36,6 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/ In the below samples, we pass the credential and the Azure subscription id to instantiate the client. Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. - #### nodejs - Authentication, client creation, and get batchAccount as an example written in JavaScript. ##### Sample code @@ -87,7 +85,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t const credential = new InteractiveBrowserCredential( { clientId: "", - tenantId: "" + tenant: "" }); const client = new Azure.ArmBatch.BatchManagementClient(creds, subscriptionId); const resourceGroupName = "testresourceGroupName"; diff --git a/sdk/batch/arm-batch/package.json b/sdk/batch/arm-batch/package.json index 25147b040606..66fa49d3ac3a 100644 --- a/sdk/batch/arm-batch/package.json +++ b/sdk/batch/arm-batch/package.json @@ -7,7 +7,7 @@ "@azure/ms-rest-azure-js": "^2.1.0", "@azure/ms-rest-js": "^2.2.0", "@azure/core-auth": "^1.1.4", - "tslib": "^2.0.0" + "tslib": "^1.10.0" }, "keywords": [ "node", @@ -21,21 +21,13 @@ "module": "./esm/batchManagementClient.js", "types": "./esm/batchManagementClient.d.ts", "devDependencies": { - "@types/chai": "^4.1.6", - "@types/jssha": "^2.0.0", - "@types/mocha": "^7.0.2", - "chai": "^4.2.0", - "dotenv": "^8.2.0", - "mocha": "^7.1.1", - "rollup": "^1.16.3", + "typescript": "^3.6.0", + "rollup": "^1.18.0", "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-sourcemaps": "^0.4.2", - "esm": "^3.2.25", - "ts-node": "^8.3.0", - "typescript": "^3.6.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/batch/arm-batch", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -60,8 +52,7 @@ "scripts": { "build": "tsc && rollup -c rollup.config.js && npm run minify", "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-batch.js.map'\" -o ./dist/arm-batch.min.js ./dist/arm-batch.js", - "prepack": "npm install && npm run build", - "test": "mocha -r esm --require ts-node/register test/*.spec.ts --timeout 1200000 --full-trace" + "prepack": "npm install && npm run build" }, "sideEffects": false, "autoPublish": true diff --git a/sdk/batch/arm-batch/rollup.config.js b/sdk/batch/arm-batch/rollup.config.js index 8d1bc25e71ac..8d189bb7fa9b 100644 --- a/sdk/batch/arm-batch/rollup.config.js +++ b/sdk/batch/arm-batch/rollup.config.js @@ -21,8 +21,8 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/batch/arm-batch/src/batchManagementClient.ts b/sdk/batch/arm-batch/src/batchManagementClient.ts index f59a410fc6ff..466def3d7c18 100644 --- a/sdk/batch/arm-batch/src/batchManagementClient.ts +++ b/sdk/batch/arm-batch/src/batchManagementClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/batch/arm-batch/src/batchManagementClientContext.ts b/sdk/batch/arm-batch/src/batchManagementClientContext.ts index c24d567fca56..ca1013981bec 100644 --- a/sdk/batch/arm-batch/src/batchManagementClientContext.ts +++ b/sdk/batch/arm-batch/src/batchManagementClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -10,8 +9,8 @@ import * as Models from "./models"; import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; const packageName = "@azure/arm-batch"; const packageVersion = "5.1.0"; @@ -44,14 +43,14 @@ export class BatchManagementClientContext extends msRestAzure.AzureServiceClient if (!options) { options = {}; } - if(!options.userAgent) { + if (!options.userAgent) { const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; } super(credentials, options); - this.apiVersion = '2020-09-01'; + this.apiVersion = '2021-01-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; @@ -59,10 +58,10 @@ export class BatchManagementClientContext extends msRestAzure.AzureServiceClient this.credentials = credentials; this.subscriptionId = subscriptionId; - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } } diff --git a/sdk/batch/arm-batch/src/models/applicationOperationsMappers.ts b/sdk/batch/arm-batch/src/models/applicationOperationsMappers.ts index 5a3c50ebbc1b..e2af3ef27c93 100644 --- a/sdk/batch/arm-batch/src/models/applicationOperationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/applicationOperationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -21,6 +21,9 @@ export { BaseResource, BatchAccount, BatchAccountIdentity, + BatchAccountIdentityUserAssignedIdentitiesValue, + BatchPoolIdentity, + BatchPoolIdentityUserAssignedIdentitiesValue, Certificate, CertificateCreateOrUpdateParameters, CertificateReference, @@ -47,6 +50,7 @@ export { NetworkConfiguration, NetworkSecurityGroupRule, NFSMountConfiguration, + NodePlacementConfiguration, Pool, PoolEndpointConfiguration, PrivateEndpoint, @@ -67,6 +71,7 @@ export { UserIdentity, VirtualMachineConfiguration, VirtualMachineFamilyCoreQuota, + VMExtension, WindowsConfiguration, WindowsUserConfiguration } from "../models/mappers"; diff --git a/sdk/batch/arm-batch/src/models/applicationPackageOperationsMappers.ts b/sdk/batch/arm-batch/src/models/applicationPackageOperationsMappers.ts index a498cd5da71f..25f86b59fed5 100644 --- a/sdk/batch/arm-batch/src/models/applicationPackageOperationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/applicationPackageOperationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -22,6 +22,9 @@ export { BaseResource, BatchAccount, BatchAccountIdentity, + BatchAccountIdentityUserAssignedIdentitiesValue, + BatchPoolIdentity, + BatchPoolIdentityUserAssignedIdentitiesValue, Certificate, CertificateCreateOrUpdateParameters, CertificateReference, @@ -48,6 +51,7 @@ export { NetworkConfiguration, NetworkSecurityGroupRule, NFSMountConfiguration, + NodePlacementConfiguration, Pool, PoolEndpointConfiguration, PrivateEndpoint, @@ -68,6 +72,7 @@ export { UserIdentity, VirtualMachineConfiguration, VirtualMachineFamilyCoreQuota, + VMExtension, WindowsConfiguration, WindowsUserConfiguration } from "../models/mappers"; diff --git a/sdk/batch/arm-batch/src/models/batchAccountOperationsMappers.ts b/sdk/batch/arm-batch/src/models/batchAccountOperationsMappers.ts index 4488249bd7f1..dab9d34a6eaa 100644 --- a/sdk/batch/arm-batch/src/models/batchAccountOperationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/batchAccountOperationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -24,10 +24,13 @@ export { BatchAccountCreateParameters, BatchAccountDeleteHeaders, BatchAccountIdentity, + BatchAccountIdentityUserAssignedIdentitiesValue, BatchAccountKeys, BatchAccountListResult, BatchAccountRegenerateKeyParameters, BatchAccountUpdateParameters, + BatchPoolIdentity, + BatchPoolIdentityUserAssignedIdentitiesValue, Certificate, CertificateCreateOrUpdateParameters, CertificateReference, @@ -53,6 +56,7 @@ export { NetworkConfiguration, NetworkSecurityGroupRule, NFSMountConfiguration, + NodePlacementConfiguration, Pool, PoolEndpointConfiguration, PrivateEndpoint, @@ -73,6 +77,7 @@ export { UserIdentity, VirtualMachineConfiguration, VirtualMachineFamilyCoreQuota, + VMExtension, WindowsConfiguration, WindowsUserConfiguration } from "../models/mappers"; diff --git a/sdk/batch/arm-batch/src/models/certificateOperationsMappers.ts b/sdk/batch/arm-batch/src/models/certificateOperationsMappers.ts index 65fd32d7dd8f..a9897569c853 100644 --- a/sdk/batch/arm-batch/src/models/certificateOperationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/certificateOperationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -21,6 +21,9 @@ export { BaseResource, BatchAccount, BatchAccountIdentity, + BatchAccountIdentityUserAssignedIdentitiesValue, + BatchPoolIdentity, + BatchPoolIdentityUserAssignedIdentitiesValue, Certificate, CertificateCancelDeletionHeaders, CertificateCreateHeaders, @@ -52,6 +55,7 @@ export { NetworkConfiguration, NetworkSecurityGroupRule, NFSMountConfiguration, + NodePlacementConfiguration, Pool, PoolEndpointConfiguration, PrivateEndpoint, @@ -72,6 +76,7 @@ export { UserIdentity, VirtualMachineConfiguration, VirtualMachineFamilyCoreQuota, + VMExtension, WindowsConfiguration, WindowsUserConfiguration } from "../models/mappers"; diff --git a/sdk/batch/arm-batch/src/models/index.ts b/sdk/batch/arm-batch/src/models/index.ts index 6db72910d857..6e1f6b536b67 100644 --- a/sdk/batch/arm-batch/src/models/index.ts +++ b/sdk/batch/arm-batch/src/models/index.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -67,6 +67,22 @@ export interface KeyVaultReference { url: string; } +/** + * An interface representing BatchAccountIdentityUserAssignedIdentitiesValue. + */ +export interface BatchAccountIdentityUserAssignedIdentitiesValue { + /** + * The principal id of user assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * The client id of user assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly clientId?: string; +} + /** * The identity of the Batch account, if configured. This is only used when the user specifies * 'Microsoft.KeyVault' as their Batch account encryption configuration. @@ -86,9 +102,15 @@ export interface BatchAccountIdentity { readonly tenantId?: string; /** * The type of identity used for the Batch account. Possible values include: 'SystemAssigned', - * 'None' + * 'UserAssigned', 'None' */ type: ResourceIdentityType; + /** + * The list of user identities associated with the Batch account. The user identity dictionary + * key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + userAssignedIdentities?: { [propertyName: string]: BatchAccountIdentityUserAssignedIdentitiesValue }; } /** @@ -328,7 +350,7 @@ export interface BatchAccount extends Resource { */ readonly dedicatedCoreQuota?: number; /** - * The low-priority core quota for the Batch account. For accounts with PoolAllocationMode set to + * The low priority core quota for the Batch account. For accounts with PoolAllocationMode set to * UserSubscription, quota is managed on the subscription so this value is not returned. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ @@ -341,12 +363,12 @@ export interface BatchAccount extends Resource { */ readonly dedicatedCoreQuotaPerVMFamily?: VirtualMachineFamilyCoreQuota[]; /** - * A value indicating whether the core quota for the Batch Account is enforced per Virtual - * Machine family or not. 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 + * A value indicating whether core quotas per Virtual Machine family are enforced for this + * account. 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. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -804,6 +826,62 @@ export interface DiskEncryptionConfiguration { targets?: DiskEncryptionTarget[]; } +/** + * Allocation configuration used by Batch Service to provision the nodes. + * @summary Node placement configuration for batch pools. + */ +export interface NodePlacementConfiguration { + /** + * Node placement Policy type on Batch Pools. Allocation policy used by Batch Service to + * provision the nodes. If not specified, Batch will use the regional policy. Possible values + * include: 'Regional', 'Zonal' + */ + policy?: NodePlacementPolicyType; +} + +/** + * An interface representing VMExtension. + * @summary The configuration for virtual machine extensions. + */ +export interface VMExtension { + /** + * The name of the virtual machine extension. + */ + name: string; + /** + * The name of the extension handler publisher. + */ + publisher: string; + /** + * The type of the extensions. + */ + type: string; + /** + * The version of script handler. + */ + typeHandlerVersion?: string; + /** + * Indicates whether the extension should use a newer minor version if one is available at + * deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + */ + autoUpgradeMinorVersion?: boolean; + /** + * JSON formatted public settings for the extension. + */ + settings?: any; + /** + * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no + * protected settings at all. + */ + protectedSettings?: any; + /** + * The collection of extension names. Collection of extension names after which this extension + * needs to be provisioned. + */ + provisionAfterExtensions?: string[]; +} + /** * An interface representing VirtualMachineConfiguration. * @summary The configuration for compute nodes in a pool based on the Azure Virtual Machines @@ -856,6 +934,16 @@ export interface VirtualMachineConfiguration { * node in the pool during node provisioning. */ diskEncryptionConfiguration?: DiskEncryptionConfiguration; + /** + * The node placement configuration for the pool. This configuration will specify rules on how + * nodes in the pool will be physically allocated. + */ + nodePlacementConfiguration?: NodePlacementConfiguration; + /** + * The virtual machine extension for the pool. If specified, the extensions mentioned in this + * configuration will be installed on each node. + */ + extensions?: VMExtension[]; } /** @@ -896,7 +984,7 @@ export interface FixedScaleSettings { */ targetDedicatedNodes?: number; /** - * The desired number of low-priority compute nodes in the pool. At least one of + * The desired number of low priority compute nodes in the pool. At least one of * targetDedicatedNodes, targetLowPriorityNodes must be set. */ targetLowPriorityNodes?: number; @@ -1533,7 +1621,7 @@ export interface ResizeOperationStatus { */ targetDedicatedNodes?: number; /** - * The desired number of low-priority compute nodes in the pool. + * The desired number of low priority compute nodes in the pool. */ targetLowPriorityNodes?: number; /** @@ -1706,6 +1794,40 @@ export interface MountConfiguration { azureFileShareConfiguration?: AzureFileShareConfiguration; } +/** + * An interface representing BatchPoolIdentityUserAssignedIdentitiesValue. + */ +export interface BatchPoolIdentityUserAssignedIdentitiesValue { + /** + * The principal id of user assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * The client id of user assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly clientId?: string; +} + +/** + * The identity of the Batch pool, if configured. If the pool identity is updated during update an + * existing pool, only the new vms which are created after the pool shrinks to 0 will have the + * updated identities + */ +export interface BatchPoolIdentity { + /** + * The type of identity used for the Batch Pool. Possible values include: 'UserAssigned', 'None' + */ + type: PoolIdentityType; + /** + * The list of user identities associated with the Batch pool. The user identity dictionary key + * references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + userAssignedIdentities?: { [propertyName: string]: BatchPoolIdentityUserAssignedIdentitiesValue }; +} + /** * Contains information about a pool. */ @@ -1859,6 +1981,10 @@ export interface Pool extends ProxyResource { * CIFS/SMB, and Blobfuse. */ mountConfiguration?: MountConfiguration[]; + /** + * The type of identity used for the Batch Pool. The type of identity used for the Batch Pool. + */ + identity?: BatchPoolIdentity; } /** @@ -1950,6 +2076,16 @@ export interface ApplicationPackageListOptionalParams extends msRest.RequestOpti maxresults?: number; } +/** + * Optional Parameters. + */ +export interface ApplicationPackageListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The maximum number of items to return in the response. + */ + maxresults?: number; +} + /** * Optional Parameters. */ @@ -1970,6 +2106,16 @@ export interface ApplicationListOptionalParams extends msRest.RequestOptionsBase maxresults?: number; } +/** + * Optional Parameters. + */ +export interface ApplicationListNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The maximum number of items to return in the response. + */ + maxresults?: number; +} + /** * Optional Parameters. */ @@ -2022,18 +2168,22 @@ export interface CertificateUpdateOptionalParams extends msRest.RequestOptionsBa /** * Optional Parameters. */ -export interface CertificateBeginCreateOptionalParams extends msRest.RequestOptionsBase { +export interface CertificateListByBatchAccountNextOptionalParams extends msRest.RequestOptionsBase { /** - * The entity state (ETag) version of the certificate to update. A value of "*" can be used to - * apply the operation only if the certificate already exists. If omitted, this operation will - * always be applied. + * The maximum number of items to return in the response. */ - ifMatch?: string; + maxresults?: number; /** - * Set to '*' to allow a new certificate to be created, but to prevent updating an existing - * certificate. Other values will be ignored. + * Comma separated list of properties that should be returned. e.g. + * "properties/provisioningState". Only top level properties under properties/ are valid for + * selection. */ - ifNoneMatch?: string; + select?: string; + /** + * OData filter expression. Valid properties for filtering are "properties/provisioningState", + * "properties/provisioningStateTransitionTime", "name". + */ + filter?: string; } /** @@ -2046,6 +2196,16 @@ export interface PrivateLinkResourceListByBatchAccountOptionalParams extends msR maxresults?: number; } +/** + * Optional Parameters. + */ +export interface PrivateLinkResourceListByBatchAccountNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The maximum number of items to return in the response. + */ + maxresults?: number; +} + /** * Optional Parameters. */ @@ -2078,6 +2238,16 @@ export interface PrivateEndpointConnectionBeginUpdateOptionalParams extends msRe ifMatch?: string; } +/** + * Optional Parameters. + */ +export interface PrivateEndpointConnectionListByBatchAccountNextOptionalParams extends msRest.RequestOptionsBase { + /** + * The maximum number of items to return in the response. + */ + maxresults?: number; +} + /** * Optional Parameters. */ @@ -2140,17 +2310,33 @@ export interface PoolUpdateOptionalParams extends msRest.RequestOptionsBase { /** * Optional Parameters. */ -export interface PoolBeginCreateOptionalParams extends msRest.RequestOptionsBase { +export interface PoolListByBatchAccountNextOptionalParams extends msRest.RequestOptionsBase { /** - * The entity state (ETag) version of the pool to update. A value of "*" can be used to apply the - * operation only if the pool already exists. If omitted, this operation will always be applied. + * The maximum number of items to return in the response. */ - ifMatch?: string; + maxresults?: number; /** - * Set to '*' to allow a new pool to be created, but to prevent updating an existing pool. Other - * values will be ignored. + * Comma separated list of properties that should be returned. e.g. + * "properties/provisioningState". Only top level properties under properties/ are valid for + * selection. */ - ifNoneMatch?: string; + select?: string; + /** + * OData filter expression. Valid properties for filtering are: + * + * name + * properties/allocationState + * properties/allocationStateTransitionTime + * properties/creationTime + * properties/provisioningState + * properties/provisioningStateTransitionTime + * properties/lastModified + * properties/vmSize + * properties/interNodeCommunication + * properties/scaleSettings/autoScale + * properties/scaleSettings/fixedScale + */ + filter?: string; } /** @@ -2464,11 +2650,11 @@ export type PublicNetworkAccessType = 'Enabled' | 'Disabled'; /** * Defines values for ResourceIdentityType. - * Possible values include: 'SystemAssigned', 'None' + * Possible values include: 'SystemAssigned', 'UserAssigned', 'None' * @readonly * @enum {string} */ -export type ResourceIdentityType = 'SystemAssigned' | 'None'; +export type ResourceIdentityType = 'SystemAssigned' | 'UserAssigned' | 'None'; /** * Defines values for ProvisioningState. @@ -2566,6 +2752,14 @@ export type StorageAccountType = 'Standard_LRS' | 'Premium_LRS'; */ export type DiskEncryptionTarget = 'OsDisk' | 'TemporaryDisk'; +/** + * Defines values for NodePlacementPolicyType. + * Possible values include: 'Regional', 'Zonal' + * @readonly + * @enum {string} + */ +export type NodePlacementPolicyType = 'Regional' | 'Zonal'; + /** * Defines values for ComputeNodeDeallocationOption. * Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData' @@ -2662,6 +2856,14 @@ export type CertificateStoreLocation = 'CurrentUser' | 'LocalMachine'; */ export type CertificateVisibility = 'StartTask' | 'Task' | 'RemoteUser'; +/** + * Defines values for PoolIdentityType. + * Possible values include: 'UserAssigned', 'None' + * @readonly + * @enum {string} + */ +export type PoolIdentityType = 'UserAssigned' | 'None'; + /** * Defines values for NameAvailabilityReason. * Possible values include: 'Invalid', 'AlreadyExists' diff --git a/sdk/batch/arm-batch/src/models/locationMappers.ts b/sdk/batch/arm-batch/src/models/locationMappers.ts index ddbec3b47f94..310e30486d3b 100644 --- a/sdk/batch/arm-batch/src/models/locationMappers.ts +++ b/sdk/batch/arm-batch/src/models/locationMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/batch/arm-batch/src/models/mappers.ts b/sdk/batch/arm-batch/src/models/mappers.ts index cc7d3296b2d5..77f407d56a72 100644 --- a/sdk/batch/arm-batch/src/models/mappers.ts +++ b/sdk/batch/arm-batch/src/models/mappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -96,6 +96,30 @@ export const KeyVaultReference: msRest.CompositeMapper = { } }; +export const BatchAccountIdentityUserAssignedIdentitiesValue: msRest.CompositeMapper = { + serializedName: "BatchAccountIdentity_userAssignedIdentitiesValue", + type: { + name: "Composite", + className: "BatchAccountIdentityUserAssignedIdentitiesValue", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + clientId: { + readOnly: true, + serializedName: "clientId", + type: { + name: "String" + } + } + } + } +}; + export const BatchAccountIdentity: msRest.CompositeMapper = { serializedName: "BatchAccountIdentity", type: { @@ -123,9 +147,22 @@ export const BatchAccountIdentity: msRest.CompositeMapper = { name: "Enum", allowedValues: [ "SystemAssigned", + "UserAssigned", "None" ] } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "BatchAccountIdentityUserAssignedIdentitiesValue" + } + } + } } } } @@ -1268,6 +1305,92 @@ export const DiskEncryptionConfiguration: msRest.CompositeMapper = { } }; +export const NodePlacementConfiguration: msRest.CompositeMapper = { + serializedName: "NodePlacementConfiguration", + type: { + name: "Composite", + className: "NodePlacementConfiguration", + modelProperties: { + policy: { + serializedName: "policy", + type: { + name: "Enum", + allowedValues: [ + "Regional", + "Zonal" + ] + } + } + } + } +}; + +export const VMExtension: msRest.CompositeMapper = { + serializedName: "VMExtension", + type: { + name: "Composite", + className: "VMExtension", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + publisher: { + required: true, + serializedName: "publisher", + type: { + name: "String" + } + }, + type: { + required: true, + serializedName: "type", + type: { + name: "String" + } + }, + typeHandlerVersion: { + serializedName: "typeHandlerVersion", + type: { + name: "String" + } + }, + autoUpgradeMinorVersion: { + serializedName: "autoUpgradeMinorVersion", + type: { + name: "Boolean" + } + }, + settings: { + serializedName: "settings", + type: { + name: "Object" + } + }, + protectedSettings: { + serializedName: "protectedSettings", + type: { + name: "Object" + } + }, + provisionAfterExtensions: { + serializedName: "provisionAfterExtensions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + export const VirtualMachineConfiguration: msRest.CompositeMapper = { serializedName: "VirtualMachineConfiguration", type: { @@ -1327,6 +1450,25 @@ export const VirtualMachineConfiguration: msRest.CompositeMapper = { name: "Composite", className: "DiskEncryptionConfiguration" } + }, + nodePlacementConfiguration: { + serializedName: "nodePlacementConfiguration", + type: { + name: "Composite", + className: "NodePlacementConfiguration" + } + }, + extensions: { + serializedName: "extensions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VMExtension" + } + } + } } } } @@ -2441,6 +2583,63 @@ export const MountConfiguration: msRest.CompositeMapper = { } }; +export const BatchPoolIdentityUserAssignedIdentitiesValue: msRest.CompositeMapper = { + serializedName: "BatchPoolIdentity_userAssignedIdentitiesValue", + type: { + name: "Composite", + className: "BatchPoolIdentityUserAssignedIdentitiesValue", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + clientId: { + readOnly: true, + serializedName: "clientId", + type: { + name: "String" + } + } + } + } +}; + +export const BatchPoolIdentity: msRest.CompositeMapper = { + serializedName: "BatchPoolIdentity", + type: { + name: "Composite", + className: "BatchPoolIdentity", + modelProperties: { + type: { + required: true, + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "UserAssigned", + "None" + ] + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "BatchPoolIdentityUserAssignedIdentitiesValue" + } + } + } + } + } + } +}; + export const Pool: msRest.CompositeMapper = { serializedName: "Pool", type: { @@ -2662,6 +2861,13 @@ export const Pool: msRest.CompositeMapper = { } } } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "BatchPoolIdentity" + } } } } diff --git a/sdk/batch/arm-batch/src/models/operationsMappers.ts b/sdk/batch/arm-batch/src/models/operationsMappers.ts index 689688180be7..938d3e665a23 100644 --- a/sdk/batch/arm-batch/src/models/operationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/operationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/batch/arm-batch/src/models/parameters.ts b/sdk/batch/arm-batch/src/models/parameters.ts index 519b835471af..45cfed3924cb 100644 --- a/sdk/batch/arm-batch/src/models/parameters.ts +++ b/sdk/batch/arm-batch/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/batch/arm-batch/src/models/poolOperationsMappers.ts b/sdk/batch/arm-batch/src/models/poolOperationsMappers.ts index ea9ca581dd23..ff65d3036dba 100644 --- a/sdk/batch/arm-batch/src/models/poolOperationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/poolOperationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -21,6 +21,9 @@ export { BaseResource, BatchAccount, BatchAccountIdentity, + BatchAccountIdentityUserAssignedIdentitiesValue, + BatchPoolIdentity, + BatchPoolIdentityUserAssignedIdentitiesValue, Certificate, CertificateCreateOrUpdateParameters, CertificateReference, @@ -47,6 +50,7 @@ export { NetworkConfiguration, NetworkSecurityGroupRule, NFSMountConfiguration, + NodePlacementConfiguration, Pool, PoolCreateHeaders, PoolDeleteHeaders, @@ -73,6 +77,7 @@ export { UserIdentity, VirtualMachineConfiguration, VirtualMachineFamilyCoreQuota, + VMExtension, WindowsConfiguration, WindowsUserConfiguration } from "../models/mappers"; diff --git a/sdk/batch/arm-batch/src/models/privateEndpointConnectionOperationsMappers.ts b/sdk/batch/arm-batch/src/models/privateEndpointConnectionOperationsMappers.ts index a5159c1d441e..cee6ba96674d 100644 --- a/sdk/batch/arm-batch/src/models/privateEndpointConnectionOperationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/privateEndpointConnectionOperationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -21,6 +21,9 @@ export { BaseResource, BatchAccount, BatchAccountIdentity, + BatchAccountIdentityUserAssignedIdentitiesValue, + BatchPoolIdentity, + BatchPoolIdentityUserAssignedIdentitiesValue, Certificate, CertificateCreateOrUpdateParameters, CertificateReference, @@ -47,6 +50,7 @@ export { NetworkConfiguration, NetworkSecurityGroupRule, NFSMountConfiguration, + NodePlacementConfiguration, Pool, PoolEndpointConfiguration, PrivateEndpoint, @@ -68,6 +72,7 @@ export { UserIdentity, VirtualMachineConfiguration, VirtualMachineFamilyCoreQuota, + VMExtension, WindowsConfiguration, WindowsUserConfiguration } from "../models/mappers"; diff --git a/sdk/batch/arm-batch/src/models/privateLinkResourceOperationsMappers.ts b/sdk/batch/arm-batch/src/models/privateLinkResourceOperationsMappers.ts index 69b3e26378ec..5743c0b44375 100644 --- a/sdk/batch/arm-batch/src/models/privateLinkResourceOperationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/privateLinkResourceOperationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -21,6 +21,9 @@ export { BaseResource, BatchAccount, BatchAccountIdentity, + BatchAccountIdentityUserAssignedIdentitiesValue, + BatchPoolIdentity, + BatchPoolIdentityUserAssignedIdentitiesValue, Certificate, CertificateCreateOrUpdateParameters, CertificateReference, @@ -47,6 +50,7 @@ export { NetworkConfiguration, NetworkSecurityGroupRule, NFSMountConfiguration, + NodePlacementConfiguration, Pool, PoolEndpointConfiguration, PrivateEndpoint, @@ -67,6 +71,7 @@ export { UserIdentity, VirtualMachineConfiguration, VirtualMachineFamilyCoreQuota, + VMExtension, WindowsConfiguration, WindowsUserConfiguration } from "../models/mappers"; diff --git a/sdk/batch/arm-batch/src/operations/applicationOperations.ts b/sdk/batch/arm-batch/src/operations/applicationOperations.ts index c96802c24e7e..19bc1d92b35d 100644 --- a/sdk/batch/arm-batch/src/operations/applicationOperations.ts +++ b/sdk/batch/arm-batch/src/operations/applicationOperations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -212,7 +211,7 @@ export class ApplicationOperations { * @param [options] The optional parameters * @returns Promise */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listNext(nextPageLink: string, options?: Models.ApplicationListNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -223,8 +222,8 @@ export class ApplicationOperations { * @param options The optional parameters * @param callback The callback */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listNext(nextPageLink: string, options: Models.ApplicationListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.ApplicationListNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -387,6 +386,10 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.maxresults, + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/batch/arm-batch/src/operations/applicationPackageOperations.ts b/sdk/batch/arm-batch/src/operations/applicationPackageOperations.ts index 6ec032190c81..aa4fae9824f2 100644 --- a/sdk/batch/arm-batch/src/operations/applicationPackageOperations.ts +++ b/sdk/batch/arm-batch/src/operations/applicationPackageOperations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -236,7 +235,7 @@ export class ApplicationPackageOperations { * @param [options] The optional parameters * @returns Promise */ - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listNext(nextPageLink: string, options?: Models.ApplicationPackageListNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -247,8 +246,8 @@ export class ApplicationPackageOperations { * @param options The optional parameters * @param callback The callback */ - listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listNext(nextPageLink: string, options: Models.ApplicationPackageListNextOptionalParams, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: Models.ApplicationPackageListNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -418,6 +417,10 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.maxresults, + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts b/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts index 318548de4ed5..0b262fb48340 100644 --- a/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts +++ b/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -649,6 +648,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -670,6 +672,9 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/batch/arm-batch/src/operations/certificateOperations.ts b/sdk/batch/arm-batch/src/operations/certificateOperations.ts index f8517e31854e..300ef91c8107 100644 --- a/sdk/batch/arm-batch/src/operations/certificateOperations.ts +++ b/sdk/batch/arm-batch/src/operations/certificateOperations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -70,9 +69,39 @@ export class CertificateOperations { * @param [options] The optional parameters * @returns Promise */ - create(resourceGroupName: string, accountName: string, certificateName: string, parameters: Models.CertificateCreateOrUpdateParameters, options?: Models.CertificateCreateOptionalParams): Promise { - return this.beginCreate(resourceGroupName,accountName,certificateName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + create(resourceGroupName: string, accountName: string, certificateName: string, parameters: Models.CertificateCreateOrUpdateParameters, options?: Models.CertificateCreateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @param callback The callback + */ + create(resourceGroupName: string, accountName: string, certificateName: string, parameters: Models.CertificateCreateOrUpdateParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @param options The optional parameters + * @param callback The callback + */ + create(resourceGroupName: string, accountName: string, certificateName: string, parameters: Models.CertificateCreateOrUpdateParameters, options: Models.CertificateCreateOptionalParams, callback: msRest.ServiceCallback): void; + create(resourceGroupName: string, accountName: string, certificateName: string, parameters: Models.CertificateCreateOrUpdateParameters, options?: Models.CertificateCreateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + certificateName, + parameters, + options + }, + createOperationSpec, + callback) as Promise; } /** @@ -226,30 +255,6 @@ export class CertificateOperations { callback) as Promise; } - /** - * Creates a new certificate inside the specified account. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param certificateName The identifier for the certificate. This must be made up of algorithm and - * thumbprint separated by a dash, and must match the certificate data in the request. For example - * SHA1-a3d1c5. - * @param parameters Additional parameters for certificate creation. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreate(resourceGroupName: string, accountName: string, certificateName: string, parameters: Models.CertificateCreateOrUpdateParameters, options?: Models.CertificateBeginCreateOptionalParams): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - accountName, - certificateName, - parameters, - options - }, - beginCreateOperationSpec, - options); - } - /** * Deletes the specified certificate. * @param resourceGroupName The name of the resource group that contains the Batch account. @@ -278,7 +283,7 @@ export class CertificateOperations { * @param [options] The optional parameters * @returns Promise */ - listByBatchAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listByBatchAccountNext(nextPageLink: string, options?: Models.CertificateListByBatchAccountNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -289,8 +294,8 @@ export class CertificateOperations { * @param options The optional parameters * @param callback The callback */ - listByBatchAccountNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByBatchAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByBatchAccountNext(nextPageLink: string, options: Models.CertificateListByBatchAccountNextOptionalParams, callback: msRest.ServiceCallback): void; + listByBatchAccountNext(nextPageLink: string, options?: Models.CertificateListByBatchAccountNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -331,8 +336,8 @@ const listByBatchAccountOperationSpec: msRest.OperationSpec = { serializer }; -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", urlParameters: [ Parameters.resourceGroupName, @@ -345,6 +350,7 @@ const updateOperationSpec: msRest.OperationSpec = { ], headerParameters: [ Parameters.ifMatch, + Parameters.ifNoneMatch, Parameters.acceptLanguage ], requestBody: { @@ -357,18 +363,18 @@ const updateOperationSpec: msRest.OperationSpec = { responses: { 200: { bodyMapper: Mappers.Certificate, - headersMapper: Mappers.CertificateUpdateHeaders + headersMapper: Mappers.CertificateCreateHeaders }, default: { bodyMapper: Mappers.CloudError, - headersMapper: Mappers.CertificateUpdateHeaders + headersMapper: Mappers.CertificateCreateHeaders } }, serializer }; -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", urlParameters: [ Parameters.resourceGroupName, @@ -380,24 +386,32 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.apiVersion ], headerParameters: [ + Parameters.ifMatch, Parameters.acceptLanguage ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.CertificateCreateOrUpdateParameters, + required: true + } + }, responses: { 200: { bodyMapper: Mappers.Certificate, - headersMapper: Mappers.CertificateGetHeaders + headersMapper: Mappers.CertificateUpdateHeaders }, default: { bodyMapper: Mappers.CloudError, - headersMapper: Mappers.CertificateGetHeaders + headersMapper: Mappers.CertificateUpdateHeaders } }, serializer }; -const cancelDeletionOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}/cancelDelete", +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", urlParameters: [ Parameters.resourceGroupName, Parameters.accountName1, @@ -413,19 +427,19 @@ const cancelDeletionOperationSpec: msRest.OperationSpec = { responses: { 200: { bodyMapper: Mappers.Certificate, - headersMapper: Mappers.CertificateCancelDeletionHeaders + headersMapper: Mappers.CertificateGetHeaders }, default: { bodyMapper: Mappers.CloudError, - headersMapper: Mappers.CertificateCancelDeletionHeaders + headersMapper: Mappers.CertificateGetHeaders } }, serializer }; -const beginCreateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", +const cancelDeletionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}/cancelDelete", urlParameters: [ Parameters.resourceGroupName, Parameters.accountName1, @@ -436,25 +450,16 @@ const beginCreateOperationSpec: msRest.OperationSpec = { Parameters.apiVersion ], headerParameters: [ - Parameters.ifMatch, - Parameters.ifNoneMatch, Parameters.acceptLanguage ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.CertificateCreateOrUpdateParameters, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.Certificate, - headersMapper: Mappers.CertificateCreateHeaders + headersMapper: Mappers.CertificateCancelDeletionHeaders }, default: { bodyMapper: Mappers.CloudError, - headersMapper: Mappers.CertificateCreateHeaders + headersMapper: Mappers.CertificateCancelDeletionHeaders } }, serializer @@ -500,6 +505,12 @@ const listByBatchAccountNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.maxresults, + Parameters.select, + Parameters.filter, + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/batch/arm-batch/src/operations/index.ts b/sdk/batch/arm-batch/src/operations/index.ts index f67d0e2219db..313596fde346 100644 --- a/sdk/batch/arm-batch/src/operations/index.ts +++ b/sdk/batch/arm-batch/src/operations/index.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/batch/arm-batch/src/operations/location.ts b/sdk/batch/arm-batch/src/operations/location.ts index 6efd43a3f585..bc114c6653ca 100644 --- a/sdk/batch/arm-batch/src/operations/location.ts +++ b/sdk/batch/arm-batch/src/operations/location.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/batch/arm-batch/src/operations/operations.ts b/sdk/batch/arm-batch/src/operations/operations.ts index b4067f9898f6..85f1828dde4c 100644 --- a/sdk/batch/arm-batch/src/operations/operations.ts +++ b/sdk/batch/arm-batch/src/operations/operations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -108,6 +107,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/batch/arm-batch/src/operations/poolOperations.ts b/sdk/batch/arm-batch/src/operations/poolOperations.ts index 14511c788af0..1029e9a6e018 100644 --- a/sdk/batch/arm-batch/src/operations/poolOperations.ts +++ b/sdk/batch/arm-batch/src/operations/poolOperations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -68,9 +67,35 @@ export class PoolOperations { * @param [options] The optional parameters * @returns Promise */ - create(resourceGroupName: string, accountName: string, poolName: string, parameters: Models.Pool, options?: Models.PoolCreateOptionalParams): Promise { - return this.beginCreate(resourceGroupName,accountName,poolName,parameters,options) - .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + create(resourceGroupName: string, accountName: string, poolName: string, parameters: Models.Pool, options?: Models.PoolCreateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @param callback The callback + */ + create(resourceGroupName: string, accountName: string, poolName: string, parameters: Models.Pool, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @param options The optional parameters + * @param callback The callback + */ + create(resourceGroupName: string, accountName: string, poolName: string, parameters: Models.Pool, options: Models.PoolCreateOptionalParams, callback: msRest.ServiceCallback): void; + create(resourceGroupName: string, accountName: string, poolName: string, parameters: Models.Pool, options?: Models.PoolCreateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + poolName, + parameters, + options + }, + createOperationSpec, + callback) as Promise; } /** @@ -243,28 +268,6 @@ export class PoolOperations { callback) as Promise; } - /** - * Creates a new pool inside the specified account. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param parameters Additional parameters for pool creation. - * @param [options] The optional parameters - * @returns Promise - */ - beginCreate(resourceGroupName: string, accountName: string, poolName: string, parameters: Models.Pool, options?: Models.PoolBeginCreateOptionalParams): Promise { - return this.client.sendLRORequest( - { - resourceGroupName, - accountName, - poolName, - parameters, - options - }, - beginCreateOperationSpec, - options); - } - /** * Deletes the specified pool. * @param resourceGroupName The name of the resource group that contains the Batch account. @@ -291,7 +294,7 @@ export class PoolOperations { * @param [options] The optional parameters * @returns Promise */ - listByBatchAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listByBatchAccountNext(nextPageLink: string, options?: Models.PoolListByBatchAccountNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -302,8 +305,8 @@ export class PoolOperations { * @param options The optional parameters * @param callback The callback */ - listByBatchAccountNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByBatchAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByBatchAccountNext(nextPageLink: string, options: Models.PoolListByBatchAccountNextOptionalParams, callback: msRest.ServiceCallback): void; + listByBatchAccountNext(nextPageLink: string, options?: Models.PoolListByBatchAccountNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -344,8 +347,8 @@ const listByBatchAccountOperationSpec: msRest.OperationSpec = { serializer }; -const updateOperationSpec: msRest.OperationSpec = { - httpMethod: "PATCH", +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", urlParameters: [ Parameters.resourceGroupName, @@ -358,6 +361,7 @@ const updateOperationSpec: msRest.OperationSpec = { ], headerParameters: [ Parameters.ifMatch, + Parameters.ifNoneMatch, Parameters.acceptLanguage ], requestBody: { @@ -370,18 +374,18 @@ const updateOperationSpec: msRest.OperationSpec = { responses: { 200: { bodyMapper: Mappers.Pool, - headersMapper: Mappers.PoolUpdateHeaders + headersMapper: Mappers.PoolCreateHeaders }, default: { bodyMapper: Mappers.CloudError, - headersMapper: Mappers.PoolUpdateHeaders + headersMapper: Mappers.PoolCreateHeaders } }, serializer }; -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", urlParameters: [ Parameters.resourceGroupName, @@ -393,24 +397,32 @@ const getOperationSpec: msRest.OperationSpec = { Parameters.apiVersion ], headerParameters: [ + Parameters.ifMatch, Parameters.acceptLanguage ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Pool, + required: true + } + }, responses: { 200: { bodyMapper: Mappers.Pool, - headersMapper: Mappers.PoolGetHeaders + headersMapper: Mappers.PoolUpdateHeaders }, default: { bodyMapper: Mappers.CloudError, - headersMapper: Mappers.PoolGetHeaders + headersMapper: Mappers.PoolUpdateHeaders } }, serializer }; -const disableAutoScaleOperationSpec: msRest.OperationSpec = { - httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}/disableAutoScale", +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", urlParameters: [ Parameters.resourceGroupName, Parameters.accountName1, @@ -426,19 +438,19 @@ const disableAutoScaleOperationSpec: msRest.OperationSpec = { responses: { 200: { bodyMapper: Mappers.Pool, - headersMapper: Mappers.PoolDisableAutoScaleHeaders + headersMapper: Mappers.PoolGetHeaders }, default: { bodyMapper: Mappers.CloudError, - headersMapper: Mappers.PoolDisableAutoScaleHeaders + headersMapper: Mappers.PoolGetHeaders } }, serializer }; -const stopResizeOperationSpec: msRest.OperationSpec = { +const disableAutoScaleOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}/stopResize", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}/disableAutoScale", urlParameters: [ Parameters.resourceGroupName, Parameters.accountName1, @@ -454,19 +466,19 @@ const stopResizeOperationSpec: msRest.OperationSpec = { responses: { 200: { bodyMapper: Mappers.Pool, - headersMapper: Mappers.PoolStopResizeHeaders + headersMapper: Mappers.PoolDisableAutoScaleHeaders }, default: { bodyMapper: Mappers.CloudError, - headersMapper: Mappers.PoolStopResizeHeaders + headersMapper: Mappers.PoolDisableAutoScaleHeaders } }, serializer }; -const beginCreateOperationSpec: msRest.OperationSpec = { - httpMethod: "PUT", - path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", +const stopResizeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}/stopResize", urlParameters: [ Parameters.resourceGroupName, Parameters.accountName1, @@ -477,25 +489,16 @@ const beginCreateOperationSpec: msRest.OperationSpec = { Parameters.apiVersion ], headerParameters: [ - Parameters.ifMatch, - Parameters.ifNoneMatch, Parameters.acceptLanguage ], - requestBody: { - parameterPath: "parameters", - mapper: { - ...Mappers.Pool, - required: true - } - }, responses: { 200: { bodyMapper: Mappers.Pool, - headersMapper: Mappers.PoolCreateHeaders + headersMapper: Mappers.PoolStopResizeHeaders }, default: { bodyMapper: Mappers.CloudError, - headersMapper: Mappers.PoolCreateHeaders + headersMapper: Mappers.PoolStopResizeHeaders } }, serializer @@ -541,6 +544,12 @@ const listByBatchAccountNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.maxresults, + Parameters.select, + Parameters.filter, + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts b/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts index 3b6040a9c642..b9329a9b1c99 100644 --- a/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts +++ b/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -144,7 +143,7 @@ export class PrivateEndpointConnectionOperations { * @param [options] The optional parameters * @returns Promise */ - listByBatchAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listByBatchAccountNext(nextPageLink: string, options?: Models.PrivateEndpointConnectionListByBatchAccountNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -155,8 +154,8 @@ export class PrivateEndpointConnectionOperations { * @param options The optional parameters * @param callback The callback */ - listByBatchAccountNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByBatchAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByBatchAccountNext(nextPageLink: string, options: Models.PrivateEndpointConnectionListByBatchAccountNextOptionalParams, callback: msRest.ServiceCallback): void; + listByBatchAccountNext(nextPageLink: string, options?: Models.PrivateEndpointConnectionListByBatchAccountNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -270,6 +269,10 @@ const listByBatchAccountNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion, + Parameters.maxresults + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/batch/arm-batch/src/operations/privateLinkResourceOperations.ts b/sdk/batch/arm-batch/src/operations/privateLinkResourceOperations.ts index d27dfdc6ccfc..7b84efa05565 100644 --- a/sdk/batch/arm-batch/src/operations/privateLinkResourceOperations.ts +++ b/sdk/batch/arm-batch/src/operations/privateLinkResourceOperations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -103,7 +102,7 @@ export class PrivateLinkResourceOperations { * @param [options] The optional parameters * @returns Promise */ - listByBatchAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + listByBatchAccountNext(nextPageLink: string, options?: Models.PrivateLinkResourceListByBatchAccountNextOptionalParams): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -114,8 +113,8 @@ export class PrivateLinkResourceOperations { * @param options The optional parameters * @param callback The callback */ - listByBatchAccountNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByBatchAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + listByBatchAccountNext(nextPageLink: string, options: Models.PrivateLinkResourceListByBatchAccountNextOptionalParams, callback: msRest.ServiceCallback): void; + listByBatchAccountNext(nextPageLink: string, options?: Models.PrivateLinkResourceListByBatchAccountNextOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, @@ -187,6 +186,10 @@ const listByBatchAccountNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion, + Parameters.maxresults + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/batch/arm-batch/test/batchManagementClient.spec.ts b/sdk/batch/arm-batch/test/batchManagementClient.spec.ts deleted file mode 100644 index 974f8dd717bd..000000000000 --- a/sdk/batch/arm-batch/test/batchManagementClient.spec.ts +++ /dev/null @@ -1,576 +0,0 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ -import { BatchManagementClient, BatchManagementModels } from "../src/batchManagementClient"; -import { describe, beforeEach } from "mocha"; -import { assert } from "chai"; -import * as dotenv from "dotenv"; -import * as util from "util"; -import * as fs from "fs"; -import { AuthenticationContext } from "adal-node"; -import { TokenCredentials, RestError, ServiceClient, WebResource } from "@azure/ms-rest-js"; -import { CertificateCreateOrUpdateParameters } from "../src/models"; - -dotenv.config(); - -describe("Batch Management Service", () => { - let client: BatchManagementClient; - let subscriptionId: string; - let clientId: string; - let secret: string; - let tenant: string; - let location: string; - let autoStorage: string; - let batchAccount: string; - let groupName: string; - - async function getAppOnlyToken(clientId, secret) { - const authContext = new AuthenticationContext( - "https://login.microsoftonline.com/microsoft.onmicrosoft.com" - ); - return new Promise((resolve, reject) => { - authContext.acquireTokenWithClientCredentials( - "https://management.core.windows.net/", - clientId, - secret, - (err, token) => { - if (err) { - reject(err); - } else { - resolve(token.accessToken); - } - } - ); - }); - } - - beforeEach(async () => { - subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]!; - location = process.env["AZURE_TEST_LOCATION"]!; - autoStorage = process.env["AZURE_AUTOSTORAGE"]!; - batchAccount = "batchtestnodesdk"; - groupName = util.format("default-azurebatch-%s", location); - clientId = process.env["AZURE_CLIENT_ID"]; - secret = process.env["AZURE_CLIENT_SECRET"]; - tenant = process.env["AZURE_TENANT_ID"]; - - const token = await getAppOnlyToken(clientId, secret); - const tokenCreds = new TokenCredentials(token, "Bearer"); - client = new BatchManagementClient(tokenCreds, subscriptionId); - }); - - describe("operations", () => { - it("should list Batch operations successfully", async () => { - const result = await client.operations.list(); - assert.isNotNull(result); - assert.isAtLeast(result.length, 50); - assert.equal( - result[0].name, - "Microsoft.Batch/batchAccounts/providers/Microsoft.Insights/diagnosticSettings/read" - ); - assert.equal(result[0].origin, "system"); - assert.equal(result[0].display.provider, "Microsoft Batch"); - assert.equal(result[0].display.operation, "Read diagnostic setting"); - }); - - it("should get subscription quota successfully", async () => { - const result = await client.location.getQuotas(location); - assert.exists(result); - assert.equal(result.accountQuota, 1); - }); - - it("should check name available successfully", async () => { - let name = "randombatch8374652387"; - const result = await client.location.checkNameAvailability(location, name); - assert.exists(result); - assert.isTrue(result.nameAvailable); - }); - - it("should create a batch account successfully", async () => { - var resource = util.format( - "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Storage/storageAccounts/%s", - subscriptionId, - groupName, - autoStorage - ); - var params = { location: location, autoStorage: { storageAccountId: resource } }; - const result = await client.batchAccount.create(groupName, batchAccount, params); - assert.exists(result); - assert.equal(result.location, location); - assert.equal(result.poolQuota, 100); - assert.equal(result.dedicatedCoreQuota, 700); - assert.equal(result.lowPriorityCoreQuota, 500); - }); - - it("should add application successfully", async () => { - var params = { allowUpdates: true, displayName: "my_application_name" }; - var options = { parameters: params }; - const result = await client.application.create( - groupName, - batchAccount, - "my_application_id", - options - ); - assert.exists(result); - assert.equal(result.name, "my_application_id"); - }); - - it("should get application successfully", async () => { - const result = await client.application.get(groupName, batchAccount, "my_application_id"); - assert.exists(result); - assert.equal(result.name, "my_application_id"); - assert.equal(result.displayName, "my_application_name"); - }); - - it("should get a list of applications successfully", async () => { - const result = await client.application.list(groupName, batchAccount); - assert.exists(result); - assert.isAtLeast(result.length, 1); - }); - - it("should add application package successfully", async () => { - const result = await client.applicationPackage.create( - groupName, - batchAccount, - "my_application_id", - "v1.0" - ); - assert.exists(result); - assert.equal(result._response.status, 200); - assert.equal(result.name, "v1.0"); - console.log(result); - console.log(__dirname); - fs.writeFileSync(__dirname + "/test_package.zip", "Hey there!"); - var fileContent = fs.createReadStream(__dirname + "/test_package.zip"); - var httpRequest = new WebResource(); - var serviceClient = new ServiceClient(); - httpRequest.method = "PUT"; - httpRequest.headers = {}; - httpRequest.headers["x-ms-blob-type"] = "BlockBlob"; - httpRequest.headers["Content-Length"] = "10"; - httpRequest.url = result.storageUrl; - httpRequest.body = fileContent; - httpRequest.streamedResponse = true; - var upload = serviceClient.sendRequest(httpRequest, function(err, response) { - assert.exists(response); - assert.equal(response.statusCode, 201); - }); - }); - - it("should add second application package successfully", async () => { - const result = await client.applicationPackage.create( - groupName, - batchAccount, - "my_application_id", - "v2.0" - ); - assert.exists(result); - assert.equal(result._response.status, 200); - }); - - it("should list application packages successfully", async () => { - const result = await client.applicationPackage.list( - groupName, - batchAccount, - "my_application_id" - ); - assert.isAtLeast(result.length, 1); - }); - - it("should activate application package successfully", async () => { - const result = await client.applicationPackage.activate( - groupName, - batchAccount, - "my_application_id", - "v1.0", - "zip" - ); - assert.exists(result); - assert.equal(result._response.status, 200); - }); - - it("should fail to activate application package", async () => { - try { - await client.applicationPackage.activate( - groupName, - batchAccount, - "my_application_id", - "v2.0", - "zip" - ); - assert.fail("No error thrown"); - } catch (err) { - if (err instanceof RestError) { - assert.equal(err.response.status, 409); - assert.equal(err.body.code, "ApplicationPackageBlobNotFound"); - } else { - assert.fail(`Caught error but wasn't a RestError: ${err}`); - } - } - }); - - it("should fail to update application", async () => { - var params = { allowUpdates: false, displayName: "my_updated_name", defaultVersion: "v2.0" }; - try { - await client.application.update(groupName, batchAccount, "my_application_id", params); - assert.fail("No error thrown"); - } catch (err) { - if (err instanceof RestError) { - assert.equal(err.response.status, 409); - assert.equal(err.body.code, "RequestedDefaultVersionNotActive"); - } else { - assert.fail(`Caught error but wasn't a RestError: ${err}`); - } - } - }); - - it("should update application successfully", async () => { - var params = { allowUpdates: false, displayName: "my_updated_name", defaultVersion: "v1.0" }; - const result = await client.application.update( - groupName, - batchAccount, - "my_application_id", - params - ); - assert.equal(result._response.status, 200); - }); - - it("should get application package successfully", async () => { - const result = await client.applicationPackage.get( - groupName, - batchAccount, - "my_application_id", - "v1.0" - ); - assert.exists(result); - assert.equal(result._response.status, 200); - }); - - it("should delete application package successfully", async () => { - const result = await client.applicationPackage.deleteMethod( - groupName, - batchAccount, - "my_application_id", - "v1.0" - ); - assert.equal(result._response.status, 200); - }); - - it("should fail to delete application", async () => { - try { - await client.application.deleteMethod(groupName, batchAccount, "my_application_id"); - assert.fail("No error thrown"); - } catch (err) { - if (err instanceof RestError) { - assert.equal(err.response.status, 409); - assert.equal(err.body.code, "ApplicationPackagesNotEmpty"); - } else { - assert.fail(`Caught error but wasn't a RestError: ${err}`); - } - } - }); - - it("should delete second application package successfully", async () => { - const result = await client.applicationPackage.deleteMethod( - groupName, - batchAccount, - "my_application_id", - "v2.0" - ); - assert.equal(result._response.status, 200); - }); - - it("should delete application successfully", async () => { - const result = await client.application.deleteMethod( - groupName, - batchAccount, - "my_application_id" - ); - assert.equal(result._response.status, 200); - }); - - it("should fail to create a batch account due to dupilcate location", async () => { - var params = { location: location }; - try { - await client.batchAccount.create(groupName, "batchtestnodesdk2", params); - assert.fail("No error thrown"); - } catch (err) { - console.log(err); - } - //This fails after the initial create request - so error isn't surfaced. - }); - - it("should fail to create a batch account due to invalid resource group", async () => { - var params = { location: location }; - try { - await client.batchAccount.create("does-not-exist", batchAccount, params); - assert.fail("No error thrown"); - } catch (err) { - if (err instanceof RestError) { - assert.equal(err.response.status, 404); - assert.equal(err.body.code, "ResourceGroupNotFound"); - } else { - assert.fail(`Caught error but wasn't a RestError: ${err}`); - } - } - //This fails on the initial create request - so we can check the error. - }); - - it("should get a specific account info successfully", async () => { - const result = await client.batchAccount.get(groupName, batchAccount); - assert.exists(result); - assert.equal(result.name, batchAccount); - assert.equal(result.location, location); - assert.equal(result._response.status, 200); - }); - - it("should list accounts successfully", async () => { - const result = await client.batchAccount.list(); - assert.exists(result); - assert.isAtLeast(result.length, 1); - var sorted = result.sort(function(a, b) { - if (a.name < b.name) { - return -1; - } - return 1; - }); - assert.equal(sorted[0].name, batchAccount); - assert.equal(sorted[0].location, location); - }); - - it("should list accounts by resource group successfully", async () => { - const result = await client.batchAccount.listByResourceGroup(groupName); - assert.exists(result); - assert.isAtLeast(result.length, 1); - assert.equal(result[0].name, batchAccount); - assert.equal(result[0].location, location); - }); - - it("should get account keys successfully", async () => { - const result = await client.batchAccount.getKeys(groupName, batchAccount); - assert.exists(result); - assert.exists(result.accountName); - assert.exists(result.primary); - assert.exists(result.secondary); - }); - - it("should regenerate keys successfully", async () => { - const result = await client.batchAccount.regenerateKey(groupName, batchAccount, "Primary"); - assert.exists(result); - assert.exists(result.primary); - assert.exists(result.secondary); - }); - - it("should sync auto storage keys successfully", async () => { - const result = await client.batchAccount.synchronizeAutoStorageKeys(groupName, batchAccount); - assert.equal(result._response.status, 204); - }); - - it("should update account successfully", async () => { - var tags = { tags: { Name: "tagName", Value: "tagValue" } }; - const result = await client.batchAccount.update(groupName, batchAccount, tags); - assert.exists(result); - assert.equal(result.tags.Name, "tagName"); - assert.equal(result.tags.Value, "tagValue"); - }); - - it("should add certificate successfully", async () => { - var certificate = "SHA1-cff2ab63c8c955aaf71989efa641b906558d9fb7"; - var parameters: CertificateCreateOrUpdateParameters = { - thumbprint: "cff2ab63c8c955aaf71989efa641b906558d9fb7", - thumbprintAlgorithm: "sha1", - data: - "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", - format: "Pfx", - password: "nodesdk" - }; - const result = await client.certificate.create( - groupName, - batchAccount, - certificate, - parameters - ); - assert.exists(result); - assert.equal(result.name, "sha1-cff2ab63c8c955aaf71989efa641b906558d9fb7"); - }); - - it("should list certificates successfully", async () => { - const result = await client.certificate.listByBatchAccount(groupName, batchAccount); - assert.exists(result); - assert.equal(result.length, 1); - }); - - it("should get certificate successfully", async () => { - var certificate = "SHA1-cff2ab63c8c955aaf71989efa641b906558d9fb7"; - const result = await client.certificate.get(groupName, batchAccount, certificate); - assert.exists(result); - assert.equal(result.name, "sha1-cff2ab63c8c955aaf71989efa641b906558d9fb7"); - assert.equal(result.thumbprintAlgorithm, "sha1"); - assert.equal(result.thumbprint, "cff2ab63c8c955aaf71989efa641b906558d9fb7"); - }); - - it("should update certificate successfully", async () => { - var certificate = "SHA1-cff2ab63c8c955aaf71989efa641b906558d9fb7"; - var parameters: CertificateCreateOrUpdateParameters = { - password: "nodesdk", - data: - "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" - }; - const result = await client.certificate.update( - groupName, - batchAccount, - certificate, - parameters - ); - assert.exists(result); - assert.equal(result.name, "sha1-cff2ab63c8c955aaf71989efa641b906558d9fb7"); - }); - - it("shoud delete certificate successfully", async () => { - var certificate = "SHA1-cff2ab63c8c955aaf71989efa641b906558d9fb7"; - const result = await client.certificate.deleteMethod(groupName, batchAccount, certificate); - }); - - it("should create a paas pool successfully", async () => { - var paas_pool = "test_paas_pool"; - var parameters = { - displayName: "test_pool", - vmSize: "small", - deploymentConfiguration: { - cloudServiceConfiguration: { - osFamily: "5" - } - }, - startTask: { - commandLine: 'cmd.exe /c "echo hello world"', - resourceFiles: [{ httpUrl: "https://blobsource.com", filePath: "filename.txt" }], - environmentSettings: [{ name: "ENV_VAR", value: "foo" }], - userIdentity: { - autoUser: { - elevationLevel: "admin" - } - } - }, - userAccounts: [{ name: "UserName", password: "p@55wOrd" }], - scaleSettings: { - fixedScale: { - targetDedicatedNodes: 0, - targetLowPriorityNodes: 0 - } - } - }; - const result = await client.pool.create(groupName, batchAccount, paas_pool, parameters); - assert.exists(result); - assert.equal(result.name, paas_pool); - }); - - it("should create a iaas pool successfully", async () => { - var iaas_pool = "test_iaas_pool"; - var parameters = { - displayName: "test_pool", - vmSize: "Standard_A1", - deploymentConfiguration: { - virtualMachineConfiguration: { - imageReference: { - publisher: "MicrosoftWindowsServer", - offer: "WindowsServer", - sku: "2016-Datacenter-smalldisk" - }, - nodeAgentSkuId: "batch.node.windows amd64", - windowsConfiguration: { enableAutomaticUpdates: true } - } - }, - scaleSettings: { - fixedScale: { - targetDedicatedNodes: 0, - targetLowPriorityNodes: 0 - } - } - }; - const result = await client.pool.create(groupName, batchAccount, iaas_pool, parameters); - assert.exists(result); - assert.equal(result.name, iaas_pool); - }); - - it("should list pools successfully", async () => { - const result = await client.pool.listByBatchAccount(groupName, batchAccount); - assert.exists(result); - assert.equal(result.length, 2); - }); - - it("should update pool successfully", async () => { - var iaas_pool = "test_iaas_pool"; - var parameters = { - autoScale: { - formula: "$TargetDedicatedNodes=1" - } - }; - const result = await client.pool.update(groupName, batchAccount, iaas_pool, parameters); - assert.exists(result); - assert.equal(result.name, iaas_pool); - }); - - it("should get pool successfully", async () => { - var iaas_pool = "test_iaas_pool"; - const result = await client.pool.get(groupName, batchAccount, iaas_pool); - assert.exists(result); - assert.equal(result.name, iaas_pool); - assert.equal(result.vmSize, "STANDARD_A1"); - }); - - it("should delete pool successfully", async () => { - var iaas_pool = "test_iaas_pool"; - await client.pool.deleteMethod(groupName, batchAccount, iaas_pool); - var paas_pool = "test_paas_pool"; - await client.pool.deleteMethod(groupName, batchAccount, paas_pool); - }); - - it("should delete a batch account successfully", async () => { - const result = await client.batchAccount.deleteMethod(groupName, batchAccount); - }); - - it("should fail to create a BYOS account with bad KeyVault properties", async () => { - var byosAccountName = "batchtestnodesdkbyos"; - var allocationMode = "UserSubscription"; - - // Omit keyVaultReference - var params = { - location: location, - poolAllocationMode: allocationMode - }; - - try { - await client.batchAccount.create(groupName, byosAccountName, params); - assert.fail("No error thrown"); - } catch (err) { - if (err instanceof RestError) { - assert.equal(err.response.status, 400); - assert.equal(err.body.code, "InvalidRequestBody"); - } else { - assert.fail(`Caught error but wasn't a RestError: ${err}`); - } - } - - // Use malformed key vault parameter values - var params1 = { - location: location, - poolAllocationMode: allocationMode, - keyVaultReference: { - id: "abc", - url: "def" - } - }; - - try { - await client.batchAccount.create(groupName, byosAccountName, params1); - assert.fail("No error thrown"); - } catch (err) { - console.log(err); - if (err instanceof RestError) { - assert.equal(err.response.status, 400); - assert.equal(err.body.code, "LinkedInvalidPropertyId"); - } else { - assert.fail(`Caught error but wasn't a RestError: ${err}`); - } - } - }); - }); -}); diff --git a/sdk/batch/arm-batch/test/sample.env b/sdk/batch/arm-batch/test/sample.env deleted file mode 100644 index d5472d5d1ed2..000000000000 --- a/sdk/batch/arm-batch/test/sample.env +++ /dev/null @@ -1,15 +0,0 @@ -# First create a Service Principal for the subscription you wish to test against. -# Follow the instructions here on creating a Service Principal using the Azure CLI: -# https://github.com/Azure/azure-sdk-for-node/blob/master/Documentation/Authentication.md -AZURE_SUBSCRIPTION_ID= -AZURE_CLIENT_ID= -AZURE_CLIENT_SECRET= -AZURE_TENANT_ID= -# The tests are configured by default to run with in japaneast, using a resource group of -# 'default-azurebatch-japaneast'. To change this location set: -AZURE_TEST_LOCATION="japaneast" -# The tests require a storage account to be configured. Using the CLI: -# >> az storage account create -n -l -g --sku Standard_LRS -# The tests have been configured against nodesdkteststorage. If you have set up -# a different name, then set this var: -AZURE_AUTOSTORAGE="nodesdkteststorage" \ No newline at end of file