-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Conversation
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
@simongdavies new APIs |
Looks good |
"$ref": "#/parameters/filterParameter" | ||
} | ||
], | ||
"responses": { |
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.
looking at MetricListResult
, it looks to me as if this operation should be marked as x-ms-pageable
(with nextLinkName
set to null
)
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 never going to return it as multiple pages
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.
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": { |
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.
same as above 🙂
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.
...and next 3 times :D
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.
same--not going to be multiple pages
} | ||
], | ||
"responses": { | ||
"200": { |
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.
okay, same here, please review all added methods 😉
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.
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.", |
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.
description identical to DatabaseAccounts_ListUsages
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.
fixed
"x-ms-examples": { | ||
"CosmosDBCollectionGetUsages": { "$ref": "./examples/CosmosDBCollectionGetUsages.json" } | ||
}, | ||
"description": "Retrieves the usages (most recent storage data) for the given database account.", |
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.
description identical to DatabaseAccounts_ListUsages
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.
fixed
"description": "The response to a list usage request." | ||
}, | ||
"Usage": { | ||
"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.
Can the properties in here be marked as readOnly
? So far, they're only used in responses it seems. 🙂
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.
fixed
"Usage": { | ||
"properties": { | ||
"unit": { | ||
"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.
please extract UnitType
into its own definition section and just reference it here => deduplication (generally applies to anything that is duplicated across a spec)
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.
fixed
@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
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: 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
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: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
@molly-moen Thanks! 🙂 |
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
api-version
in the path should match theapi-version
in the spec).Quality of Swagger