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

RetrievePropertiesEx returns token "0" #217

Open
3 tasks done
Fabio1988 opened this issue Apr 2, 2024 · 0 comments
Open
3 tasks done

RetrievePropertiesEx returns token "0" #217

Fabio1988 opened this issue Apr 2, 2024 · 0 comments

Comments

@Fabio1988
Copy link

  • I am using the latest SDK version
  • This API is compatible with my vCenter version (You can get this info from the API documentation )
  • I have searched existing issues

Description

On asking for all virtual machines and using retrievePropertiesEx() it will return 100 objects and a token. using this token on continueRetrievePropertiesEx throws a Permission Denied Exception.

We tried the same with vmware govmomi and we receive 334 objects

Environment

  • SDK version: v8.0.2.1
  • Java version: openjdk 17.0.10 2024-01-16
  • vSphere version: vSphere 8.0

Steps or code snippet to reproduce

val propertyCollector = this.getServiceContent()?.propertyCollector
    ?: throw IllegalStateException("VMware Connection is open, but could not get property collector!")
val resultList = mutableListOf<ObjectContent>()
var retrieveResult = this.getPort()?.retrievePropertiesEx(propertyCollector, filters, options)
if (isResultEmpty(retrieveResult)) {
    // return the empty list
    return resultList
}
// add the current results, at this point, we know that retrieveResult is not null
resultList.addAll(retrieveResult!!.objects)
// continue the request to get remaining data chunks, if necessary
while (retrieveResult != null && retrieveResult.token != null) {
    // get the continuation token
    val token = retrieveResult.token
    // continue data fetching using the provided continuation token
    retrieveResult = this.getPort()?.continueRetrievePropertiesEx(propertyCollector, token)
    if (!isResultEmpty(retrieveResult)) {
        // again, at this point we know that retrieveResult is not empty
        resultList.addAll(retrieveResult!!.objects)
    }
}
return retrieveResult

Actual behavior

retrievePropertiesEx() returns 100 objects and a token of "0", and because of the token the continueRetrievePropertiesEx() is throwing an Permission Denied exception

Expected behavior

it should be possible to retrieve all 334 objects

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

No branches or pull requests

1 participant