Skip to content
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

Add Swagger for Short Term Retention Policies #2860

Merged
merged 6 commits into from
Apr 20, 2018
Merged

Add Swagger for Short Term Retention Policies #2860

merged 6 commits into from
Apr 20, 2018

Conversation

adeal
Copy link
Contributor

@adeal adeal commented Apr 12, 2018

This change adds the swagger documentation for the Short Term Retention feature along with examples for each of the APIs. This includes the following APIs:

Get database short term retention policy
Update database short term retention policy

PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes.
  • Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

@msftclas
Copy link

msftclas commented Apr 12, 2018

CLA assistant check
All CLA requirements met.

@AutorestCI
Copy link

AutorestCI commented Apr 12, 2018

Automation for azure-sdk-for-python

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-python#2285

@AutorestCI
Copy link

AutorestCI commented Apr 12, 2018

Automation for azure-libraries-for-java

The initial PR has been merged into your service PR:
AutorestCI/azure-libraries-for-java#9

@AutorestCI
Copy link

AutorestCI commented Apr 12, 2018

Automation for azure-sdk-for-go

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-go#1644

@AutorestCI
Copy link

AutorestCI commented Apr 12, 2018

Automation for azure-sdk-for-node

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-node#2715

"name": "ShortTermRetentionPolicyName",
"modelAsString": true
}
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems policyName is used in most of the operations, should we move this to parameter section?

Copy link
Contributor Author

@adeal adeal Apr 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you expand on what the benefit to that would be?

policyName will always be "default". I'd like to keep it consistent with what we see in Long Term Retention

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The benefit would be the same that we get from having a common definition of resource group name or subscription parameter. Out of 8 operations in this swagger, 6 of them uses policyName param, if you centralize this definition then swagger looks more clean, less lines and is a good pattern to follow in general.

In Long Term Rentetion swagger, out of 8 only two uses policyName, so when reviewed it I didn't ask to move definition as it was not saving much.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had an offline chat with @dealaus, swagger is not manually authored, SQL team will discuss internally to see whether this can be accommodated in the swagger gen tool. For now this is not a must fix for this PR.

@anuchandy
Copy link
Member

@dealaus - you added Don't merge to title - (1) is it because you are still working on this PR? or
(2) because the service is not deployed completely? or some other reason?

If (1) is the case then please let me know once it's ready for review, since this is a new swagger we need to get this reviewed from ARM.

If (2) is the case then it will be helpful to have a approximate date when it is ready for consumption.

@adeal
Copy link
Contributor Author

adeal commented Apr 13, 2018

@anuchandy it is (2) in this case.

Enabling the API is in deployment pipeline right now and has hit some regions (estimated to be WW on 4/20), but the ARM manifest has not been updated with these new APIs.

@anuchandy
Copy link
Member

@dealaus thanks for providing date. Given swagger is ready, i will request ARM review.

@anuchandy anuchandy added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Apr 13, 2018
@anuchandy
Copy link
Member

@ravbhatnagar new swagger, please review

@anuchandy
Copy link
Member

@jaredmoo it will be very helpful in case you can have a quick look.

"$ref": "#/parameters/ServerNameParameter"
},
{
"name": "restorableDroppedDatabaseId",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a GUID or a name? Also could use a description.

"RestorableDroppedDatabaseShortTermRetentionPolicies"
],
"description": "Gets a dropped database's short term retention policy.",
"operationId": "RestorableDroppedDatabaseShortTermRetentionPolicies_Get",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RestorableDroppedDatabaseShortTermRetentionPolicies_Get means the operation in .NET will be client.RestorableDroppedDatabaseShortTermRetentionPolicies.CreateOrUpdate()... is there any way you can see to shorten that?

"RestorableDroppedDatabaseShortTermRetentionPolicies"
],
"description": "Sets a database's long term retention policy.",
"operationId": "RestorableDroppedDatabaseShortTermRetentionPolicies_CreateOrUpdate",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as Get

"RestorableDroppedDatabaseShortTermRetentionPolicies"
],
"description": "Sets a database's long term retention policy.",
"operationId": "RestorableDroppedDatabaseShortTermRetentionPolicies_Update",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as Get

@adeal adeal changed the title [DO NOT MERGE] Add Swagger for Short Term Retention Policies Add Swagger for Short Term Retention Policies Apr 16, 2018
Copy link
Contributor

@ravbhatnagar ravbhatnagar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment. Please fix. Good to merge after this one fix.

"200": {
"description": "Successfully retrieved the policy.",
"schema": {
"$ref": "#/definitions/ShortTermRetentionPolicy"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a list API and the response should be a "value" array. Check other API specs for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will remove from this checkin for now until we can fix the API to return an array. Shouldn't be a problem, it will just take ~14 days to be deployed.

@ravbhatnagar ravbhatnagar added ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Apr 18, 2018
@ravbhatnagar
Copy link
Contributor

Just one issue needs to be fixed. Conditionally signed off.

@anuchandy
Copy link
Member

@dealaus can you fix the readme.md conflict?

@adeal
Copy link
Contributor Author

adeal commented Apr 20, 2018

@anuchandy done.

@azuresdkciprbot
Copy link

Hi There,

I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result:

File: specification/sql/resource-manager/readme.md
Before the PR: Warning(s): 26 Error(s): 0
After the PR: Warning(s): 26 Error(s): 0

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@azuresdkciprbot
Copy link

Hi There,

I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result:

File: specification/sql/resource-manager/readme.md
Before the PR: Warning(s): 26 Error(s): 0
After the PR: Warning(s): 26 Error(s): 0

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@anuchandy anuchandy merged commit 759bd28 into Azure:master Apr 20, 2018
mccleanp pushed a commit that referenced this pull request Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants