-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[Do not merge] Addition of CRUD operations for Application Insights Components & Synthetic Monitors #988
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
- Make descriptions consistent with regards to punctuation - Add some missing response codes - Correct a few definition fields for readonly
|
@d3r3kk, |
|
@d3r3kk this is great - thanks! |
|
@tombuildsstuff Please have a look and let me know if there are any problems with what you were attempting to do with the API. Having real-world usage against this API will be very helpful feedback! |
- original dev work didn't take into account 'packages' where similar objects are merged during API generation. - Fixed problems with inconsistent common-object defintions
- Revert my definition of the Azure 'Resource' to suit the already-defined swagger specs in the insights management client.
|
@d3r3kk thanks for this - to keep you in the loop, I took a quick look but can't generate the Go SDK at this point from the composite swagger right now due to an error: I noticed some errors in Travis too - but that the Go generator isn't hooked up to that yet? Update: I've just noticed you've pushed some more commits - I'll check back later on - thanks again :) |
| "in": "query", | ||
| "required": true, | ||
| "type": "string", | ||
| "description": "Client API version." |
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.
All documents of composite Swagger need to agree about parameters defined on the global scope 100%. In this case, AutoRest complains about a mismatching description ;-) In another document in here I see (note capitalization):
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"required": true,
"type": "string",
"description": "Client Api Version."
},
Please make sure all documents use precisely the same ApiVersionParameter definition.
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.
@olydis Fixed in my latest commit - I was unfortunately using the Nuget AutoRest package which is currently at v0.17.0 and did not report this error. I've since updated to use the NPM autorest package which is at 1.0.1 and have corrected the problem.
@tombuildsstuff I've just now built the Go API and it succeeded without warnings.
|
@tombuildsstuff - Those are validation errors and not codegen errors. Both use the same logger. If an error was logged ever the final exit code is 1 and you see that error message. We are fixing that part. |
| "schema": { | ||
| "$ref": "#/definitions/ApplicationInsightsComponentListResult" | ||
| }, | ||
| "examples": { |
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.
instead of providing example in the spec, can you please provide them using the "x-ms-examples" extension.
Take a look at the RedisCache swagger spec as an example over 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.
Looking...
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.
Complete, have a look and let me know - tested using 'npm test -- test/model.js' and got that running cleanly for the Components and SyntheticMonitor specs I've added only.
- use x-ms-examples format for response examples rather than the inline version
- users will want an exception for these cases too
|
This change is being applied to the arm-insights folder, which is not the AppInsights folder. |
|
This PR targets wrong folder. Please re-target it to the correct folder per @gucalder comment. |
- Correct errors found by using the model test definition
- PR request - use the x-ms-examples method of defining examples for synthetic monitors - Remove 404 codes, we want users to get exceptions for those - Ensure the test/model.js tests pass for the Synthetic Monitor examples
|
@gucalder, @hovsepm, I was under the understanding that Insights includes Application Inisghts. Indeed, the 'Alerts' API that is found under ../arm-insights/ is provided by the same web service that provides Component and Synthetic Monitor APIs. I can create an arm-appinsights folder though, I have no problem doing so. |
|
@amarzavery I've changed all examples to using the x-ms-examples pattern. |
- Request of PR members, this is the new place for the monitor APIs to reside, specifically for Microsoft.insights. - Changed name of files to coincide with the pattern in this folder - Changed title of the Component and Synthetic Monitor APIs to match the rest.
|
@d3r3kk @hovsepm Does that make sense? |
|
@amarzavery I've actually been chatting with @hovsepm and @gucalder in an email thread I'll add you to this morning. Apologies for any confusion I may have caused here! I am trying to determine the best possible outcome for the customer (components, synthetic monitors, and alerts, are all coupled and will be used in tandem by our users when they use application insights APIs). |
|
Awesome feedback, thanks @amarzavery! Sorry I haven't responded for 5 days, I've since moved onto other efforts for my team, but will revisit this PR by this coming Friday, 24th of March. |
- Rename SyntheticMonitor to WebTests to conform to spec - Method names have been normalized - Required "Patch" operation added - Metadata operation added in new API file (aiOperations) - Various minor fixes in type names and definitions
- Every field that should be a default value has been switched to an enum - Each field has a 'default' value - Each field is 'modelAsString' to ensure non-accounted-for values are still allowed during deserialization
- Incorrect casing of filenames was failing the syntax checks. - Errant comma in one example also failed the syntax check
|
Thanks for your patience everyone. I've posted my changes requested by @amarzavery along with some new example files as well. Please review and let me know if there is any further work to do to ensure the quality of our spec is inline with the repo. Thanks! |
|
@d3r3kk - The model validator found issues. Please take a look at the Travis CI log over here https://travis-ci.org/Azure/azure-rest-api-specs/jobs/216112575#L1042 |
test/linter.js
Outdated
| // swaggersToProcess = swaggersToProcess.filter(function(item) { | ||
| // return (item.match(/.arm-containerregistry.*2017-03-01.*/ig) !== null); | ||
| // }); | ||
| swaggersToProcess = swaggersToProcess.filter(function(item) { |
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 revert this change.
| "type": "integer", | ||
| "format": "int32", | ||
| "description": "Seconds until this WebTest will timeout and fail." | ||
| "description": "Seconds until this WebTest will timeout and fail. Default valu is 30.", |
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.
Default valu is 30.", -> missing 'e' in value
|
- mistakenly added local commit limiting range of linter tests
- Specify the enum-type values in the Create example - Alter the values in the responses to reflect the accepted values from our spec. - NOTE: There are other values allowed, hence our modelAsString = true attribute.
|
@amarzavery I believe I've rectified the issues with examples / typos. Apologies for checking in the linter test. |
|
Hey @d3r3kk the travis ci shows that there are still a bunch of model validation errors:
|
What about the insights/operations link. I see that I fail in the linter script for those for the two main spec files, but I do not fail in the single file I included that in. It seems I have to include that path in each of my swagger spec files to pass the linter. Would that be preferable to the solution I've devised? |
|
@d3r3kk - The linter is run on each swagger spec separately. It has no ideas that the swagger is a part of the composite swagger. Hence please ignore the operations API Implementation error in other specs. If you have included the API in one of the swagger specs then you are good to go. |
|
No modification for Python |
|
No modification for Ruby |
|
Thanks @d3r3kk for authoring the swagger and incorporating all the feedback. @tombuildsstuff - Sorry for the delay. But you should be able to use this (applicationInsights) swagger and the clients generated from this swagger. Please feel free to file issues if you see any problems. Thanks for the initial PR with swagger. That helped us deliver this today. |
|
No modification for NodeJS |
|
@d3r3kk Thanks again, @tombuildsstuff, we'll make sure that this get's out into our next Go SDK release. adding @marstr for visibility |
Add the swagger spec for all CRUD operations to do with Components and Synthetic Monitors (web tests).
Spawned from PR "Application Insights: CRUD for a new Instance #757" originally put forth by @tombuildsstuff and worked on by @amarzavery.
Please review and let me know if you have any concerns: @SergeyKanzhelev, @salameer. Any feedback is greatly appreciated.
PR information
api-versionin the path should match theapi-versionin the spec).Quality of Swagger