-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Conversation
Automation for azure-sdk-for-pythonNothing to generate for azure-sdk-for-python |
Automation for azure-sdk-for-nodeNothing to generate for azure-sdk-for-node |
Automation for azure-sdk-for-javaThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-rubyThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-goNothing to generate for azure-sdk-for-go |
Thanks @sankalpsoni! And linter errors - both missing examples and ARM violations: Are you able to take a look? |
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? |
"$ref": "#/definitions/GuestDiagnosticSettingsResource" | ||
} | ||
}, | ||
"404": { |
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.
Shouldnt this be handled by the "default" error response? I dont think you need to add it explicitly
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.
Done
} | ||
} | ||
}, | ||
"paths": { |
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.
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.
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.
Done
}, | ||
"paths": { | ||
"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/guestDiagnosticSettings/{diagnosticSettingsName}": { | ||
"put": { |
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.
Is this a long running operation?
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.
Nope. Should be completed in ms.
"location": "Global", | ||
"tags": {}, | ||
"properties": { | ||
"osType": "windows", |
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.
Can we capitalize the first letter of the OSes -- Windows/Linux?
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.
Done
}, | ||
"sinks": [ | ||
{ | ||
"kind": "LogAnalytics" |
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.
Don't you need the details for the kind? The workspace resource ID at least?
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.
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", |
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.
Shouldn't our default example be an ARM VM?
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.
Done
{ | ||
"parameters": { | ||
"resourceUri":"subscriptions/4abcdefgh-ijkl-mnop-qrstuvwxyz/resourceGroups/rhctestenv/providers/Microsoft.ClassicCompute/virtualMachines/rhctestenvV1PI", | ||
"diagnosticSettingsAssociationName": "SampleAssociationName", |
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.
Maybe "centralITDefault" would be a better name to use as a sample.
"parameters": { | ||
"subscriptionId": "187f412d-1758-44d9-b052-169e2564721d", | ||
"resourceGroupName": "Default-ResourceGroup", | ||
"diagnosticSettingsName": "SampleDiagSetting", |
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.
Suggestion: instead of SampleDiagSetting, use "productionMachineSetting" , which is more like a real customer scenario (one setting for all production machines)
@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", |
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 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", |
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 can be renamed to: "guestDiagnosticsSettingsAssociation_List"
as the subscription ID is implicit.
}, | ||
"description": "Virtual machine guest diagnostics settings resource." | ||
}, | ||
"DiagnosticSettings": { |
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 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", |
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.
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", |
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 revert this to "guestDiagnosticsSettings_ListByResourceGroup"
This one didn't need to be changed.
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.
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", |
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 revert this to "guestDiagnosticsSettingsAssociation_ListByResourceGroup"
This one didn't need to be changed.
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.
Done
"$ref": "#/parameters/DiagnosticSettingsAssociationNameParameter" | ||
}, | ||
{ | ||
"name": "diagnosticSettingsAssociation", |
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.
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.
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 do not remember. I have changed it back,
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.
Now I know - it caused Model validation error. Done correctly now :)
ping @sankalpsoni |
This PR is missing ARM sign-off. Since many days have passed, please let me know if you prefer to:
ping @ravbhatnagar |
Reviewed over PR and skype. Looks good. |
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-version
in the path should match theapi-version
in the spec).Quality of Swagger