-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Fixing global parameters for siterecovery and resourcehealth #1753
Conversation
… parameters and not as client properties
…Moreover it is not being used anywhere. So removing it.
@@ -548,13 +548,6 @@ | |||
"description": "The name of the resource group.", | |||
"x-ms-parameter-location": "method" | |||
}, | |||
"ResourceTypeParameter": { |
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.
it appears this wasn't been used in the spec or any others in the repo, right? so removing it shouldn't cause any harm.
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.
it was not being used and having it in the global parameters section was causing this to be a client property.
@@ -564,13 +564,6 @@ | |||
"description": "The name of the resource group.", | |||
"x-ms-parameter-location": "method" | |||
}, | |||
"ResourceTypeParameter": { |
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.
same situation as above here?
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.
yup
@@ -14122,14 +14122,16 @@ | |||
"in": "path", | |||
"description": "The name of the resource group where the recovery services vault is present.", | |||
"required": true, | |||
"type": "string" | |||
"type": "string", | |||
"x-ms-parameter-location": "method" |
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 issue was not having this causing? what's the breaking change on generated code due to this?
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.
new SiteRecoveryManagementClient(credentials, subscriptionId, resourceGroupName, resourceName);
This makes the client require resourceGroupName and resourceName in the client constructor. Both of these become client properties and that is incorrect. I had filed an issue in the linter repo about this. If it is management-plane swagger then the linter should warn if it sees anything else apart from subscriptionId and apiVersion and does not have x-ms-parameter-location set to method. Azure/azure-openapi-validator#84
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.
As responded over the mail thread:
As per our scenarios, customers are more likely to work in the context of a single ResourceName, so, It makes more sense to have ResourceGroupName and ResourceName in global parameters section for recoveryservicessiterecovery specification. For more context we have:
- https://github.com/Azure/azure-rest-api-specs/blob/current/specification/recoveryservices/resource-manager/Microsoft.RecoveryServices/2016-06-01/vaults.json which defines CRUD on ResourceName and hence, ResourceGroupName and ResourceName are already method parameters.
- However, specification at https://github.com/Azure/azure-rest-api-specs/tree/current/specification/recoveryservicessiterecovery/resource-manager is mostly sused by customer in the context of a single ResourceName. So, initializing ResourceGroupName and ResourceName at the time of client initialization aligns better to our customer scenario.
Moreover, any change as suggested in the thread would be a breaking change for our existing clients like PowerShell and Ibiza (requires passing ResourceGroupName and ResourceName explicitly as input to every call rather than just once at sdk client initialization) as I can understand, which we would not be able to take at this point.
Let us know if we are missing some point to understand here.
Thanks,
Avneesh
@mukum would you be ok with these updates? |
…ters wherever applicable in service fabric management plane.
4931eba
to
8983664
Compare
…the generated code.
@amarzavery is there a reason for adding Service Fabric changes to this PR? It'd be good to split them in another PR, since we'd want to have someone from that team take a look. |
All of them are fixing the same thing. Hence grouped them together. |
@sankalpsoni for ResourceHealth spec update, any concerns with the update? |
"2016-09-01" | ||
], | ||
"default": "2016-09-01" | ||
"type": "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.
@samedder - Can you please take a look at changes I made in the service fabric resource-manager spec.
- Some of the global parameters missed the
"x-ms-parameter-location": "method"
extension. - The enum array is not required in the first place and it had an incorrect value as well. If the value has to be present then it should be in sync with the api-version in the file path that is "2017-07-01-preview" in this case.
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.
@chingchenmsft needs to sign off on this. I believe this may break our clients so he should verify.
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.
Can you fix the description as well? "This is a required parameter and it's value must be "2016-09-01"."
@@ -7399,7 +7399,7 @@ | |||
}, | |||
"ServicePlacementPreferPrimaryDomainPolicyDescription": { | |||
"x-ms-discriminator-value": "PreferPrimaryDomain", | |||
"description": "Describes the policy to be used for placement of a Service Fabric service where the service's Primary replicas should optimally be placed in a particular domain.\n\nThis placement policy is usually used with fault domains in scenarios where the Service Fabric cluster is geographically distributed in order to indicate that a service�s primary replica should be located in a particular fault domain, which in geo-distributed scenarios usually aligns with regional or datacenter boundaries. Note that since this is an optimization it is possible that the Primary replica may not end up located in this domain due to failures, capacity limits, or other constraints.\n", | |||
"description": "Describes the policy to be used for placement of a Service Fabric service where the service's Primary replicas should optimally be placed in a particular domain.\n\nThis placement policy is usually used with fault domains in scenarios where the Service Fabric cluster is geographically distributed in order to indicate that a service's primary replica should be located in a particular fault domain, which in geo-distributed scenarios usually aligns with regional or datacenter boundaries. Note that since this is an optimization it is possible that the Primary replica may not end up located in this domain due to failures, capacity limits, or other constraints.\n", |
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.
@samedder - In this commit I have replaced the MS Word style single quote with simple single quote as it generates wonky characters in the generated client documentation.
"2016-09-01" | ||
], | ||
"default": "2016-09-01" | ||
"type": "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.
@chingchenmsft needs to sign off on this. I believe this may break our clients so he should verify.
@juhacket is the owner now, need his sign off. |
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: File: File: File: 💡 Please review potentially introduced Error(s)/Warning(s): Analysis Report 💡 AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
@lmazuel - Can you help take a look at the python generator issue over here.
|
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: File: File: File: 💡 Please review potentially introduced Error(s)/Warning(s): Analysis Report 💡 AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
@amarzavery CI fixed |
@amarzavery I believe we're missing response from ResourceHealth on the change. SiteRecovery changes would need to be updated based on the response from the team. Are we signed off from Service Fabric side? |
No description provided.