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

api: change RetrieveProperties to collect results in batches #3408

Merged
merged 3 commits into from
Apr 12, 2024

Conversation

dougm
Copy link
Member

@dougm dougm commented Apr 11, 2024

'RetrieveProperties' is deprecated since 4.1
Use RetrievePropertiesEx + ContinueRetrievePropertiesEx to collect in batches.

@dougm dougm force-pushed the RetrievePropertiesEx branch 3 times, most recently from f75833d to dc157ad Compare April 11, 2024 05:22
Copy link
Member

@akutz akutz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, but there is no coverage for the change. I will create a test that covers the new code and open a PR against this PR branch.
image

@akutz
Copy link
Member

akutz commented Apr 11, 2024

I opened dougm#2 against this PR to pull in some tests. I will also be honest, one thing has me worried, the documentation around RetrievePropertiesEx's MaxObjects field:

The maximum number of ObjectContent data objects that should be returned in a single result from RetrievePropertiesEx.

An unset value indicates that there is no maximum. In this case PropertyCollector policy may still limit the number of objects. Any remaining objects may be retrieved with ContinueRetrievePropertiesEx.

A positive value causes RetrievePropertiesEx to suspend the retrieval when the count of objects reaches the specified maximum. PropertyCollector policy may still limit the count to something less than maxObjects. Any remaining objects may be retrieved with ContinueRetrievePropertiesEx.

A value less than or equal to 0 is illegal.

Specifically the last line -- A value less than or equal to 0 is illegal. I checked, and neither the options property for RetrievePropertiesEx is nillable, nor is the maxObjects property for the RetrieveOptions struct. Will those notes mean that a zero value is always sent over the wire if no non-empty value is specified?

dougm and others added 3 commits April 11, 2024 10:45
'RetrieveProperties' is deprecated since 4.1
Use RetrievePropertiesEx + ContinueRetrievePropertiesEx to collect in batches.
This patch adds support to vC Sim for RetrievePropertiesEx
and ContinueRetrievePropertiesEx and their paged results
semantics.
Copy link
Member

@akutz akutz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, thanks @dougm !

@dougm dougm merged commit 7a51544 into vmware:main Apr 12, 2024
10 checks passed
@dougm dougm deleted the RetrievePropertiesEx branch April 12, 2024 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants