Changed type of Integer anyType parameters to int from long. #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not sure if this is always appropriate to do or whether some sort of hint could be provided somehow to allow it to be tweaked. Seems that the long is being rejected by some validation of the anyType in vSphere.
Always setting to long or int seems like it will potentially break things that are expecting other types. I thought about looking at the size of the integer and selecting the appropriate xml type, but again this would potentially break parts of the API expecting an int (I have checked this with my use case which is to delete a DRS rule and short or long types break validation)
Example use case:
cluster = search.dc.find_compute_resource 'cluster_name'
rule_spec = RbVmomi::VIM.ClusterRuleSpec(
operation: RbVmomi::VIM.ArrayUpdateOperation('remove'),
removeKey: 2
)
spec = RbVmomi::VIM.ClusterConfigSpecEx(:rulesSpec => [rule_spec])
cluster.ReconfigureComputeResource_Task(
spec: spec,
modify: true
).wait_for_completion
This fails currently as the api expects a int xml type for the removeKey where the current implementation sends it as a long. I have tested sending as a short and this also fails.
I think that being able to send in a hint somehow would be the best idea, but looks like a big refactor in the "Here be dragons" code.