-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Adding documentation and examples for Transparent Data Encryption, En… #1260
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
Conversation
…cryption Protector, Server Key, and Servers
|
@mihymel, |
dsgouda
left a comment
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.
Looks in pretty good shape. Left a few comments.
| "azurekeyvault", | ||
| "servicemanaged" | ||
| ], | ||
| "type": "string" |
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.
You'd want to consider setting "modelAsString":true if this enum is bound to change later, not doing so could result in breaking change. This applies to all other enums.
| "description": "The requested encryption protector resource state.", | ||
| "required": true, | ||
| "schema": { | ||
| "$ref": "#/definitions/EncryptionProtector" |
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.
Since EncryptionProtector is a body parameter here, please ensure you have set all the correct properties to readonly.
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.
I double checked to be safe - ServerKeyType and ServerKeyName are the only properties of EncryptionProtector that are not readonly. This is what we want.
| "produces": [ | ||
| "application/json" | ||
| ], | ||
| "paths": { |
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.
Please ensure there is an Operations API that exposes information about the operations exposed here.
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.
It's in sql.core.json
| "EncryptionProtectors" | ||
| ], | ||
| "description": "Returns a list of the server encryption protectors", | ||
| "operationId": "Servers_ListEncryptionProtectors", |
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.
You probably mean Servers_ListByEncryptionProtectors
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.
EncryptionProtector is a singleton, so this is following the pattern for naming singleton operations. See blob auditing policies for example of the pattern.
| ], | ||
| "type": "string" | ||
| }, | ||
| "location": { |
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.
Just to confirm, by adding location you dont intend to make this a tracked resource.
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.
Correct. This is not a tracked resource.
| "Servers" | ||
| ], | ||
| "description": "Creates or updates a server.", | ||
| "operationId": "Servers_CreateOrUpdate", |
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.
If you already have an update operation you probably don't need a createOrUpdate
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.
"CreateOrUpdate" is for PUT, "Update" is for PATCH.
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.
Let me rephrase that, do you think you will need a CreateOrUpdate even if you had Create and Update operations?
CreateOrUpdate is useful if the update operation only allows an update on the tags property. If you wish to expose a PATCH operation that allows updating of other properties, its better to have a separate Update operation like you have here.
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.
There is no Create operation. Just Servers_CreateOrUpdate and Servers_Update
| } | ||
| }, | ||
| "x-ms-long-running-operation": true | ||
| } |
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.
Please provide x-ms-examples here.
| }, | ||
| "kind": { | ||
| "description": "Kind of sql server. This is metadata used for the Azure portal experience.", | ||
| "enum": [ |
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.
please provide an x-ms-enums section with appropriate options here,
| "operationId": "Servers_CreateOrUpdateEncryptionProtector", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "#/parameters/ResourceGroupParameter" |
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.
Maintain consistent parameter ordering, either place "ResourceGroupParameter" and "ApiVersionParameter" together at the beginning or at the end of the parameters section.
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 is this? You previously told us that SubscriptionId and ApiVersion should be together since they are client params, not method params. Did this change?
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.
Whoops I confused SubscriptionId with ResourceGroupName, sorry about that, please disregard this
…tring for enum parameters, fixing sql.core name to servers, adding x-ms-examples to servers
|
@nathannfan to review |
| ], | ||
| "x-ms-enum": { | ||
| "name": "EncryptionProtectorName", | ||
| "modelAsString": true |
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.
I assume this might change?
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.
EncryptionProtector is a singleton now and we intend for it to be that way for the unforeseeable future. Technically (with some changes) the API is designed to support multiple EncryptionProtectors, so I used modelAsString.
…odelAsEnum" for some string properties due to resulting errors in generated .net SDK
|
I removed "x-ms-enum" for some parameters where an acceptable enum value included an empty string because in this case this resulted in errors in the generated .NET SDK. The generated .NET SDK generates an enum class where the enum with value "" doesn't have a name: e.g. public const string = ""; |
|
@dsgouda the validation error for syntax isn't very clear. Is this a legitimate syntax error in the swagger? |
|
If there are no explicit properties you wish to add under "x-ms-enums", you can remove it or just put an empty object there, I leave it to your discretion. |
|
@nathannfan which specific error is this related too, I can try and help you out with it. |
|
@dsgouda thanks, I'm referring to https://travis-ci.org/Azure/azure-rest-api-specs/jobs/236527345#L1056 |
…r api 2014-04-01 so they can be added to compositeSql
|
No modification for NodeJS |
…cryption Protector, Server Key, and Servers
This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information
api-versionin the path should match theapi-versionin the spec).Quality of Swagger