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

CosmosDB--Added specs for Get Metrics, Get Usages, Get MetricDefinitions #2052

Merged
merged 6 commits into from
Dec 12, 2017
Merged

CosmosDB--Added specs for Get Metrics, Get Usages, Get MetricDefinitions #2052

merged 6 commits into from
Dec 12, 2017

Conversation

molly-moen
Copy link
Contributor

@molly-moen molly-moen commented Nov 27, 2017

Added the specifications for cosmos db paths for get metrics, get usages and get metric definitions. Also includes example files for these types of requests.

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

  • [y ] The title of the PR is clear and informative.
  • [y] 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.
  • [y ] 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.
  • [y ] Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

started work on metrics documentation
Added specifications for get metrics, get usages and get metric definitions paths
Fixed indentation and some descriptions
Validation requires array result to have operation id including _List
@olydis olydis added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Dec 6, 2017
@olydis
Copy link
Contributor

olydis commented Dec 6, 2017

@simongdavies new APIs

@olydis
Copy link
Contributor

olydis commented Dec 7, 2017

@ravbhatnagar

@Azure Azure deleted a comment from azuresdkciprbot Dec 7, 2017
@ravbhatnagar
Copy link
Contributor

Looks good

@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 Dec 7, 2017
"$ref": "#/parameters/filterParameter"
}
],
"responses": {
Copy link
Contributor

Choose a reason for hiding this comment

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

looking at MetricListResult, it looks to me as if this operation should be marked as x-ms-pageable (with nextLinkName set to null)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's never going to return it as multiple pages

Copy link
Contributor

Choose a reason for hiding this comment

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

that's why I suggested setting nextLinkName set to null 😉 it still improves generated code, since not a wrapper object with an array property is returned, but instead just the array itself. Of course, ignore my suggestion if you think there could be further properties appearing as siblings of values - since then, you would of course want users to see the "wrapper object"

"$ref": "#/parameters/filterParameter"
}
],
"responses": {
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

...and next 3 times :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same--not going to be multiple pages

}
],
"responses": {
"200": {
Copy link
Contributor

Choose a reason for hiding this comment

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

okay, same here, please review all added methods 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same--not going to be multiple pages

"x-ms-examples": {
"CosmosDBDatabaseGetUsages": { "$ref": "./examples/CosmosDBDatabaseGetUsages.json" }
},
"description": "Retrieves the usages (most recent data) for the given database account.",
Copy link
Contributor

Choose a reason for hiding this comment

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

description identical to DatabaseAccounts_ListUsages

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

"x-ms-examples": {
"CosmosDBCollectionGetUsages": { "$ref": "./examples/CosmosDBCollectionGetUsages.json" }
},
"description": "Retrieves the usages (most recent storage data) for the given database account.",
Copy link
Contributor

Choose a reason for hiding this comment

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

description identical to DatabaseAccounts_ListUsages

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

"description": "The response to a list usage request."
},
"Usage": {
"properties": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the properties in here be marked as readOnly? So far, they're only used in responses it seems. 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

"Usage": {
"properties": {
"unit": {
"type": "string",
Copy link
Contributor

Choose a reason for hiding this comment

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

please extract UnitType into its own definition section and just reference it here => deduplication (generally applies to anything that is duplicated across a spec)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@olydis
Copy link
Contributor

olydis commented Dec 8, 2017

@molly-moen Please also take a look at our model validation - it found a load of mismatches between the examples you provided and the specification.

Fixed readonly/required attributes, extracted out repeated text, fixed some casing and descriptions
@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:

💡 Please review potentially introduced Error(s)/Warning(s): Analysis Report 💡

File: specification/cosmos-db/resource-manager/readme.md
Before the PR: Warning(s): 0 Error(s): 3
After the PR: Warning(s): 0 Error(s): 4

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

Changed List Metrics to be x-ms-pageable with next link name of null
@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:

💡 Please review potentially introduced Error(s)/Warning(s): Analysis Report 💡

File: specification/cosmos-db/resource-manager/readme.md
Before the PR: Warning(s): 0 Error(s): 3
After the PR: Warning(s): 0 Error(s): 4

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@olydis olydis merged commit 1899c06 into Azure:current Dec 12, 2017
@olydis
Copy link
Contributor

olydis commented Dec 12, 2017

@molly-moen Thanks! 🙂

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.

7 participants