Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[SRP] Add new property EnabledProtocols for file shares
Approved in private branch.
  • Loading branch information
zfchen95 committed Nov 20, 2019
commit 2887974656e99481784dbedda60d579fb1b7e9ca
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
Expand Up @@ -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. ",
Expand All @@ -239,7 +242,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/FileShare"
"$ref": "#/definitions/FileShareCreateParameters"
Copy link
Contributor

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.

Copy link
Contributor Author

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.

},
"description": "Properties of the file share to create."
},
Expand Down Expand Up @@ -297,7 +300,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/FileShare"
"$ref": "#/definitions/FileShareUpdateParameters"
},
"description": "Properties to update for the file share."
},
Expand Down Expand Up @@ -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": {
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/Breaking%20changes%20guidelines.md#new-property-added-to-response

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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": {
Copy link
Member

Choose a reason for hiding this comment

The 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."
Copy link
Member

Choose a reason for hiding this comment

The 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": {
Expand Down