[DO-NOT-MERGE] Add new resource type /events for Azure service health events#2127
[DO-NOT-MERGE] Add new resource type /events for Azure service health events#2127HimanshuMisra1 wants to merge 11 commits intoAzure:masterfrom
Conversation
|
@HimanshuMisra1 please pull the Swagger file out of the |
|
@ravbhatnagar new Swagger |
…sources by the service health event
| "name": "VIRTUALMACHINES-WESTUS-DTR1", | ||
| "type": "/providers/Microsoft.ResourceHealth/events", | ||
| "properties": { | ||
| "eventType": "serviceissue", |
There was a problem hiding this comment.
The allowed values for eventType and eventSource have a different spelling than specified here - please adjust either the enum definitions or the example (to match your actual service as it is deployed right now)
There was a problem hiding this comment.
Changed the examples to use correct values from enum.
|
Please adjust the |
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "The body contains the list of the current service health events in the subscription", |
There was a problem hiding this comment.
Nit: Replace The body contains the with The in this Swagger - since this description makes it into high level artifacts like SDKs and such, descriptions should rather not talk about REST technicalities. 🙂
| }, | ||
| "nextLink": { | ||
| "type": "string", | ||
| "description": "The URI to fetch the next page of events. Call ListNext() with this URI to fetch the next page of events." |
There was a problem hiding this comment.
same as mentioned above: please remove part about "ListNext" - it is actually not called that way in some languages others even retrieve pages on the fly.
There was a problem hiding this comment.
Fixed, Thanks
| ], | ||
| "description": "The List events operation response." | ||
| }, | ||
| "event": { |
There was a problem hiding this comment.
Is this a resource? If so, please model it as such. See for example https://github.com/Azure/azure-rest-api-specs/blob/current/specification/compute/resource-manager/Microsoft.Compute/2017-12-01/compute.json#L3509-L3526. You actually don't have to copy the definition of Resource into your Swagger but can reference the common definition in https://github.com/Azure/azure-rest-api-specs/blob/current/specification/common-types/resource-management/v1/types.json 🙂
| "description": "Microsoft.ResourceHealth/events" | ||
| }, | ||
| "properties": { | ||
| "type": "object", |
There was a problem hiding this comment.
Usually properties of resources are flattened, as you can also see here (slightly better user experience)
There was a problem hiding this comment.
Fixed, Thanks
| "enum": [ | ||
| "Available", | ||
| "Unavailable", | ||
| "Degraded", |
There was a problem hiding this comment.
Added enum value. Breaking change.
There was a problem hiding this comment.
What is action item on us here?
There was a problem hiding this comment.
Not necessarily anything, but:
- any SDKs/CLIs derived from this Swagger will have to bump their major version
- you may wanna consider changing
modelAsStringtotruesince that would make enum-additions no breaking change in the future
There was a problem hiding this comment.
Got it, Thanks
olydis
left a comment
There was a problem hiding this comment.
I assume ARM will also have comments, but here is some feedback for the time being.
| }, | ||
| "allOf": [ | ||
| { | ||
| "$ref": "#/definitions/Resource" |
There was a problem hiding this comment.
just $ref ../../../../common-types/resource-management/v1/types.json#/definitions/Resource here, then you can remove the definition of Resource above (which is also slightly invalid since you $ref the entire file "types.json" up there, but really you just want to extract /definitions/Resource from that file) 🙂
| "description": "List subscription impacted by the service health event.", | ||
| "items": { | ||
| "type": "string", | ||
| "description": "Subscription impacted by the service health event." |
There was a problem hiding this comment.
I don't understand why there is a list of subscriptions in here, the events are returned at subscription level, either this is not required or the API is returning data that it should not? Is the intent that there should be a tenant level API where this is returned?
There was a problem hiding this comment.
Yes, the intent is to have a tenant level API. The objects returned are tenant level objects and will talk about multiple subscriptions. Since that feature in ARM will be ready by April, 2018, we have to live with exposing single subscription requests. The array in such case will contain only one subscription.
| "properties": { | ||
| "type": "object", | ||
| "description": "Properties of availability state.", | ||
| "properties": { |
There was a problem hiding this comment.
Looks like there is an extra properties object here?
There was a problem hiding this comment.
I don't think so.
… definition in common types
| @@ -0,0 +1,876 @@ | |||
| { | |||
There was a problem hiding this comment.
In accordance with the new format, introduced late December 2017, please update this PR so that the "2018-01-01" directory is in either a folder named "stable" or "preview". e.g.
resource-manager/Microsoft.ResourceHealth/2018-01-01/ResourceHealth.json -> resource-manager/Microsoft.ResourceHealth/preview/2018-01-01/ResourceHealth.json
or
resource-manager/Microsoft.ResourceHealth/2018-01-01/ResourceHealth.json -> resource-manager/Microsoft.ResourceHealth/preview/2018-01-01/ResourceHealth.json
|
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: File: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
1 similar comment
|
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: File: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
|
Signed off! |
| "id": "<resourceId>/providers/Microsoft.ResourceHealth/impactedResources/current", | ||
| "name": "current", | ||
| "type": "Microsoft.ResourceHealth/impactedResources", | ||
| "location": "eastus", |
There was a problem hiding this comment.
having location here indicates that what you return is actually a tracked resource. Please make sure or adjust the example accordingly
|
@HimanshuMisra1 What's the timeline for this? Is this marked as "do not merge" because the service isn't live yet? |
|
@salameer @HimanshuMisra1 closing due to inactivity. Feel free to reopen once you're ready to move on 🙂 |
|
This commit was treated and no generation was made for Azure/azure-sdk-for-go |
Swagger to SDK encountered an unknown error: (Azure/azure-sdk-for-go)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/github_tools.py", line 29, in exception_to_github
yield context
File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/restapi/github.py", line 180, in rest_handle_action
return rest_pull_close(body, github_con, restapi_repo, sdk_pr_target_repo, sdkbase)
File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/restapi/github.py", line 311, in rest_pull_close
rest_pr.create_issue_comment("Was unable to create SDK %s PR for this closed PR.", sdkid)
TypeError: create_issue_comment() takes 2 positional arguments but 3 were given |
|
This commit was treated and no generation was made for Azure/azure-sdk-for-python |
Swagger to SDK encountered an unknown error: (Azure/azure-sdk-for-python)
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/github_tools.py", line 29, in exception_to_github
yield context
File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/restapi/github.py", line 180, in rest_handle_action
return rest_pull_close(body, github_con, restapi_repo, sdk_pr_target_repo, sdkbase)
File "/usr/local/lib/python3.6/dist-packages/swaggertosdk/restapi/github.py", line 311, in rest_pull_close
rest_pr.create_issue_comment("Was unable to create SDK %s PR for this closed PR.", sdkid)
TypeError: create_issue_comment() takes 2 positional arguments but 3 were given |
Resource Health RP changes for new resource type /events.
This resource type will return all service health events (incidents/maintenance/advisories) that are either declared or detected from automated service monitoring using Geneva Health System.