From 2887974656e99481784dbedda60d579fb1b7e9ca Mon Sep 17 00:00:00 2001 From: Zhenfeng Date: Wed, 20 Nov 2019 15:09:43 -0800 Subject: [PATCH 1/7] [SRP] Add new property EnabledProtocols for file shares Approved in private branch. --- .../examples/FileSharesPut_NFS.json | 37 ++++++ .../stable/2019-06-01/file.json | 110 +++++++++++++++++- 2 files changed, 144 insertions(+), 3 deletions(-) create mode 100644 specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/examples/FileSharesPut_NFS.json diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/examples/FileSharesPut_NFS.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/examples/FileSharesPut_NFS.json new file mode 100644 index 000000000000..dfc1bd7b0285 --- /dev/null +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/examples/FileSharesPut_NFS.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "subscriptionId": "{subscription-id}", + "resourceGroupName": "res346", + "accountName": "sto666", + "shareName": "share1235", + "api-version": "2019-06-01", + "monitor": "true", + "fileShare": { + "properties": { + "enabledProtocols": "NFS" + } + } + }, + "responses": { + "201": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/res346/providers/Microsoft.Storage/storageAccounts/sto666/fileServices/default/shares/share1235", + "name": "share1235", + "type": "Microsoft.Storage/storageAccounts/fileServices/shares", + "properties": { + "enabledProtocols": "NFS" + } + } + }, + "200": { + "body": { + "id": "/subscriptions/{subscription-id}/resourceGroups/res346/providers/Microsoft.Storage/storageAccounts/sto666/fileServices/default/shares/share1235", + "name": "share1235", + "type": "Microsoft.Storage/storageAccounts/fileServices/shares", + "properties": { + "enabledProtocols": "NFS" + } + } + } + } +} diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json index 03684e8c5818..3024931749f3 100644 --- a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json @@ -219,8 +219,11 @@ ], "operationId": "FileShares_Create", "x-ms-examples": { - "PutShares": { + "Create Shares": { "$ref": "./examples/FileSharesPut.json" + }, + "Create NFS Shares": { + "$ref": "./examples/FileSharesPut_NFS.json" } }, "description": "Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. ", @@ -239,7 +242,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/FileShare" + "$ref": "#/definitions/FileShareCreateParameters" }, "description": "Properties of the file share to create." }, @@ -297,7 +300,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/FileShare" + "$ref": "#/definitions/FileShareUpdateParameters" }, "description": "Properties to update for the file share." }, @@ -524,10 +527,111 @@ "minimum": 1, "maximum": 5120, "description": "The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120)." + }, + "enabledProtocols": { + "type": "string", + "enum": [ + "SMB", + "NFS" + ], + "x-ms-enum": { + "name": "EnabledProtocols", + "modelAsString": true + }, + "description": "Protocols for file shares" + }, + "rootSquash": { + "type": "string", + "enum": [ + "NoRootSquash", + "RootSquash", + "AllSquash" + ], + "x-ms-enum": { + "name": "RootSquash", + "modelAsString": true + }, + "description": "Reduction of the access rights for the remote superuser." } }, "description": "The properties of the file share." }, + "FileShareCreateParameters": { + "properties": { + "properties": { + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A name-value pair to associate with the share as metadata." + }, + "shareQuota": { + "type": "integer", + "minimum": 1, + "maximum": 5120, + "description": "The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120)." + }, + "enabledProtocols": { + "type": "string", + "enum": [ + "SMB", + "NFS" + ], + "x-ms-enum": { + "name": "EnabledProtocols", + "modelAsString": true + }, + "description": "Protocols for file shares. It cannot be changed after file share creation." + }, + "rootSquash": { + "type": "string", + "enum": [ + "NoRootSquash", + "RootSquash", + "AllSquash" + ], + "x-ms-enum": { + "name": "RootSquash", + "modelAsString": true + }, + "description": "Reduction of the access rights for the remote superuser." + } + } + } + }, + "FileShareUpdateParameters": { + "properties": { + "properties": { + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "A name-value pair to associate with the share as metadata." + }, + "shareQuota": { + "type": "integer", + "minimum": 1, + "maximum": 5120, + "description": "The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120)." + }, + "rootSquash": { + "type": "string", + "enum": [ + "NoRootSquash", + "RootSquash", + "AllSquash" + ], + "x-ms-enum": { + "name": "RootSquash", + "modelAsString": true + }, + "description": "Reduction of the access rights for the remote superuser." + } + } + } + }, "CloudError": { "x-ms-external": true, "properties": { From 86273705d1b043887d3072bf899e4350a3b5e87a Mon Sep 17 00:00:00 2001 From: Zhenfeng Date: Wed, 20 Nov 2019 16:33:16 -0800 Subject: [PATCH 2/7] Fix addtional properties issue --- .../stable/2019-06-01/file.json | 121 +++++++++--------- 1 file changed, 58 insertions(+), 63 deletions(-) diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json index 3024931749f3..d16cba9d3c33 100644 --- a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json @@ -315,8 +315,7 @@ "200": { "description": "OK -- Update Share operation completed successfully.", "schema": { - "$ref": "#/definitions/FileShare", - "description": "Properties of the updated file share." + "$ref": "#/definitions/FileShare" } }, "default": { @@ -558,77 +557,73 @@ }, "FileShareCreateParameters": { "properties": { - "properties": { - "metadata": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "A name-value pair to associate with the share as metadata." + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" }, - "shareQuota": { - "type": "integer", - "minimum": 1, - "maximum": 5120, - "description": "The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120)." + "description": "A name-value pair to associate with the share as metadata." + }, + "shareQuota": { + "type": "integer", + "minimum": 1, + "maximum": 5120, + "description": "The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120)." + }, + "enabledProtocols": { + "type": "string", + "enum": [ + "SMB", + "NFS" + ], + "x-ms-enum": { + "name": "EnabledProtocols", + "modelAsString": true }, - "enabledProtocols": { - "type": "string", - "enum": [ - "SMB", - "NFS" - ], - "x-ms-enum": { - "name": "EnabledProtocols", - "modelAsString": true - }, - "description": "Protocols for file shares. It cannot be changed after file share creation." + "description": "Protocols for file shares. It cannot be changed after file share creation." + }, + "rootSquash": { + "type": "string", + "enum": [ + "NoRootSquash", + "RootSquash", + "AllSquash" + ], + "x-ms-enum": { + "name": "RootSquash", + "modelAsString": true }, - "rootSquash": { - "type": "string", - "enum": [ - "NoRootSquash", - "RootSquash", - "AllSquash" - ], - "x-ms-enum": { - "name": "RootSquash", - "modelAsString": true - }, - "description": "Reduction of the access rights for the remote superuser." - } + "description": "Reduction of the access rights for the remote superuser." } } }, "FileShareUpdateParameters": { "properties": { - "properties": { - "metadata": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "A name-value pair to associate with the share as metadata." + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" }, - "shareQuota": { - "type": "integer", - "minimum": 1, - "maximum": 5120, - "description": "The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120)." + "description": "A name-value pair to associate with the share as metadata." + }, + "shareQuota": { + "type": "integer", + "minimum": 1, + "maximum": 5120, + "description": "The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120)." + }, + "rootSquash": { + "type": "string", + "enum": [ + "NoRootSquash", + "RootSquash", + "AllSquash" + ], + "x-ms-enum": { + "name": "RootSquash", + "modelAsString": true }, - "rootSquash": { - "type": "string", - "enum": [ - "NoRootSquash", - "RootSquash", - "AllSquash" - ], - "x-ms-enum": { - "name": "RootSquash", - "modelAsString": true - }, - "description": "Reduction of the access rights for the remote superuser." - } + "description": "Reduction of the access rights for the remote superuser." } } }, From f64f9016f52e585e3cfb0dcd41d2f3b6caa6b1af Mon Sep 17 00:00:00 2001 From: Zhenfeng Date: Wed, 20 Nov 2019 16:51:28 -0800 Subject: [PATCH 3/7] Fixing... --- .../stable/2019-06-01/file.json | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json index d16cba9d3c33..a7977760e70f 100644 --- a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json @@ -473,6 +473,24 @@ ], "description": "Properties of the file share, including Id, resource name, resource type, Etag." }, + "FileShareCreateParameters": { + "properties": { + "properties": { + "$ref": "#/definitions/FileSharePropertiesCreateParameters", + "description": "Properties of the file share to create the file share." + } + }, + "description": "The parameters used to create the file share." + }, + "FileShareUpdateParameters": { + "properties": { + "properties": { + "$ref": "#/definitions/FileSharePropertiesUpdateParameters", + "description": "Properties of the file share to update the file share." + } + }, + "description": "The parameters used to create the file share." + }, "FileShareItem": { "properties": { "properties": { @@ -555,7 +573,7 @@ }, "description": "The properties of the file share." }, - "FileShareCreateParameters": { + "FileSharePropertiesCreateParameters": { "properties": { "metadata": { "type": "object", @@ -597,7 +615,7 @@ } } }, - "FileShareUpdateParameters": { + "FileSharePropertiesUpdateParameters": { "properties": { "metadata": { "type": "object", From b442fadb122b023a4b2a9a0333d13c0c10ca310a Mon Sep 17 00:00:00 2001 From: Zhenfeng Date: Fri, 22 Nov 2019 13:22:43 -0800 Subject: [PATCH 4/7] Remove create and update params --- .../stable/2019-06-01/file.json | 94 +------------------ 1 file changed, 2 insertions(+), 92 deletions(-) diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json index a7977760e70f..83dc04b8b05e 100644 --- a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json @@ -242,7 +242,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/FileShareCreateParameters" + "$ref": "#/definitions/FileShare" }, "description": "Properties of the file share to create." }, @@ -300,7 +300,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/FileShareUpdateParameters" + "$ref": "#/definitions/FileShare" }, "description": "Properties to update for the file share." }, @@ -473,24 +473,6 @@ ], "description": "Properties of the file share, including Id, resource name, resource type, Etag." }, - "FileShareCreateParameters": { - "properties": { - "properties": { - "$ref": "#/definitions/FileSharePropertiesCreateParameters", - "description": "Properties of the file share to create the file share." - } - }, - "description": "The parameters used to create the file share." - }, - "FileShareUpdateParameters": { - "properties": { - "properties": { - "$ref": "#/definitions/FileSharePropertiesUpdateParameters", - "description": "Properties of the file share to update the file share." - } - }, - "description": "The parameters used to create the file share." - }, "FileShareItem": { "properties": { "properties": { @@ -573,78 +555,6 @@ }, "description": "The properties of the file share." }, - "FileSharePropertiesCreateParameters": { - "properties": { - "metadata": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "A name-value pair to associate with the share as metadata." - }, - "shareQuota": { - "type": "integer", - "minimum": 1, - "maximum": 5120, - "description": "The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120)." - }, - "enabledProtocols": { - "type": "string", - "enum": [ - "SMB", - "NFS" - ], - "x-ms-enum": { - "name": "EnabledProtocols", - "modelAsString": true - }, - "description": "Protocols for file shares. It cannot be changed after file share creation." - }, - "rootSquash": { - "type": "string", - "enum": [ - "NoRootSquash", - "RootSquash", - "AllSquash" - ], - "x-ms-enum": { - "name": "RootSquash", - "modelAsString": true - }, - "description": "Reduction of the access rights for the remote superuser." - } - } - }, - "FileSharePropertiesUpdateParameters": { - "properties": { - "metadata": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "A name-value pair to associate with the share as metadata." - }, - "shareQuota": { - "type": "integer", - "minimum": 1, - "maximum": 5120, - "description": "The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120)." - }, - "rootSquash": { - "type": "string", - "enum": [ - "NoRootSquash", - "RootSquash", - "AllSquash" - ], - "x-ms-enum": { - "name": "RootSquash", - "modelAsString": true - }, - "description": "Reduction of the access rights for the remote superuser." - } - } - }, "CloudError": { "x-ms-external": true, "properties": { From 06c3a7cc714d606337e3e2f8bd2b0ed25b2ec3e3 Mon Sep 17 00:00:00 2001 From: Zhenfeng Date: Mon, 25 Nov 2019 19:27:39 -0800 Subject: [PATCH 5/7] Update file.json --- .../Microsoft.Storage/stable/2019-06-01/file.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json index 9ac3302b1c5c..d7d7512fbf2b 100644 --- a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json @@ -219,7 +219,7 @@ ], "operationId": "FileShares_Create", "x-ms-examples": { - "Create Shares": { + "PutShares": { "$ref": "./examples/FileSharesPut.json" }, "Create NFS Shares": { @@ -315,7 +315,8 @@ "200": { "description": "OK -- Update Share operation completed successfully.", "schema": { - "$ref": "#/definitions/FileShare" + "$ref": "#/definitions/FileShare", + "description": "Properties of the updated file share." } }, "default": { From 5676940b4b36d93378b6a7d096a07bb86ed0c826 Mon Sep 17 00:00:00 2001 From: Zhenfeng Date: Mon, 25 Nov 2019 20:11:08 -0800 Subject: [PATCH 6/7] Update file.json --- .../Microsoft.Storage/stable/2019-06-01/file.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json index d7d7512fbf2b..720eb8902b25 100644 --- a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json @@ -548,7 +548,7 @@ "AllSquash" ], "x-ms-enum": { - "name": "RootSquash", + "name": "RootSquashType", "modelAsString": true }, "description": "Reduction of the access rights for the remote superuser." From dbef20a68bbcd16f46655937689b957cd22bbd7f Mon Sep 17 00:00:00 2001 From: Zhenfeng Date: Mon, 2 Dec 2019 10:10:30 -0800 Subject: [PATCH 7/7] Update file.json --- .../Microsoft.Storage/stable/2019-06-01/file.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json index 720eb8902b25..6512b31287e5 100644 --- a/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json +++ b/specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/file.json @@ -538,7 +538,8 @@ "name": "EnabledProtocols", "modelAsString": true }, - "description": "Protocols for file shares" + "description": "Immutable property for file shares protocol.", + "x-ms-mutability": ["create", "read"] }, "rootSquash": { "type": "string",