From 0388b5b797048afe77f066833d8b4c8870afb505 Mon Sep 17 00:00:00 2001 From: Himanshu Chhabra Date: Sun, 28 Feb 2021 17:03:29 -0800 Subject: [PATCH 1/4] Adding, vlw propert at container level, example. Add Vlw migrate api with example --- .../stable/2021-01-01/blob.json | 75 +++++++++++++++++++ .../BlobContainersPutVersionLevelWorm.json | 43 +++++++++++ .../VersionLevelWormContainerMigration.json | 15 ++++ 3 files changed, 133 insertions(+) create mode 100644 specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/examples/BlobContainersPutVersionLevelWorm.json create mode 100644 specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/examples/VersionLevelWormContainerMigration.json diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json index 89bb9b6975c1..5e9c7ecef447 100644 --- a/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json @@ -815,6 +815,45 @@ } } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate": { + "put": { + "tags": [ + "BlobContainers" + ], + "operationId": "BlobContainers_VersionLevelWorm", + "x-ms-examples": { + "VersionLevelWormContainerMigration": { + "$ref": "./examples/VersionLevelWormContainerMigration.json" + } + }, + "description": "This operation migrates a blob container from container level WORM to version level WORM enabled container. Pre-requisits require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled and there should be no Legal holds.", + "parameters": [ + { + "$ref": "./storage.json#/parameters/ResourceGroupName" + }, + { + "$ref": "./storage.json#/parameters/StorageAccountName" + }, + { + "$ref": "#/parameters/ContainerName" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK -- returned when the blob container migration to support version level WORM completes." + }, + "202": { + "description": "Accepted -- Blob Container migration to support version leve worm is accepted; operation will complete asynchronously." + } + } + } } }, "definitions": { @@ -937,6 +976,11 @@ "type": "boolean", "readOnly": true, "description": "The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container." + }, + "versionLevelWorm": { + "$ref": "#/definitions/VersionLevelWorm", + "x-ms-client-flatten": true, + "description": "The version level worm property of the container." } }, "description": "The properties of a container." @@ -1024,6 +1068,37 @@ ], "description": "The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag." }, + "VersionLevelWorm": { + "properties": { + "enabled": { + "type": "boolean", + "description": "This is an immutable property, when set to true enables version level worm at the container level." + }, + "timeStamp": { + "type": "string", + "format": "date-time", + "readOnly": true, + "description": "Returns the date and time the version level worm was enabled." + }, + "migrationState": { + "type": "string", + "readOnly": true, + "enum": [ + "InProgress", + "Completed" + ], + "x-ms-enum": { + "name": "MigrationState", + "modelAsString": true + }, + "description": "This property denotes the container level worm to version level worm migration state." + } + }, + "required": [ + "enabled" + ], + "description": "Version level worm properties of the container." + }, "UpdateHistoryProperty": { "properties": { "update": { diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/examples/BlobContainersPutVersionLevelWorm.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/examples/BlobContainersPutVersionLevelWorm.json new file mode 100644 index 000000000000..8b7ecc10b32b --- /dev/null +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/examples/BlobContainersPutVersionLevelWorm.json @@ -0,0 +1,43 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "res3376", + "accountName": "sto328", + "containerName": "container6185", + "api-version": "2021-01-01", + "monitor": "true", + "blobContainer": { + "properties": { + "versionLevelWorm": { + "enabled": "true" + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/res3376/providers/Microsoft.Storage/storageAccounts/sto328/blobServices/default/containers/container6185", + "name": "container6185", + "type": "Microsoft.Storage/storageAccounts/blobServices/containers", + "properties": { + "versionLevelWorm": { + "enabled": "true" + } + } + } + }, + "200": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/res3376/providers/Microsoft.Storage/storageAccounts/sto328/blobServices/default/containers/container6185", + "name": "container6185", + "type": "Microsoft.Storage/storageAccounts/blobServices/containers", + "properties": { + "versionLevelWorm": { + "enabled": "true" + } + } + } + } + } +} diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/examples/VersionLevelWormContainerMigration.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/examples/VersionLevelWormContainerMigration.json new file mode 100644 index 000000000000..3a8d72ce0428 --- /dev/null +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/examples/VersionLevelWormContainerMigration.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "res1782", + "accountName": "sto7069", + "containerName": "container6397", + "immutabilityPolicyName": "default", + "api-version": "2021-01-01", + "monitor": "true" + }, + "responses": { + "200": {}, + "202": {} + } +} From 4c74d90dc25677d902b0fa042e4a1717071fa48f Mon Sep 17 00:00:00 2001 From: Himanshu Chhabra Date: Mon, 8 Mar 2021 19:40:49 -0800 Subject: [PATCH 2/4] Add Async tag to migration api --- .../Microsoft.Storage/stable/2021-01-01/blob.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json index 5e9c7ecef447..ad60291d97ec 100644 --- a/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json @@ -827,7 +827,7 @@ "$ref": "./examples/VersionLevelWormContainerMigration.json" } }, - "description": "This operation migrates a blob container from container level WORM to version level WORM enabled container. Pre-requisits require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled and there should be no Legal holds.", + "description": "This operation migrates a blob container from container level WORM to version level WORM enabled container. Prerequisites require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled and there should be no Legal holds.", "parameters": [ { "$ref": "./storage.json#/parameters/ResourceGroupName" @@ -852,7 +852,8 @@ "202": { "description": "Accepted -- Blob Container migration to support version leve worm is accepted; operation will complete asynchronously." } - } + }, + "x-ms-long-running-operation": true } } }, From ce54543d6110b03aeedf0980e2415846d2e91638 Mon Sep 17 00:00:00 2001 From: Himanshu Chhabra Date: Mon, 8 Mar 2021 19:54:48 -0800 Subject: [PATCH 3/4] Add Abort state --- .../Microsoft.Storage/stable/2021-01-01/blob.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json index ad60291d97ec..360f75afc4ed 100644 --- a/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json @@ -1086,7 +1086,8 @@ "readOnly": true, "enum": [ "InProgress", - "Completed" + "Completed", + "Abort" ], "x-ms-enum": { "name": "MigrationState", From 7edd466b7e24db9ee6dc1752627d8d10752a1c65 Mon Sep 17 00:00:00 2001 From: Himanshu Chhabra Date: Wed, 10 Mar 2021 20:29:44 -0800 Subject: [PATCH 4/4] Undo enable field as require, update comment --- .../Microsoft.Storage/stable/2021-01-01/blob.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json index 360f75afc4ed..d42b90880074 100644 --- a/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2021-01-01/blob.json @@ -981,7 +981,7 @@ "versionLevelWorm": { "$ref": "#/definitions/VersionLevelWorm", "x-ms-client-flatten": true, - "description": "The version level worm property of the container." + "description": "The version level worm property of the container. The property is immutable and can only be set to true at the container creation time. Existing containers must undergo a migration process." } }, "description": "The properties of a container." @@ -1096,9 +1096,6 @@ "description": "This property denotes the container level worm to version level worm migration state." } }, - "required": [ - "enabled" - ], "description": "Version level worm properties of the container." }, "UpdateHistoryProperty": {