diff --git a/sdk/batch/arm-batch/src/batchManagementClientContext.ts b/sdk/batch/arm-batch/src/batchManagementClientContext.ts index 0ec37cb4c252..bcbef4b857e7 100644 --- a/sdk/batch/arm-batch/src/batchManagementClientContext.ts +++ b/sdk/batch/arm-batch/src/batchManagementClientContext.ts @@ -45,7 +45,7 @@ export class BatchManagementClientContext extends msRestAzure.AzureServiceClient super(credentials, options); - this.apiVersion = '2020-03-01'; + this.apiVersion = '2020-05-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/batch/arm-batch/src/models/applicationOperationsMappers.ts b/sdk/batch/arm-batch/src/models/applicationOperationsMappers.ts index 96538f65692b..5a3c50ebbc1b 100644 --- a/sdk/batch/arm-batch/src/models/applicationOperationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/applicationOperationsMappers.ts @@ -20,6 +20,7 @@ export { AzureFileShareConfiguration, BaseResource, BatchAccount, + BatchAccountIdentity, Certificate, CertificateCreateOrUpdateParameters, CertificateReference, diff --git a/sdk/batch/arm-batch/src/models/applicationPackageOperationsMappers.ts b/sdk/batch/arm-batch/src/models/applicationPackageOperationsMappers.ts index ec2e257ecf04..a498cd5da71f 100644 --- a/sdk/batch/arm-batch/src/models/applicationPackageOperationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/applicationPackageOperationsMappers.ts @@ -21,6 +21,7 @@ export { AzureFileShareConfiguration, BaseResource, BatchAccount, + BatchAccountIdentity, Certificate, CertificateCreateOrUpdateParameters, CertificateReference, diff --git a/sdk/batch/arm-batch/src/models/batchAccountOperationsMappers.ts b/sdk/batch/arm-batch/src/models/batchAccountOperationsMappers.ts index d9ace5cc1ace..4488249bd7f1 100644 --- a/sdk/batch/arm-batch/src/models/batchAccountOperationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/batchAccountOperationsMappers.ts @@ -23,6 +23,7 @@ export { BatchAccountCreateHeaders, BatchAccountCreateParameters, BatchAccountDeleteHeaders, + BatchAccountIdentity, BatchAccountKeys, BatchAccountListResult, BatchAccountRegenerateKeyParameters, diff --git a/sdk/batch/arm-batch/src/models/certificateOperationsMappers.ts b/sdk/batch/arm-batch/src/models/certificateOperationsMappers.ts index c1b3701bebb8..65fd32d7dd8f 100644 --- a/sdk/batch/arm-batch/src/models/certificateOperationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/certificateOperationsMappers.ts @@ -20,6 +20,7 @@ export { AzureFileShareConfiguration, BaseResource, BatchAccount, + BatchAccountIdentity, Certificate, CertificateCancelDeletionHeaders, CertificateCreateHeaders, diff --git a/sdk/batch/arm-batch/src/models/index.ts b/sdk/batch/arm-batch/src/models/index.ts index 2a931fbe2cf0..f02708f74d6b 100644 --- a/sdk/batch/arm-batch/src/models/index.ts +++ b/sdk/batch/arm-batch/src/models/index.ts @@ -22,18 +22,25 @@ export interface AutoStorageBaseProperties { } /** - * An interface representing KeyVaultProperties. + * KeyVault configuration when using an encryption KeySource of Microsoft.KeyVault. */ export interface KeyVaultProperties { /** * Full path to the versioned secret. Example - * https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053 + * https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053. To be usable + * the following prerequisites must be met: + * + * The Batch Account has a System Assigned identity + * The account identity has been granted Key/Get, Key/Unwrap and Key/Wrap permissions + * The KeyVault has soft-delete and purge protection enabled */ keyIdentifier?: string; } /** - * An interface representing EncryptionProperties. + * 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 { /** @@ -60,6 +67,30 @@ export interface KeyVaultReference { url: string; } +/** + * The identity of the Batch account, if configured. This is only used when the user specifies + * 'Azure.KeyVault' as their Batch account encryption configuration. + */ +export interface BatchAccountIdentity { + /** + * The principal id of the Batch account. This property will only be provided for a system + * assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * The tenant id associated with the Batch account. This property will only be provided for a + * system assigned identity. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly tenantId?: string; + /** + * The type of identity used for the Batch account. Possible values include: 'SystemAssigned', + * 'None' + */ + type: ResourceIdentityType; +} + /** * Parameters supplied to the Create operation. */ @@ -94,9 +125,15 @@ export interface BatchAccountCreateParameters { */ publicNetworkAccess?: PublicNetworkAccessType; /** - * The encryption configuration for the Batch account. + * The encryption configuration for the Batch account. 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; + /** + * The identity of the Batch account. + */ + identity?: BatchAccountIdentity; } /** @@ -278,8 +315,10 @@ export interface BatchAccount extends Resource { */ readonly autoStorage?: AutoStorageProperties; /** - * The encryption configuration for the Batch account. **NOTE: This property will not be - * serialized. It can only be populated by the server.** + * The encryption configuration for the Batch account. 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. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly encryption?: EncryptionProperties; /** @@ -323,6 +362,10 @@ export interface BatchAccount extends Resource { * serialized. It can only be populated by the server.** */ readonly activeJobAndJobScheduleQuota?: number; + /** + * The identity of the Batch account. + */ + identity?: BatchAccountIdentity; } /** @@ -338,9 +381,15 @@ export interface BatchAccountUpdateParameters { */ autoStorage?: AutoStorageBaseProperties; /** - * The encryption configuration for the Batch account. + * The encryption configuration for the Batch account. 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; + /** + * The identity of the Batch account. + */ + identity?: BatchAccountIdentity; } /** @@ -2016,6 +2065,17 @@ export interface PrivateEndpointConnectionUpdateOptionalParams extends msRest.Re ifMatch?: string; } +/** + * Optional Parameters. + */ +export interface PrivateEndpointConnectionBeginUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * The state (ETag) version of the private endpoint connection to update. This value can be + * omitted or set to "*" to apply the operation unconditionally. + */ + ifMatch?: string; +} + /** * Optional Parameters. */ @@ -2196,11 +2256,14 @@ export interface CertificateCancelDeletionHeaders { */ export interface PrivateEndpointConnectionUpdateHeaders { /** - * 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. + * The URL of the resource used to check the status of the asynchronous operation. */ - eTag: string; + location: string; + /** + * Suggested delay to check the status of the asynchronous operation. The value is an integer + * that represents the seconds. + */ + retryAfter: number; } /** @@ -2397,6 +2460,14 @@ export type PoolAllocationMode = 'BatchService' | 'UserSubscription'; */ export type PublicNetworkAccessType = 'Enabled' | 'Disabled'; +/** + * Defines values for ResourceIdentityType. + * Possible values include: 'SystemAssigned', 'None' + * @readonly + * @enum {string} + */ +export type ResourceIdentityType = 'SystemAssigned' | 'None'; + /** * Defines values for ProvisioningState. * Possible values include: 'Invalid', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Cancelled' diff --git a/sdk/batch/arm-batch/src/models/mappers.ts b/sdk/batch/arm-batch/src/models/mappers.ts index d51c8d95fa3b..35bf7f10f24e 100644 --- a/sdk/batch/arm-batch/src/models/mappers.ts +++ b/sdk/batch/arm-batch/src/models/mappers.ts @@ -96,6 +96,41 @@ export const KeyVaultReference: msRest.CompositeMapper = { } }; +export const BatchAccountIdentity: msRest.CompositeMapper = { + serializedName: "BatchAccountIdentity", + type: { + name: "Composite", + className: "BatchAccountIdentity", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", + type: { + name: "String" + } + }, + type: { + required: true, + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "SystemAssigned", + "None" + ] + } + } + } + } +}; + export const BatchAccountCreateParameters: msRest.CompositeMapper = { serializedName: "BatchAccountCreateParameters", type: { @@ -161,6 +196,13 @@ export const BatchAccountCreateParameters: msRest.CompositeMapper = { name: "Composite", className: "EncryptionProperties" } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "BatchAccountIdentity" + } } } } @@ -533,6 +575,13 @@ export const BatchAccount: msRest.CompositeMapper = { type: { name: "Number" } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "BatchAccountIdentity" + } } } } @@ -568,6 +617,13 @@ export const BatchAccountUpdateParameters: msRest.CompositeMapper = { name: "Composite", className: "EncryptionProperties" } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "BatchAccountIdentity" + } } } } @@ -2877,11 +2933,17 @@ export const PrivateEndpointConnectionUpdateHeaders: msRest.CompositeMapper = { name: "Composite", className: "PrivateEndpointConnectionUpdateHeaders", modelProperties: { - eTag: { - serializedName: "etag", + location: { + serializedName: "location", type: { name: "String" } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } } } } diff --git a/sdk/batch/arm-batch/src/models/parameters.ts b/sdk/batch/arm-batch/src/models/parameters.ts index e37994087d8e..519b835471af 100644 --- a/sdk/batch/arm-batch/src/models/parameters.ts +++ b/sdk/batch/arm-batch/src/models/parameters.ts @@ -180,9 +180,9 @@ export const privateEndpointConnectionName: msRest.OperationURLParameter = { required: true, serializedName: "privateEndpointConnectionName", constraints: { - MaxLength: 64, + MaxLength: 101, MinLength: 1, - Pattern: /^[a-zA-Z0-9_-]+$/ + Pattern: /^[a-zA-Z0-9_-]+\.?[a-fA-F0-9-]*$/ }, type: { name: "String" @@ -195,9 +195,9 @@ export const privateLinkResourceName: msRest.OperationURLParameter = { required: true, serializedName: "privateLinkResourceName", constraints: { - MaxLength: 64, + MaxLength: 101, MinLength: 1, - Pattern: /^[a-zA-Z0-9_-]+$/ + Pattern: /^[a-zA-Z0-9_-]+\.?[a-fA-F0-9-]*$/ }, type: { name: "String" diff --git a/sdk/batch/arm-batch/src/models/poolOperationsMappers.ts b/sdk/batch/arm-batch/src/models/poolOperationsMappers.ts index ca4618c11467..ea9ca581dd23 100644 --- a/sdk/batch/arm-batch/src/models/poolOperationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/poolOperationsMappers.ts @@ -20,6 +20,7 @@ export { AzureFileShareConfiguration, BaseResource, BatchAccount, + BatchAccountIdentity, Certificate, CertificateCreateOrUpdateParameters, CertificateReference, diff --git a/sdk/batch/arm-batch/src/models/privateEndpointConnectionOperationsMappers.ts b/sdk/batch/arm-batch/src/models/privateEndpointConnectionOperationsMappers.ts index ea09506a5bf8..a5159c1d441e 100644 --- a/sdk/batch/arm-batch/src/models/privateEndpointConnectionOperationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/privateEndpointConnectionOperationsMappers.ts @@ -20,6 +20,7 @@ export { AzureFileShareConfiguration, BaseResource, BatchAccount, + BatchAccountIdentity, Certificate, CertificateCreateOrUpdateParameters, CertificateReference, diff --git a/sdk/batch/arm-batch/src/models/privateLinkResourceOperationsMappers.ts b/sdk/batch/arm-batch/src/models/privateLinkResourceOperationsMappers.ts index bf2ba4e42af2..69b3e26378ec 100644 --- a/sdk/batch/arm-batch/src/models/privateLinkResourceOperationsMappers.ts +++ b/sdk/batch/arm-batch/src/models/privateLinkResourceOperationsMappers.ts @@ -20,6 +20,7 @@ export { AzureFileShareConfiguration, BaseResource, BatchAccount, + BatchAccountIdentity, Certificate, CertificateCreateOrUpdateParameters, CertificateReference, diff --git a/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts b/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts index a68e152d7359..0927ab240bb8 100644 --- a/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts +++ b/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts @@ -9,6 +9,7 @@ */ import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as Models from "../models"; import * as Mappers from "../models/privateEndpointConnectionOperationsMappers"; import * as Parameters from "../models/parameters"; @@ -108,30 +109,24 @@ export class PrivateEndpointConnectionOperations { * @param [options] The optional parameters * @returns Promise */ - update(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, parameters: Models.PrivateEndpointConnection, options?: Models.PrivateEndpointConnectionUpdateOptionalParams): Promise; - /** - * @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 parameters PrivateEndpointConnection properties that should be updated. Properties that - * are supplied will be updated, any property not supplied will be unchanged. - * @param callback The callback - */ - update(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, parameters: Models.PrivateEndpointConnection, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, parameters: Models.PrivateEndpointConnection, options?: Models.PrivateEndpointConnectionUpdateOptionalParams): Promise { + return this.beginUpdate(resourceGroupName,accountName,privateEndpointConnectionName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + /** + * Updates the properties of an existing 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 parameters PrivateEndpointConnection properties that should be updated. Properties that * are supplied will be updated, any property not supplied will be unchanged. - * @param options The optional parameters - * @param callback The callback + * @param [options] The optional parameters + * @returns Promise */ - update(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, parameters: Models.PrivateEndpointConnection, options: Models.PrivateEndpointConnectionUpdateOptionalParams, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, parameters: Models.PrivateEndpointConnection, options?: Models.PrivateEndpointConnectionUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( + beginUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, parameters: Models.PrivateEndpointConnection, options?: Models.PrivateEndpointConnectionBeginUpdateOptionalParams): Promise { + return this.client.sendLRORequest( { resourceGroupName, accountName, @@ -139,8 +134,8 @@ export class PrivateEndpointConnectionOperations { parameters, options }, - updateOperationSpec, - callback) as Promise; + beginUpdateOperationSpec, + options); } /** @@ -226,7 +221,7 @@ const getOperationSpec: msRest.OperationSpec = { serializer }; -const updateOperationSpec: msRest.OperationSpec = { +const beginUpdateOperationSpec: msRest.OperationSpec = { httpMethod: "PATCH", path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", urlParameters: [ @@ -254,6 +249,12 @@ const updateOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.PrivateEndpointConnection, headersMapper: Mappers.PrivateEndpointConnectionUpdateHeaders }, + 202: { + headersMapper: Mappers.PrivateEndpointConnectionUpdateHeaders + }, + 204: { + headersMapper: Mappers.PrivateEndpointConnectionUpdateHeaders + }, default: { bodyMapper: Mappers.CloudError }