-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add swagger for annotation and work item config api for microsoft.insights components namespace for api version 2015-05-01 #2384
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
…space for api version 2015-05-01
|
This commit was treated and no generation was made for Azure/azure-sdk-for-go |
|
This commit was treated and no generation was made for Azure/azure-sdk-for-python |
|
Tagging @ravbhatnagar since new file in "stable" folder |
|
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: |
Swagger to SDK encountered a Subprocess error: (Azure/azure-sdk-for-go)
Command: profileBuilder -s preview -name preview /bin/sh: 1: profileBuilder: not found |
|
@ravbhatnagar @lmazuel - all checks passed for PR=true except live validation. Can you please review? |
|
Thank you @lmazuel , this was my first PR so had a few commits before getting rid of all errors. Do you recommend a separate PR for my next API (they are ready), or should I tag onto this one? |
|
I personally like having atomic PR, but if this is a new API in the same Readme, you may use this same PR to simplify future ARM review. |
Swagger to SDK encountered a Subprocess error: (Azure/azure-sdk-for-go)
Command: profileBuilder -s preview -name preview /bin/sh: 1: profileBuilder: not found |
|
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. |
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: |
|
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. |
|
@lmazuel - I've taken care of PR=true issues for the new api as well. Please take a look. Also, can you please help get some attention for the ARMFeedback tag? |
| } | ||
| } | ||
| }, | ||
| "409": { |
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.
remove all 4xx related errors and include a "default" model which captures all error responses. Check Batch api spec in this repo. They have a CloudError model.
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.
Updated this just now in both files.
| "type": "object", | ||
| "description": "Annotation associated with an application insights resource.", | ||
| "properties": { | ||
| "AnnotationName": { |
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 RP specific properties should go inside the "properties" property. Top level allowed properties are id, name, type, tags, location etc.
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.
So properties like category, eventtime etc need to be moved.
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.
This is a released version in PROD for 2+ years now. We'll update this in next 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.
Ok, since this is existing behavior which will break clients, lets identify the path forward in the next major version update.
| "format": "date-time", | ||
| "description": "Time when event occurred" | ||
| }, | ||
| "Id": { |
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 make sure all property names are camel cased.
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.
This is a released version in PROD for 2+ years now. We'll update this in next 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.
Yes, please.
| "nextLinkName": null | ||
| } | ||
| }, | ||
| "post": { |
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.
put for create. Why is this a POST.
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.
Its a POST because the Url path doesn't uniquely define the unique resource. The url path is /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/WorkItemConfigs and there can be multiple for single resource.
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.
POST should not be used for creating resources. Its not idempotent. It breaks consistency around how resources get provisioned in across Azure. Moreover, although its possible to do it via POST, we strongly recommend teams against creating multiple resources in one API call.
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.
This api does not create multiple resources in one API call, it creates a single one only. I agree that it is not idempotent, but did not know this as a requirement. Will keep this guideline for future api versions. Where are api guidelines documented for ARM?
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/DefaultWorkItemConfig": { |
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.
Why is the defaultWorkitemConfig part of this URL instead of a parameter as is the case in other APIs like DELETE, PUT etc.
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.
agreed, we'll fix this in our next release 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.
I dont understand. Is this just a swagger fix or a service side fix? I was hoping this is just an issue with how its described in swagger.
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.
This is the way the API was published. Essentially to retrieve default configuration for a resource. This is not a swagger fix, this is the swagger documentation for apis that are in PROD today. We're documenting our current public apis that are in production.
| } | ||
| }, | ||
| "definitions": { | ||
| "WorkItemConfiguration": { |
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 comment about top level properties that are allowed.
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.
agreed, will change this in our next public version.
|
@jpiyali - some comments from ARM side. Please take a look. |
|
@ravbhatnagar - thank you for your review comments, I've responded and updated. |
|
Since these are existing APIs in prod for several years, approving the PR. Fixing these will most likely mean breaking changes in the client. Email conversation ongoing with the AI team. |
|
@lmazuel - can you please help merge the PR? |
|
@AutorestCI rebuild azure-sdk-for-python |
…space for api version 2015-05-01
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