Skip to content
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

Changed type of Integer anyType parameters to int from long. #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

antroy
Copy link

@antroy antroy commented May 12, 2014

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.

… 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant