-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Adding a new api to fetch the health details of the resource "vault". Apart form this this PR also contains some fixes based on some new rules added in the auto rest linter tool. #1506
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
Conversation
|
@mukum, |
|
Sorry to bother, but reopening PR to test CI builds. |
|
@mukum, |
|
@ravbhatnagar please take a look, thanks! |
ravbhatnagar
left a comment
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.
@mukum - This PR contains a lot of changes like new property additions, newly added models, adding APIs etc. We only discussed the new API changes in our meeting and so Many of the other changes are difficult to understand. Once you have addressed the questions/comments in the PR, please schedule a review with the Azure API review board ( @johanste , @NiklasGustafsson ) and myself.
| "200": { | ||
| "description": "OK", | ||
| "schema": { | ||
| "$ref": "#/definitions/VaultHealthDetails" |
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 this is not a tracked resource, you dont need location in the response body
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.
Agree, But since all our proxy resource derive from a common base class hence it is there.
| "description": "class to define the summary of the health error details.", | ||
| "type": "object", | ||
| "properties": { | ||
| "summaryCode": { |
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 think this could be an enum with a known set of values.
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 this is the error code only which we have exposed at other classes as well, like health error, we don't feel this to be exposed as an enum hence going ahead with string.
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 property read only?
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.
Hi Veronica, yes it is a read only property. Our service is bit different as we have the get and put object schema different, hence even if we don't mark it read only the client cannot used the same object received in the get call to Put/Update. Although i agree marking a property read only is a good practice and we have this as one of our backlog item while moving to the next api version.
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.
ok, thanks, yes, I would recommend doing that in your next version if you don't see it being possible now (or causes a breaking change).
| "description": "The code of the health error.", | ||
| "type": "string" | ||
| }, | ||
| "category": { |
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 think this could be an enum with a known set of values.
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.
Agree changing it to enum.
| "description": "The category of the health error.", | ||
| "type": "string" | ||
| }, | ||
| "severity": { |
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 think this could be an enum with a known set of values.
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.
Agree changing it to enum.
| "application/json" | ||
| ], | ||
| "paths": { | ||
| "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth": { |
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 API also giving the health summary for all the child resources of vault (fabric/ protectedItem etc)? If yes, then does the caller of this API need to have read access on all the underlying resources as well. Also, from the API signature it is unclear. Moreover, in the payload it will be unclear which "replicationItem" does a particular issue correspond to? Am I missing something?
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.
No gaurav, This API will give give the health summary of immediate child resources only. At the vault level we are going with the exception which would give protected items level summary as well.
Yes the caller of the API will need to have the read access on the underlying resources and we will give the same. In the payload you can see each health summary contains the list of affectedResourceCorrelationId to related this health impacts which all resources.
| "description": "Type of error.", | ||
| "type": "string" | ||
| }, | ||
| "errorLevel": { |
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 be an enum
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.
These are pre approved classes/object model and any change now will be a breaking change.
| "description": "DRA error message.", | ||
| "type": "string" | ||
| }, | ||
| "entityId": { |
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.
What is this entityId?
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 is the correlation id of the health with the impacted resource.
| "description": "ID of the entity.", | ||
| "type": "string" | ||
| }, | ||
| "childErrors": { |
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.
Which child error corresponds to which event? how will this be used?
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 is a new property getting added. Will need a api-version update.
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.
All errors relate to the same entity. There is a "root cause and impact" kind of relationship between them hence root cause is the parent and impact health errors are the child.
Since all are object are discovered object(not client created) hence this new property added shouldn't require the api-version update.
| } | ||
| } | ||
| }, | ||
| "EventQueryParameter": { |
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.
How will this model be used?
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 will be used to query the list of events based on the filters provided as part of the EventQueryParameter. This will have value like startdate to enddate, severity of the filter... impacted resourcee name and so...on..
| "$ref": "#/definitions/HealthError" | ||
| } | ||
| }, | ||
| "failoverHealthErrorDetails": { |
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.
So you the health status property has been added to the GETs of fabric etc. Why do you need a separate API to just get the healthStatus? Also, new properties have been added all across this swagger. This would require an api-version change on both service and swagger.
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.
The health summary detail is the summary of the container level resource. The purpose of this is to give a dashboard kind of view at the container level resource like vault/fabric. As stated earlier since we have discovered resources only adding a new property shouldn't be a breaking change.
|
@veronicagg - This may need to be reviewed in person with the Azure API review board. The newly added properties and models are not are not self explanatory. The API that is being added is fine and feedback has been provided on that. |
|
@ravbhatnagar thanks! will wait for API review board sign off. |
veronicagg
left a comment
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 review linter errors at https://travis-ci.org/Azure/azure-rest-api-specs/jobs/261175730#L675
Please review examples errors - invalid format for date-time:
| "description": "class to define the summary of the health error details.", | ||
| "type": "object", | ||
| "properties": { | ||
| "summaryCode": { |
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 property read only?
|
@mukum @ravbhatnagar have you been able to sync on ARM feedback? |
|
@veronicagg - No, we haven't been able to agree on the right design for this API yet. We are close though and should be able to close today or Monday. @mukum - FYI. |
|
@ravbhatnagar once you're good with the changes on this PR, please label it and let me know, thanks! |
|
@mukum - The change for the new API looks good now. However, as discussed earlier it seems that there are new properties in this swagger that were already added on the service side but getting added to swagger now. Please confirm if thats the case. Because in such cases, an api-version update is required. |
|
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 and make AutoRest Linter Azure Bot smarter day by day! Thanks for your co-operation. |
|
thanks @ravbhatnagar. |
|
@veronicagg |
|
@ravbhatnagar as discussed earlier, since we have the get and put object schema completely different, hence adding a new property in the get object schema doesn't require a version update. |
veronicagg
left a comment
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.
Thanks @mukum .
On camel casing, ok.
For Job model which has additional properties at the top level, as far as I know it's not allowed for ARM, @ravbhatnagar could you confirm you approved this?
Have you considered flattening properties per the warnings at https://travis-ci.org/Azure/azure-rest-api-specs/jobs/264396941#L1286?
Have you evaluated if the boolean properties flagged should be considered for enums? ex. https://travis-ci.org/Azure/azure-rest-api-specs/jobs/264396941#L1934
Do you have any questions on the "TrackedResource...." warnings? have you evaluated them?
thanks!
| ], | ||
| "summary": "Adds a recovery services provider.", | ||
| "description": "The operation to add a recovery services provider.", | ||
| "operationId": "ReplicationRecoveryServicesProviders_Create", |
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.
Operation missing example: https://travis-ci.org/Azure/azure-rest-api-specs/jobs/264396941#L950
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.
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.
@veronicagg For Job model this is the PR"#1209" where i guess it was closed. Since we are not changing the version of the API we are not making that change.
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.
@veronicagg Booleans properties we have evaluated and we don't feel the need to change it to enum.
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.
@veronicagg Gone through the different tracked resources warning. Since there is no version upgrade we don't want to introduce new api's. We will try to accommodate the warning scenarios with the newer version release.
|
@mukum there looks to be some model validation errors too, please review: https://travis-ci.org/Azure/azure-rest-api-specs/jobs/264396943#L657 |
|
@ravbhatnagar please add the sign-off label once you approve this PR. I see that there are breaking changes being introduced, so I'd like have confirmation on sign-off from ARM team. |
|
@veronicagg - from what I can see in the PR, jobs is an existing model. So issues in the model are older issues. As discussed we will get issues with existing APIs/models fixed in a separate cycle. Other property additions have already happened in the service and these are being added to swagger now. |
|
Thanks @ravbhatnagar. |
|
@mukum any updates? |
|
@mukum please respond to the feedback to avoid closing this PR due to lack of activity Thanks Samer |
|
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 and make AutoRest Linter Azure Bot smarter day by day! Thanks for your co-operation. |
|
Thanks @mukum for addressing the issues. |
|
No modification for AutorestCI/azure-sdk-for-ruby |
|
No modification for AutorestCI/azure-sdk-for-node |
|
No modification for AutorestCI/azure-sdk-for-python |
… Apart form this this PR also contains some fixes based on some new rules added in the auto rest linter tool. (Azure#1506) * Adding vault health detail api. * Changes related to vault health dashboard api * Removing the api RecoveryServicesProvider and making the examples for job fixed.
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-versionin the path should match theapi-versionin the spec).Quality of Swagger