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

Swagger for diagnostic settings and association resource types #3295

Merged
merged 24 commits into from
Jul 9, 2018

Conversation

sankalpsoni
Copy link
Contributor

@sankalpsoni sankalpsoni commented Jun 23, 2018

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

@AutorestCI
Copy link

AutorestCI commented Jun 23, 2018

Automation for azure-sdk-for-python

Nothing to generate for azure-sdk-for-python

@AutorestCI
Copy link

AutorestCI commented Jun 23, 2018

Automation for azure-sdk-for-node

Nothing to generate for azure-sdk-for-node

@AutorestCI
Copy link

AutorestCI commented Jun 23, 2018

Automation for azure-sdk-for-java

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

@AutorestCI
Copy link

AutorestCI commented Jun 23, 2018

Automation for azure-sdk-for-ruby

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

@AutorestCI
Copy link

AutorestCI commented Jun 23, 2018

Automation for azure-sdk-for-go

Nothing to generate for azure-sdk-for-go

@annatisch
Copy link
Member

Thanks @sankalpsoni!
There's still a number of model validation errors:
https://travis-ci.org/Azure/azure-rest-api-specs/jobs/396031137

And linter errors - both missing examples and ARM violations:
https://travis-ci.org/Azure/azure-rest-api-specs/jobs/396031137

Are you able to take a look?

@sankalpsoni
Copy link
Contributor Author

sankalpsoni commented Jun 26, 2018

Are you talking errors which are reported in "Allowed Failures"? I am presuming that they should not block the sign off.

What is the next step in the review?

@annatisch Can you confirm if the "Allowed Failures" are must fix?

@annatisch annatisch added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Jun 26, 2018
"$ref": "#/definitions/GuestDiagnosticSettingsResource"
}
},
"404": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldnt this be handled by the "default" error response? I dont think you need to add it explicitly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

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

Choose a reason for hiding this comment

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

Since guestDiagnosticSettings is a top level tracked resource, supporting PATCH is required. Ideally it should support updating all patchable properties. But at the least, it should support updating tags.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

},
"paths": {
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/guestDiagnosticSettings/{diagnosticSettingsName}": {
"put": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a long running 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.

Nope. Should be completed in ms.

"location": "Global",
"tags": {},
"properties": {
"osType": "windows",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we capitalize the first letter of the OSes -- Windows/Linux?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

},
"sinks": [
{
"kind": "LogAnalytics"
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you need the details for the kind? The workspace resource ID at least?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not for this private preview. Remember - multi-homing is not supported. Workspace resource id would be passed by extension

@@ -0,0 +1,42 @@
{
"parameters": {
"resourceUri":"subscriptions/4abcdefgh-ijkl-mnop-qrstuvwxyz/resourceGroups/rhctestenv/providers/Microsoft.ClassicCompute/virtualMachines/rhctestenvV1PI",
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't our default example be an ARM VM?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

{
"parameters": {
"resourceUri":"subscriptions/4abcdefgh-ijkl-mnop-qrstuvwxyz/resourceGroups/rhctestenv/providers/Microsoft.ClassicCompute/virtualMachines/rhctestenvV1PI",
"diagnosticSettingsAssociationName": "SampleAssociationName",
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe "centralITDefault" would be a better name to use as a sample.

"parameters": {
"subscriptionId": "187f412d-1758-44d9-b052-169e2564721d",
"resourceGroupName": "Default-ResourceGroup",
"diagnosticSettingsName": "SampleDiagSetting",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: instead of SampleDiagSetting, use "productionMachineSetting" , which is more like a real customer scenario (one setting for all production machines)

@johnkemnetz
Copy link
Contributor

@sankalpsoni looks good to me.

"/subscriptions/{subscriptionId}/providers/microsoft.insights/guestDiagnosticSettings": {
"get": {
"description": "Get a list of all guest diagnostic settings in a subscription.",
"operationId": "guestDiagnosticsSettings_ListBySubscriptionId",
Copy link
Member

Choose a reason for hiding this comment

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

This can be renamed to: "guestDiagnosticsSettings_List" as the subscription ID is implicit.

"/subscriptions/{subscriptionId}/providers/microsoft.insights/guestDiagnosticSettingsAssociations": {
"get": {
"description": "Get a list of all guest diagnostic settings association in a subscription.",
"operationId": "guestDiagnosticsSettingsAssociation_ListBySubscriptionId",
Copy link
Member

Choose a reason for hiding this comment

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

This can be renamed to: "guestDiagnosticsSettingsAssociation_List" as the subscription ID is implicit.

},
"description": "Virtual machine guest diagnostics settings resource."
},
"DiagnosticSettings": {
Copy link
Member

Choose a reason for hiding this comment

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

This model name is incompatible with an already existing model name:
https://github.com/Azure/azure-rest-api-specs/blob/master/specification/monitor/resource-manager/microsoft.insights/preview/2017-05-01-preview/diagnosticsSettings_API.json#L277

Do you intend to generate both specs into the same SDK? If so, this will need to be renamed (e.g. "GuestDiagnosticSettings"). Otherwise if this spec is intended to replace diagnosticSettings_API then it should be okay.

"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"name": "diagnosticSettingsPatch",
Copy link
Member

Choose a reason for hiding this comment

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

Could this please be renamed to just "name: "parameters"
We try to avoid API terms like "patch" in the clients :)

"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/guestDiagnosticSettings": {
"get": {
"description": "Get a list of all guest diagnostic settings in a resource group.",
"operationId": "guestDiagnosticsSettings_ListByRG",
Copy link
Member

Choose a reason for hiding this comment

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

Please revert this to "guestDiagnosticsSettings_ListByResourceGroup"
This one didn't need to be changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/guestDiagnosticSettingsAssociations": {
"get": {
"description": "Get a list of all guest diagnostic settings association in a resource group.",
"operationId": "guestDiagnosticsSettingsAssociation_ListByRG",
Copy link
Member

Choose a reason for hiding this comment

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

Please revert this to "guestDiagnosticsSettingsAssociation_ListByResourceGroup"
This one didn't need to be changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"$ref": "#/parameters/DiagnosticSettingsAssociationNameParameter"
},
{
"name": "diagnosticSettingsAssociation",
Copy link
Member

@annatisch annatisch Jun 29, 2018

Choose a reason for hiding this comment

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

Is there are reason you revert the name from "parameters" here? It's not an issue, but I'm curious - as it would then be consistent with the other patch 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.

I do not remember. I have changed it back,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now I know - it caused Model validation error. Done correctly now :)

@annatisch
Copy link
Member

ping @sankalpsoni

@annatisch
Copy link
Member

This PR is missing ARM sign-off. Since many days have passed, please let me know if you prefer to:

  1. follow up with ravbhatnagar and wait, or
  2. I can merge the PR without ARM’s team sign-off. Please note that even after merge, you should follow up with ARM team regarding ARM issues and fixes may impact the specs and/or generated SDKs. Thanks!

ping @ravbhatnagar

@ravbhatnagar ravbhatnagar added 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 Jul 9, 2018
@ravbhatnagar
Copy link
Contributor

Reviewed over PR and skype. Looks good.

@annatisch annatisch merged commit 49901c0 into Azure:master Jul 9, 2018
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.

5 participants