Workload monitor add api version2#11039
Conversation
…liaweingart/azure-rest-api-specs into workloadMonitor-addApiVersion
[Staging] Swagger Validation Report
️✔️ |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Azure CLI Extension Generation - Release
No readme.md specification configuration files were found that are associated with the files modified in this pull request, or swagger_to_sdk section in readme.md is not configured
|
azure-sdk-for-go - Release
|
azure-sdk-for-java
|
azure-sdk-for-js - Release
No readme.md specification configuration files were found that are associated with the files modified in this pull request, or swagger_to_sdk section in readme.md is not configured
|
azure-sdk-for-net - Release
|
azure-sdk-for-python - Release
|
Trenton Generation - Release
No readme.md specification configuration files were found that are associated with the files modified in this pull request, or swagger_to_sdk section in readme.md is not configured
|
|
Azure Pipelines successfully started running 1 pipeline(s). |
azure-sdk-for-python-track2 - Release
No readme.md specification configuration files were found that are associated with the files modified in this pull request, or swagger_to_sdk section in readme.md is not configured
|
|
Azure Pipelines successfully started running 1 pipeline(s). |
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitors/{monitorId}": { | ||
| "get": { | ||
| "summary": "Get the current status of a monitor of a resource.", | ||
| "operationId": "MonitorInfo_Get", |
There was a problem hiding this comment.
The OperationId is important in client generation, it uses the form _, where OperationGroup is used to group together operations over the same resource. In this case, the OperationGroup should likely be 'Monitors' to match the OperationGroup in the list operation above.
There was a problem hiding this comment.
I updated the operation ids to be: Operations_List, Monitors_ListMonitors, Monitors_GetMonitor, MonitorHistory_ListStateChanges, MonitorHistory_GetStateChange. Are these okay? I guess in this case the operation groups would be 'operations' 'monitors' and 'monitorhistory' -- is this okay or are these meant to match something in the url?
There was a problem hiding this comment.
Generally you don't want to repeat the operation group name in the operation name, so these should be:
Operations_list
Monitors_List
I would also argu that you want to have ListStateChanges and GetStateChange as operations organized as monitor operations, i.e.:
Monitors_ListStateChanges
Monitors_GetStateChange
When generating clients, this will organize these operations with the other monitor operations
if not, then 'MonitorHistory' or 'MonitorStateChanges' should be an operations group, and this would give you:
MonitorStateChanges_List
MonitorStateChanges_Get
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitors/{monitorId}/history": { | ||
| "get": { | ||
| "summary": "Get history of a monitor of a resource (with optional filter).", | ||
| "operationId": "MonitorStateChanges_List", |
There was a problem hiding this comment.
Likely this shoudkl be 'Monitors_ListStateChanges'
There was a problem hiding this comment.
Changed to MonitorHistory_ListStateChanges?
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitors/{monitorId}/history/{timestampUnix}": { | ||
| "get": { | ||
| "summary": "Get the status of a monitor at a specific timestamp in history.", | ||
| "operationId": "MonitorHistoricalStateChange_Get", |
There was a problem hiding this comment.
Likely this should be 'Monitors_GetStateChange'
There was a problem hiding this comment.
Changed to MonitorHistory_GetStateChange
| "type": "string", | ||
| "example": "Microsoft.WorkloadMonitor/monitors" | ||
| }, | ||
| "properties": { |
There was a problem hiding this comment.
The suggested modelling of this is to have a specific schema definition that defines the properties property, rether than an inline definition. See: as an example: https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/Microsoft.Compute/stable/2020-06-30/disk.json#L1538
There was a problem hiding this comment.
I think I followed this example by defining an additional monitorProperties and a monitorStateChangeProperties
| } | ||
| } | ||
| }, | ||
| "Monitor": { |
There was a problem hiding this comment.
For tracked resources, it is important that this uses 'allOf' to extend the tyoe for an ARM resources. You can use a pattern like this: https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/Microsoft.Compute/stable/2020-06-30/disk.json#L1349
Or you can refer to the appropriate resource in common-types here: https://github.com/Azure/azure-rest-api-specs/blob/master/specification/common-types/resource-management/v2/types.json#L45
There was a problem hiding this comment.
Added an allOf encompassing the underlying MonitorResource - is this correct?
|
Reviewed the changes from previously approved PR #10817. |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| } | ||
| ] | ||
| }, | ||
| "MonitorResource": { |
There was a problem hiding this comment.
You should just call this Resource, otherwise, this looks correct.
|
Azure Pipelines successfully started running 1 pipeline(s). |
MSFT employees can try out our new experience at OpenAPI Hub - one location for using our validation tools and finding your workflow.
Contribution checklist:
If any further question about AME onboarding or validation tools, please view the FAQ.
ARM API Review Checklist
Ensure to check this box if one of the following scenarios meet updates in the PR, so that label “WaitForARMFeedback” will be added automatically to involve ARM API Review. Failure to comply may result in delays for manifest application. Note this does not apply to data plane APIs, all “removals” and “adding a new property” no more require ARM API review.
If you are blocked on ARM review and want to get the PR merged with urgency, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.
Breaking Change Review Checklist
If there are following updates in the PR, ensure to request an approval from API Review Board as defined in the Breaking Change Policy.
Please follow the link to find more details on PR review process.