-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[OperationalInsights] Added 201 return status to QueryPacks_CreateOrUpdate #19674
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
Merged
Arthur Ning (akning-ms)
merged 5 commits into
Azure:main
from
dabenhamMic:dabenham/QpMissing201_5.7.2022
Sep 8, 2022
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ae7b7a4
added 201 return status to QueryPacks_CreateOrUpdate
dabenhamMic 63fc19b
update return contract for QP: QueryPacks_CreateOrUpdate
dabenhamMic 2384920
added queryPackName as empty string to examples
dabenhamMic ff38052
removed redundent name from 201 response example
dabenhamMic a186844
update QP swagger
dabenhamMic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...nager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackUpdateNoName.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "parameters": { | ||
| "api-version": "2019-09-01", | ||
| "subscriptionId": "86dc51d3-92ed-4d7e-947a-775ea79b4919", | ||
| "resourceGroupName": "my-resource-group", | ||
| "LogAnalyticsQueryPackPayload": { | ||
| "location": "South Central US", | ||
| "tags": { | ||
| "Tag1": "Value1" | ||
| }, | ||
| "properties": {} | ||
| } | ||
| }, | ||
| "responses": { | ||
| "201": { | ||
| "body": { | ||
| "id": "/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks", | ||
| "type": "microsoft.operationalinsights/querypacks", | ||
| "location": "South Central US", | ||
| "tags": { | ||
| "Tag1": "Value1" | ||
| }, | ||
| "properties": { | ||
| "queryPackId": "aac8fc00-2b68-441e-8f9b-ded8748dc635", | ||
| "timeCreated": "2019-06-04T12:37:56.8543652Z", | ||
| "timeModified": "2019-08-04T12:37:56.8543652Z", | ||
| "provisioningState": "Succeeded" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
28 changes: 28 additions & 0 deletions
28
...ager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksCreateNoName.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { | ||
| "parameters": { | ||
| "api-version": "2019-09-01", | ||
| "subscriptionId": "86dc51d3-92ed-4d7e-947a-775ea79b4919", | ||
| "resourceGroupName": "my-resource-group", | ||
| "LogAnalyticsQueryPackPayload": { | ||
| "location": "South Central US", | ||
| "properties": {} | ||
| } | ||
| }, | ||
| "responses": { | ||
| "201": { | ||
| "body": { | ||
| "id": "/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack", | ||
| "name": "my-querypack", | ||
| "type": "microsoft.operationalinsights/querypacks", | ||
| "location": "South Central US", | ||
| "tags": {}, | ||
| "properties": { | ||
| "queryPackId": "d1c8fc00-2b68-441e-8f9b-ded8748dc635", | ||
| "timeCreated": "2019-08-04T12:37:56.8543652Z", | ||
| "timeModified": "2019-08-04T12:37:56.8543652Z", | ||
| "provisioningState": "Succeeded" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Does it need to remove the block of "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.
it can return 200 if a name is passed, whenever a name is not passed 201 is returned
Uh oh!
There was an error while loading. Please reload this page.
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.
Daniel Ben-hamoo (@dabenhamMic) , the symptom is that QueryPacks_CreateOrUpdate API is failed and threw below error message while creating the Query Pack resource because API always returns 201 but 201 isn't defined in the response section of this API.
Error Message returned by API:
And I found API always returns 201 even if a name is passed after tested. Below is an example request. Could you double check the API behavior since it's different with what you mentioned above?
Request Payload:
API Response:

Per my understanding, I assume QueryPacks_CreateOrUpdate API is recommended API to create Query Pack resource, right? So does it make sense to add support for 201 response code in the QueryPacks_CreateOrUpdate API rather than introducing a new API?
Adding Arthur Ning (@akning-ms) for awareness.