From a64df9bbf66b26a700cea37342788bfb99d1f5d5 Mon Sep 17 00:00:00 2001 From: Xiaoning Liu Date: Tue, 28 Jul 2020 17:28:22 +0800 Subject: [PATCH] Add continueOnFailure option for set AccessControlRecursive methods --- .../review/storage-file-datalake.api.md | 1 + sdk/storage/storage-file-datalake/src/clients.ts | 1 + .../src/generated/src/models/index.ts | 16 ++++++++++++++++ .../src/generated/src/models/parameters.ts | 12 ++++++++++++ .../generated/src/operations/pathOperations.ts | 2 ++ sdk/storage/storage-file-datalake/src/models.ts | 8 ++++++++ .../storage-file-datalake/swagger/README.md | 2 +- 7 files changed, 41 insertions(+), 1 deletion(-) diff --git a/sdk/storage/storage-file-datalake/review/storage-file-datalake.api.md b/sdk/storage/storage-file-datalake/review/storage-file-datalake.api.md index 13f72fdd5ad3..9aabfd238b1d 100644 --- a/sdk/storage/storage-file-datalake/review/storage-file-datalake.api.md +++ b/sdk/storage/storage-file-datalake/review/storage-file-datalake.api.md @@ -894,6 +894,7 @@ export interface PathChangeAccessControlRecursiveOptions extends CommonOptions { abortSignal?: AbortSignalLike; batchSize?: number; continuationToken?: string; + continueOnFailure?: boolean; maxBatches?: number; onProgress?: (progress: AccessControlChanges) => void; } diff --git a/sdk/storage/storage-file-datalake/src/clients.ts b/sdk/storage/storage-file-datalake/src/clients.ts index a2bac0f9180d..32c82edb80e5 100644 --- a/sdk/storage/storage-file-datalake/src/clients.ts +++ b/sdk/storage/storage-file-datalake/src/clients.ts @@ -162,6 +162,7 @@ export class DataLakePathClient extends StorageClient { acl: toAclString(acl as PathAccessControlItem[]), maxRecords: options.batchSize, continuation: continuationToken, + forceFlag: options.continueOnFailure, spanOptions }); batchCounter++; diff --git a/sdk/storage/storage-file-datalake/src/generated/src/models/index.ts b/sdk/storage/storage-file-datalake/src/generated/src/models/index.ts index 5befeea12216..735bd4798dd7 100644 --- a/sdk/storage/storage-file-datalake/src/generated/src/models/index.ts +++ b/sdk/storage/storage-file-datalake/src/generated/src/models/index.ts @@ -474,6 +474,14 @@ export interface PathUpdateOptionalParams extends coreHttp.RequestOptionsBase { * operation. */ continuation?: string; + /** + * Optional. Valid for "SetAccessControlRecursive" operation. If set to false, the operation will + * terminate quickly on encountering user errors (4XX). If true, the operation will ignore user + * errors and proceed with the operation on other sub-entities of the directory. Continuation + * token will only be returned when forceFlag is true in case of user errors. If not set the + * default value is false for this. + */ + forceFlag?: boolean; /** * This parameter allows the caller to upload data in parallel and control the order in which it * is appended to the file. It is required when uploading data to be appended to the file and @@ -787,6 +795,14 @@ export interface PathSetAccessControlRecursiveOptionalParams extends coreHttp.Re * continue deleting the directory. */ continuation?: string; + /** + * Optional. Valid for "SetAccessControlRecursive" operation. If set to false, the operation will + * terminate quickly on encountering user errors (4XX). If true, the operation will ignore user + * errors and proceed with the operation on other sub-entities of the directory. Continuation + * token will only be returned when forceFlag is true in case of user errors. If not set the + * default value is false for this. + */ + forceFlag?: boolean; /** * Optional. It specifies the maximum number of files or directories on which the acl change will * be applied. If omitted or greater than 2,000, the request will process up to 2,000 items diff --git a/sdk/storage/storage-file-datalake/src/generated/src/models/parameters.ts b/sdk/storage/storage-file-datalake/src/generated/src/models/parameters.ts index cb9a8ccbce69..af7eb24d3d4f 100644 --- a/sdk/storage/storage-file-datalake/src/generated/src/models/parameters.ts +++ b/sdk/storage/storage-file-datalake/src/generated/src/models/parameters.ts @@ -254,6 +254,18 @@ export const expiryOptions: coreHttp.OperationParameter = { } } }; +export const forceFlag: coreHttp.OperationQueryParameter = { + parameterPath: [ + "options", + "forceFlag" + ], + mapper: { + serializedName: "forceFlag", + type: { + name: "Boolean" + } + } +}; export const group: coreHttp.OperationParameter = { parameterPath: [ "options", diff --git a/sdk/storage/storage-file-datalake/src/generated/src/operations/pathOperations.ts b/sdk/storage/storage-file-datalake/src/generated/src/operations/pathOperations.ts index e8457dddec57..9f27255728c7 100644 --- a/sdk/storage/storage-file-datalake/src/generated/src/operations/pathOperations.ts +++ b/sdk/storage/storage-file-datalake/src/generated/src/operations/pathOperations.ts @@ -478,6 +478,7 @@ const updateOperationSpec: coreHttp.OperationSpec = { Parameters.maxRecords, Parameters.continuation, Parameters.mode1, + Parameters.forceFlag, Parameters.position, Parameters.retainUncommittedData, Parameters.close, @@ -727,6 +728,7 @@ const setAccessControlRecursiveOperationSpec: coreHttp.OperationSpec = { Parameters.timeout, Parameters.continuation, Parameters.mode1, + Parameters.forceFlag, Parameters.maxRecords, Parameters.action3 ], diff --git a/sdk/storage/storage-file-datalake/src/models.ts b/sdk/storage/storage-file-datalake/src/models.ts index 4db720ba1fd5..c60fe19b3883 100644 --- a/sdk/storage/storage-file-datalake/src/models.ts +++ b/sdk/storage/storage-file-datalake/src/models.ts @@ -558,6 +558,14 @@ export interface PathChangeAccessControlRecursiveOptions extends CommonOptions { * @memberof PathChangeAccessControlRecursiveOptions */ maxBatches?: number; + /** + * Optional. Default false. If set to false, the operation will terminate quickly on encountering user failures. + * If true, the operation will ignore user failures and proceed with the operation on other sub-entities of the directory. + * + * @type {boolean} + * @memberof PathChangeAccessControlRecursiveOptions + */ + continueOnFailure?: boolean; /** * Continuation token to continue next batch of operations. * diff --git a/sdk/storage/storage-file-datalake/swagger/README.md b/sdk/storage/storage-file-datalake/swagger/README.md index 41af38754bf1..49530c04181e 100644 --- a/sdk/storage/storage-file-datalake/swagger/README.md +++ b/sdk/storage/storage-file-datalake/swagger/README.md @@ -12,7 +12,7 @@ enable-xml: true generate-metadata: false license-header: MICROSOFT_MIT_NO_VERSION output-folder: ../src/generated -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/storage-dataplane-preview/specification/storage/data-plane/Microsoft.StorageDataLake/stable/2019-12-12/DataLakeStorage.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/storage-dataplane-preview/specification/storage/data-plane/Microsoft.StorageDataLake/stable/2020-02-10/DataLakeStorage.json model-date-time-as-string: true optional-response-headers: true enum-types: true