Skip to content
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

Specs for Microsoft.PolicyInsights GA version (2018-04-04) #2929

Merged
merged 20 commits into from
Apr 27, 2018

Conversation

bulentelmaci
Copy link
Contributor

@bulentelmaci bulentelmaci commented Apr 23, 2018

Adding swagger specs for Microsoft.PolicyInsights GA version "2018-04-04". The specs are identical to the latest preview version "2017-12-12-preview", except addition of a property to response schema of */summarize paths (PolicyDefinitionSummary schema has the new property "policyDefinitionReferenceId").

Also added to readme.md and made it the default version.

Please diff 2017-12-12-preview specs with 2018-04-04 specs to see the limited set of changes.

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

…approval request pending) suppressions; add new suppression for equivalent paths error (approval request pending)
…onalProperties; add @odata.count to operations; remove "type" from "rows" in first 2017-08-09-preview and add descriptions
…files for each version (one per namespace is sufficient as long as both files are fed into autorest as a bundle)
Reorganize files (remove resource type based subfolders; rename conflicting example files to have resource type name; change swagger spec files and MD file based on new file locations and names); change modelAsString for x-ms-enum to true based on API review board recommendation
@AutorestCI
Copy link

AutorestCI commented Apr 23, 2018

Automation for azure-sdk-for-node

Nothing to generate for azure-sdk-for-node

@AutorestCI
Copy link

AutorestCI commented Apr 23, 2018

Automation for azure-sdk-for-python

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

@AutorestCI
Copy link

AutorestCI commented Apr 23, 2018

Automation for azure-libraries-for-java

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

@AutorestCI
Copy link

AutorestCI commented Apr 23, 2018

Automation for azure-sdk-for-go

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

@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/policyinsights/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 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/policyinsights/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.

@sarangan12 sarangan12 removed their assignment Apr 24, 2018
@sarangan12 sarangan12 removed their request for review April 24, 2018 21:46
@azuresdkci azuresdkci requested a review from sarangan12 April 24, 2018 22:04
@@ -30,7 +30,7 @@
}
},
"paths": {
"/{managementGroupId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
"/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this modeled as an enum instead of putting the value of the namespace in the URL itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

autorest/oav validation does not like it. Errors out saying that a spec can only be defined for one namespace. This is the workaround I had found in our previous release. It results in identical API; since it is a single valued enum, it turns into a const string part of path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As a note, there is no change here from previous version. The change you pointed out the comment on was done on the previous version to fix a different validation issue where multiple paths with matching template but different path parameter names (e.g. managementGroupId, vs. policyDefinitionId, etc.) was not acceptable.

}
}
},
"/{policySetDefinitionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
"/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
Copy link
Contributor

Choose a reason for hiding this comment

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

authorizationnamespace - why an enum? instead of putting Microsoft.Authorization

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please see above.

@@ -1079,9 +1247,15 @@
}
}
},
"Operations": {
"OperationsListResults": {
"description": "List of available operations.",
"properties": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no change to this from the previous version. I am not able to see what is incompliant. Could you please point out specific parts?

@ravbhatnagar
Copy link
Contributor

Looks good. Signing off!

@ravbhatnagar ravbhatnagar added WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Apr 26, 2018
@sarangan12 sarangan12 assigned mcardosos and unassigned sarangan12 Apr 26, 2018
@sarangan12 sarangan12 requested review from mcardosos and removed request for sarangan12 April 26, 2018 22:54
"paths": {
"/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults": {
"post": {
"operationId": "PolicyEvents_ListQueryResultsForManagementGroup",
Copy link
Contributor

Choose a reason for hiding this comment

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

PolicyEvents_ListQueryResultsForManagementGroup [](start = 24, length = 47)

Could this be a pageable operation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't support paging right now. There is no change in this version from the previous one with respect to that

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, the returing schema does not need to have a next link. In the extension, the next link can be set to null, but still generate cool code to iterate on the array.
WDYT?

See example 3
https://github.com/Azure/autorest/tree/master/docs/extensions#x-ms-pageable


In reply to: 184759379 [](ancestors = 184759379)

},
{
"$ref": "#/parameters/applyParameter"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used it. See QueryOptions

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome :)


In reply to: 184759834 [](ancestors = 184759834)

"QueryFailure": {
"description": "Error response.",
"properties": {
"error": {
Copy link
Contributor

Choose a reason for hiding this comment

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

error [](start = 9, length = 5)

I am not a big fan of defining stuff inline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've found this easier to read since there are just two parameters and is extremely unlikely to change in the future (all of ARM is using the same). If you are feeling strong about it I can change; I just want to avoid changes from the previous specs if I can to minimize risk here.

},
"/providers/Microsoft.PolicyInsights/operations": {
"get": {
"operationId": "Operations_List",
Copy link
Contributor

Choose a reason for hiding this comment

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

Operations_List [](start = 24, length = 15)

Pageable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pageability is planned for future (we have backend issues to be resolved for this for us to expose it in the API)

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