Skip to content

RetrievePropertiesEx returns token "0" #217

@Fabio1988

Description

@Fabio1988
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions