From da5ecc8dad7f4ff61b4d533b9c485fda46c5c786 Mon Sep 17 00:00:00 2001 From: huizlAzure Date: Wed, 27 Mar 2019 12:42:23 -0700 Subject: [PATCH] Add Lease Container API Swagger & example in Jul18. --- .../stable/2018-07-01/blob.json | 95 +++++++++++++++++++ .../examples/BlobContainersLease.json | 31 ++++++ 2 files changed, 126 insertions(+) create mode 100644 specification/storage/resource-manager/Microsoft.Storage/stable/2018-07-01/examples/BlobContainersLease.json diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2018-07-01/blob.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2018-07-01/blob.json index ad6bdfecb437..2a1ad988b010 100644 --- a/specification/storage/resource-manager/Microsoft.Storage/stable/2018-07-01/blob.json +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2018-07-01/blob.json @@ -684,6 +684,53 @@ } } }, + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease": { + "post": { + "tags": [ + "BlobContainers" + ], + "operationId": "BlobContainers_Lease", + "x-ms-examples": { + "ListContainers": { + "$ref": "./examples/BlobContainersLease.json" + } + }, + "description": "The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.", + "parameters": [ + { + "$ref": "./storage.json#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/AccountName" + }, + { + "$ref": "#/parameters/ContainerName" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "parameters", + "in": "body", + "schema": { + "$ref": "#/definitions/LeaseContainerRequest" + }, + "description": "Lease Container request body." + } + ], + "responses": { + "200": { + "description": "OK -- Lease Container operation completed successfully.", + "schema": { + "$ref": "#/definitions/LeaseContainerResponse" + } + } + } + } + }, "definitions": { "ContainerProperties": { "properties": { @@ -1104,6 +1151,54 @@ "allowedHeaders" ], "description": "Specifies a CORS rule for the Blob service." + }, + "LeaseContainerRequest": { + "properties": { + "Action": { + "type": "string", + "enum": [ + "Acquire", + "Renew", + "Change", + "Release", + "Break" + ], + "description": "Specifies the lease action. Can be one of the available actions." + }, + "LeaseId": { + "type": "string", + "description": "Identifies the lease. Can be specified in any valid GUID string format." + }, + "BreakPeriod": { + "type": "integer", + "description": "Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60." + }, + "LeaseDuration": { + "type": "integer", + "description": "Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires." + }, + "ProposedLeaseId": { + "type": "string", + "description": "Optional for acquire, required for change. Proposed lease ID, in a GUID string format." + } + }, + "required": [ + "Action" + ], + "description": "Lease Container request schema." + }, + "LeaseContainerResponse": { + "properties": { + "LeaseId": { + "type": "string", + "description": "Returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release the lease." + }, + "LeaseTimeSeconds": { + "type": "string", + "description": "Approximate time remaining in the lease period, in seconds." + } + }, + "description": "Lease Container response schema." } }, "parameters": { diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2018-07-01/examples/BlobContainersLease.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2018-07-01/examples/BlobContainersLease.json new file mode 100644 index 000000000000..18c697021828 --- /dev/null +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2018-07-01/examples/BlobContainersLease.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "res3376", + "accountName": "sto328", + "containerName": "container6185", + "api-version": "2018-07-01", + "monitor": "true", + "parameters": { + "properties": { + "Action": 0, + "LeaseId": null, + "BreakPeriod": null, + "LeaseDuration": -1, + "ProposedLeaseId": null + } + } + }, + "responses": { + "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": { + "LeaseId": "8698f513-fa75-44a1-b8eb-30ba336af27d" + } + } + } + } +} \ No newline at end of file