-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[SRP] Add new property EnabledProtocols for file shares #7815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
2887974
8627370
f64f901
b442fad
1cdc3aa
06c3a7c
5676940
dbef20a
c95b01e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Approved in private branch.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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": { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding writable fields to a stable api version is seen as a breaking change and requires a new api version. See the section labeled 'New property added to response' in the following link. This was introduced long back to prevent breaking previous versions of the sdk.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From the server side, if the new properties did not show up in the request, we will no wipe them out. We have a lot of experience in adding new properties to storage account in the existing API version. It (Get-Put model) is not a concern from my prospect.. |
||
| "type": "string", | ||
| "enum": [ | ||
| "SMB", | ||
| "NFS" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "EnabledProtocols", | ||
| "modelAsString": true | ||
| }, | ||
| "description": "Protocols for file shares" | ||
| }, | ||
| "rootSquash": { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The enum name is same as one of it's value (both "RootSquash"). This will make the .NET SDK code generated from it build fail. |
||
| "type": "string", | ||
| "enum": [ | ||
| "NoRootSquash", | ||
| "RootSquash", | ||
| "AllSquash" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "RootSquash", | ||
| "modelAsString": true | ||
| }, | ||
| "description": "Reduction of the access rights for the remote superuser." | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add more description for What's the effect when specify each of the 3 values. What's the default value. |
||
| } | ||
| }, | ||
| "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": { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you forking the body definition for create/put? With the readonly fields of FileShare, FileShareCreateParameters is effectively the same. Doing this will generate a 2 classes the user would interact with for no real reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EnabledProtocol is the property that can only be set at creation. We can stay with one body definition. But customer will be confused since enabledProtocol cannot be updated.