Application Insights: Add Analytics Items API#2608
Conversation
Automation for azure-sdk-for-nodeA PR has been created for you based on this PR content. Once this PR will be merged, content will be added to your service PR: |
Automation for azure-sdk-for-pythonA PR has been created for you based on this PR content. Once this PR will be merged, content will be added to your service PR: |
Automation for azure-sdk-for-goA PR has been created for you based on this PR content. Once this PR will be merged, content will be added to your service PR: |
|
@ravbhatnagar new Swagger |
|
@yoramsinger - Are these existing APIs in the service that you are adding to swagger now? |
|
Yes. Existing API. |
|
Signing off from ARM since there are APIs in prod for a while |
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}": { | ||
| "get": { | ||
| "description": "Gets a list of Analytics Items defined within an Application Insights component.", | ||
| "operationId": "AnalyticsItems_List", |
There was a problem hiding this comment.
please rename to AnalyticsItem_List (operation group names should be consistent) 🙂
| }, | ||
| "definitions": { | ||
| "ApplicationInsightsComponentAnalyticsItem": { | ||
| "description": "Properties that define an Analytics item that is associated to an Application Insights component.", |
There was a problem hiding this comment.
please add "type": "object"
| ], | ||
| "x-ms-enum": { | ||
| "name": "ItemType", | ||
| "modelAsString": false |
There was a problem hiding this comment.
please set this to true and remove either the lower or upper case values from the enum list (I assume your service accepts both spellings? If a user sets with specific spelling, will the service return with same spelling or normalize internally? If it normalizes, please choose that spelling here for consistency)
| ], | ||
| "x-ms-enum": { | ||
| "name": "ItemScope", | ||
| "modelAsString": false |
There was a problem hiding this comment.
this enum sounds as if it could inherently change at some point in time (e.g. future api version). Please set modelAsString to true in such cases as otherwise any such change would be a breaking change 🙂
| "type": "string", | ||
| "description": "Internally assigned unique id of the item definition." | ||
| }, | ||
| "Name": { |
There was a problem hiding this comment.
since you're an existing service it's not unlikely but: Just wanna confirm, is PascalCasing really what your service sends over the wire?
There was a problem hiding this comment.
Unfortunately yes, this is how it was defined.
| "readOnly": true | ||
| }, | ||
| "Properties": { | ||
| "properties": { |
There was a problem hiding this comment.
please pull this out into its own entry in schemas - that way you can control the name chosen during code generation (as is, autorest would pick some name which is usually horrible).
Also, add type: object to the schema 😉
| "Properties": { | ||
| "properties": { | ||
| "functionAlias": { | ||
| "type": "string", |
There was a problem hiding this comment.
nit: please format the entire file in the end so indentation is consistent 🙂
| ], | ||
| "x-ms-enum": { | ||
| "name": "ItemScopePath", | ||
| "modelAsString": false |
There was a problem hiding this comment.
also consider changing to true, see previous comment regarding breaking changes
| ], | ||
| "x-ms-enum": { | ||
| "name": "ItemScope", | ||
| "modelAsString": false |
There was a problem hiding this comment.
also consider changing to true, see previous comment regarding breaking changes
| ], | ||
| "x-ms-enum": { | ||
| "name": "ItemType", | ||
| "modelAsString": false |
There was a problem hiding this comment.
also consider changing to true, see previous comment regarding breaking changes
Automation for azure-libraries-for-javaEncountered a Subprocess error: (azure-libraries-for-java)
Command: ['/usr/local/bin/autorest', '/tmp/tmpxa8g74qr/rest/specification/applicationinsights/resource-manager/readme.md', '--azure-libraries-for-java-folder=/tmp/tmpxa8g74qr/sdk', '--fluent', '--java', '--multiapi', '--verbose'] AutoRest code generation utility [version: 2.0.4262; node: v7.10.1]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
Loading AutoRest core '/root/.autorest/@microsoft.azure_autorest-core@2.0.4272/node_modules/@microsoft.azure/autorest-core/dist' (2.0.4272)
Loading AutoRest extension '@microsoft.azure/autorest.java' (~2.1.32->2.1.49)
Loading AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.38->2.3.38)
FATAL: System.Exception: Duplicate File Generation: src/main/java/com/microsoft/azure/management/applicationinsights/implementation/FavoritesInner.java
at AutoRest.Core.CodeGenerator.<Write>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AutoRest.Core.CodeGenerator.<Write>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AutoRest.Java.Azure.Fluent.CodeGeneratorJvaf.<Generate>d__6.MoveNext() in C:\Users\autorest-ci\AppData\Local\Temp\2\PUBLISHedxhk\164_20180307T193002\autorest.java\src\azurefluent\CodeGeneratorJvaf.cs:line 57
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AutoRest.Java.Program.<ProcessInternal>d__3.MoveNext() in C:\Users\autorest-ci\AppData\Local\Temp\2\PUBLISHedxhk\164_20180307T193002\autorest.java\src\Program.cs:line 115
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NewPlugin.<Process>d__15.MoveNext()
FATAL: java/generate - FAILED
FATAL: Error: Plugin java reported failure.
Process() cancelled due to exception : Plugin java reported failure.
Error: Plugin java reported failure. |
|
I updated per your review. Please verify, thanks. |
olydis
left a comment
There was a problem hiding this comment.
looking good overall, some minor things CI tooling found
| "description": "Enum indicating the type of the Analytics item.", | ||
| "type": "string", | ||
| "enum": [ | ||
| "Query", |
There was a problem hiding this comment.
Your example AnalyticsItemList, AnalyticsItemGet and AnalyticsItemPut disagree with spelling here (seem to be lowercase) - please adjust either examples or Swagger, whichever is wrong 🙂
| "default": "None", | ||
| "enum": [ | ||
| "None", | ||
| "Query", |
There was a problem hiding this comment.
see spelling comment on other instance of this enum
There was a problem hiding this comment.
...however, there is another issue: this enum has None has an additional value. This is a problem since both enums are named ItemType, so code-gen would not know what to do. Please either use the same list of values for both enums (if that makes any sense) or choose different names for the two enums - both may be non-ideal solutions, I'd be happy to discuss more
There was a problem hiding this comment.
Unfortunately the API was not designed well. I'll use 2 separate enums here.
|
@yoramsinger please address the outstanding issues; this PR will otherwise be closed due to inactivity (but can reopened at any time, once you are ready to move forward) |
|
I think I fixed the mentioned issues. Hope it works this time. |
|
@yoramsinger Tiny bug: |
olydis
left a comment
There was a problem hiding this comment.
looking good, thanks for the fix!
|
@AutorestCI regenerate azure-sdk-for-go |
|
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: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
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