Skip to content

Conversation

@abversqr
Copy link
Member

@abversqr abversqr commented Apr 12, 2018

Added GA API version for Scheduled Query Rule

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

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes.
  • Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

Added GA API version for Scheduled Query Rule
@msftclas
Copy link

msftclas commented Apr 12, 2018

CLA assistant check
All CLA requirements met.

@AutorestCI
Copy link

AutorestCI commented Apr 12, 2018

Automation for azure-sdk-for-python

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-python#2460

@AutorestCI
Copy link

AutorestCI commented Apr 12, 2018

Automation for azure-sdk-for-node

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-node#2602

@AutorestCI
Copy link

AutorestCI commented Apr 12, 2018

Automation for azure-libraries-for-java

The initial PR has been merged into your service PR:
AutorestCI/azure-libraries-for-java#31

@AutorestCI
Copy link

AutorestCI commented Apr 12, 2018

Automation for azure-sdk-for-go

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-go#1692

@fearthecowboy
Copy link
Contributor

Yoink! @sarangan12 -- I'm assigning this to me so I can use it to train more reviewers. You get a freebie!

@fearthecowboy
Copy link
Contributor

Hey @abversqr -- it appears you have a few validation errors in your spec -- can you correct these and update the PR?

https://travis-ci.org/Azure/azure-rest-api-specs/jobs/365583431#L736

If you want to run the linter yourself locally, install autorest and try:

# from the folder where the readme.md file is
autorest --azure-validator readme.md 

It looks mostly like one typo (date=time?) missing examples and an API that should be defined.

@fearthecowboy
Copy link
Contributor

Hey @abversqr -- this looks like a new API is being added -- has this been reviewed by the API review board?

If not, you should schedule a one hour SKYPE meeting with Garrett Serack, David Justice, Johan Stenberg, Gaurav Bhatnagar, Darrel Miller and Niklas Gustafsson . Preferably Tuesday afternoon sometime between 1 and 5pm.

"info": {
"title": "Microsoft Insights API",
"version": "2018-04-16",
"x-ms-code-generation-settings": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't have x-ms-code-generation-settings in the actual swagger file (I don't think we even use this anymore at all).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

"tags": [
"scheduledQueryRules"
],
"operationId": "createOrUpdateScheduledQueryRules",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Operation IDs should be GROUP_METHOD -- Where GROUP is a plural (ie, in this case ScheduledQueryRules and METHOD should be CreateOrUpdate which means that this one should be ScheduledQueryRules_CreateOrUpdate

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest iteration

Copy link
Contributor

@fearthecowboy fearthecowboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to resolve a bunch of this before I can continue the review -- and the API review board should sign off.

"paths": {
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}": {
"put": {
"description": "Creates or updates an log search rule.\r\nRequest method: PUT\t\tRequest URI: https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/scheduledQueryRules/{logsearch-rule-name}?api-version={api-version}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description should document the API (the presence of the swagger file is telling you how you should physically call this method). You can drop everything after Creates or updates an log search rule.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest iteration

"schema": {
"$ref": "#/definitions/LogSearchRuleResource"
},
"examples": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use x-ms-examples and the example data should be in a separate file. (and then the linter won't yell at you for missing examples :D )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest iteration

"tags": [
"scheduledQueryRules"
],
"operationId": "getScheduledQueryRule",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, fix the operationId to match the pattern (ieScheduledQueryRules_Get)

"schema": {
"$ref": "#/definitions/LogSearchRuleResource"
},
"examples": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, move example into external file with x-ms-examples

"description": "The parameters of the rule to create or update."
}
],
"responses": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}
},
"404": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error states should be modeled as "default" responses and have a model to deserialize the error into.

A lot of these things should have been caught in the API review board -- I'll pause the review here, and wait until after the review board has seen these APIs.

"readOnly": true,
"description": "Azure resource Id"
},
"name": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should also be readonly since the name comes from URL

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest iteration

"modelAsString": true
}
},
"skuType": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SKUs of a resource is indicated through the ARM top level "sku" property. The details can be found in the ARM resource provider contract

"format": "date-time",
"description": "Last time the rule was updated in IS08601 format."
},
"provisioningState": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please define as an enum and list all the possible values.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest iteration

@ravbhatnagar ravbhatnagar added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Apr 17, 2018
Resolving Comments
@azuresdkciprbot
Copy link

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: specification/monitor/resource-manager/readme.md
Before the PR: Warning(s): 37 Error(s): 0
After the PR: Warning(s): 37 Error(s): 1

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@azuresdkciprbot
Copy link

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: specification/monitor/resource-manager/readme.md
Before the PR: Warning(s): 37 Error(s): 0
After the PR: Warning(s): 37 Error(s): 1

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@ravbhatnagar
Copy link
Contributor

Looks good!

@ravbhatnagar ravbhatnagar added the ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review label Apr 19, 2018
@ravbhatnagar ravbhatnagar removed the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Apr 19, 2018
@abversqr
Copy link
Member Author

Hey @fearthecowboy, I have resolved all comments. Can ou please have a look into this and sign-off if no blocking changes are pending,

@fearthecowboy
Copy link
Contributor

@abversqr -- hey just a few things to clean up:

  1. You've still got the examples in the swagger. if you have x-ms-examples, you should take out the inline examples.
  2. It's still got 1 linter error and a few model validation errors:
    see https://travis-ci.org/Azure/azure-rest-api-specs/jobs/368279045 -- you should have a PATCH operation for the resource, if you can't, you need to get an exemption from @ravbhatnagar .
    see https://travis-ci.org/Azure/azure-rest-api-specs/jobs/368279046

You can run the model validator locally if you install it :

npm install -g oav

And then run it from your azure-rest-api-specs\specification\monitor\resource-manager folder:

oav validate-example microsoft.insights\stable\2018-04-16\scheduledQueryRule_API.json

Which will tell you what's not quite right with your examples.

Thanks!

1. Removed SKU - Billing Model is still under discussion, hence need not to be exposed to customers.
2.  Enabled field ichanged to align with camel case.
3.  'throttleTillDate' in properties.action changed to 'throttlingInMin' to denote correct meaning  and it’s data type changed to number instead of date.
4. 'status' to be removed in properties.action from examples.
5.  'severity' made a required field in properties.action.
6. Removed Examples from original spec json
@azuresdkciprbot
Copy link

AutoRest linter results for SDK Related Validation Errors/Warnings

These errors are reported by the SDK team's validation tools, reachout to ADX Swagger Reviewers directly for any questions or concerns.

File: specification/monitor/resource-manager/readme.md

⚠️0 new Warnings.(17 total)
0 new Errors.(0 total)

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@azuresdkciprbot
Copy link

AutoRest linter results for ARM Related Validation Errors/Warnings

These errors are reported by the ARM team's validation tools, reachout to ARM RP API Review directly for any questions or concerns.

File: specification/monitor/resource-manager/readme.md

⚠️0 new Warnings.(20 total)
1 new Errors.(1 total)
Code Id Source Message
TrackedResourcePatchOperation R3026 Link Tracked resource 'LogSearchRuleResource' must have patch operation that at least supports the update of tags. It's strongly recommended that the PATCH operation supports update of all mutable properties as well.

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

Updated Example to reflect AI instances in tags and 'dataSourceId"
@azuresdkciprbot
Copy link

AutoRest linter results for SDK Related Validation Errors/Warnings

These errors are reported by the SDK team's validation tools, reachout to ADX Swagger Reviewers directly for any questions or concerns.

File: specification/monitor/resource-manager/readme.md

⚠️0 new Warnings.(17 total)
0 new Errors.(0 total)

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@azuresdkciprbot
Copy link

AutoRest linter results for ARM Related Validation Errors/Warnings

These errors are reported by the ARM team's validation tools, reachout to ARM RP API Review directly for any questions or concerns.

File: specification/monitor/resource-manager/readme.md

⚠️0 new Warnings.(20 total)
1 new Errors.(1 total)
Code Id Source Message
TrackedResourcePatchOperation R3026 Link Tracked resource 'LogSearchRuleResource' must have patch operation that at least supports the update of tags. It's strongly recommended that the PATCH operation supports update of all mutable properties as well.

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@azuresdkciprbot
Copy link

AutoRest linter results for SDK Related Validation Errors/Warnings

These errors are reported by the SDK team's validation tools, reachout to ADX Swagger Reviewers directly for any questions or concerns.

File: specification/monitor/resource-manager/readme.md

⚠️0 new Warnings.(0 total)
0 new Errors.(0 total)

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@azuresdkciprbot
Copy link

AutoRest linter results for ARM Related Validation Errors/Warnings

These errors are reported by the ARM team's validation tools, reachout to ARM RP API Review directly for any questions or concerns.

File: specification/monitor/resource-manager/readme.md

⚠️0 new Warnings.(0 total)
0 new Errors.(0 total)

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

Restore Tags Description
@azuresdkciprbot
Copy link

AutoRest linter results for ARM Related Validation Errors/Warnings

These errors are reported by the ARM team's validation tools, reachout to ARM RP API Review directly for any questions or concerns.

File: specification/monitor/resource-manager/readme.md

⚠️0 new Warnings.(20 total)
1 new Errors.(1 total)
Code Id Source Message
TrackedResourcePatchOperation R3026 Link Tracked resource 'LogSearchRuleResource' must have patch operation that at least supports the update of tags. It's strongly recommended that the PATCH operation supports update of all mutable properties as well.

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@azuresdkciprbot
Copy link

AutoRest linter results for SDK Related Validation Errors/Warnings

These errors are reported by the SDK team's validation tools, reachout to ADX Swagger Reviewers directly for any questions or concerns.

File: specification/monitor/resource-manager/readme.md

⚠️0 new Warnings.(17 total)
0 new Errors.(0 total)

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

Fixed errores reported by running command "oav validate-example"
"$ref": "#/parameters/SubscriptionIdParameter"
}
],
"responses": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should have a default response modeled here -- if the service fails for any reason, the client needs to be able to get the error response.

@azuresdkciprbot
Copy link

AutoRest linter results for ARM Related Validation Errors/Warnings

These errors are reported by the ARM team's validation tools, reachout to ARM RP API Review directly for any questions or concerns.

File: specification/monitor/resource-manager/readme.md

⚠️0 new Warnings.(20 total)
1 new Errors.(1 total)
Code Id Source Message
TrackedResourcePatchOperation R3026 Link Tracked resource 'LogSearchRuleResource' must have patch operation that at least supports the update of tags. It's strongly recommended that the PATCH operation supports update of all mutable properties as well.

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@azuresdkciprbot
Copy link

AutoRest linter results for SDK Related Validation Errors/Warnings

These errors are reported by the SDK team's validation tools, reachout to ADX Swagger Reviewers directly for any questions or concerns.

File: specification/monitor/resource-manager/readme.md

⚠️0 new Warnings.(17 total)
0 new Errors.(0 total)

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

Changes -
1. Added Default Response payload in all APIs
2. Made azNs description more clear
Copy link
Contributor

@fearthecowboy fearthecowboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

There is still a R3026 Linter violation -- the RP will fix in a subsequent PR : "we are working on this, but will take couple of weeks to get this done. Once this done, we will push this change in new PR for review. Let us know if you see any concern with this."

@fearthecowboy fearthecowboy merged commit 63892f9 into Azure:master Apr 24, 2018
@azuresdkciprbot
Copy link

AutoRest linter results for ARM Related Validation Errors/Warnings

These errors are reported by the ARM team's validation tools, reachout to ARM RP API Review directly for any questions or concerns.

File: specification/monitor/resource-manager/readme.md

⚠️0 new Warnings.(20 total)
1 new Errors.(1 total)
Code Id Source Message
TrackedResourcePatchOperation R3026 Link Tracked resource 'LogSearchRuleResource' must have patch operation that at least supports the update of tags. It's strongly recommended that the PATCH operation supports update of all mutable properties as well.

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@azuresdkciprbot
Copy link

AutoRest linter results for SDK Related Validation Errors/Warnings

These errors are reported by the SDK team's validation tools, reachout to ADX Swagger Reviewers directly for any questions or concerns.

File: specification/monitor/resource-manager/readme.md

⚠️0 new Warnings.(17 total)
0 new Errors.(0 total)

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants