Hello,
I'm experiencing issues when consuming the vSphere 6.5 REST API to list ESXi hosts through the /rest/vcenter/host endpoint.
Environment:
- vSphere/vCenter version: 6.5
- Problematic endpoint: GET /rest/vcenter/host (Legacy API)
- Authentication: Session-based using vmware-api-session-id
Error received:
{
"type": "com.vmware.vapi.std.errors.internal_server_error",
"value": {
"messages": [
{
"args": ["com.vmware.vcenter.host.summary", "power_state"],
"default_message": "Structure com.vmware.vcenter.host.summary has a union that is missing a required field for this case: power_state",
"id": "vapi.data.structure.union.missing"
}
]
}
}
Context:
- All other endpoints work normally (/rest/vcenter/vm, /rest/vcenter/cluster, /rest/vcenter/datacenter)
- Only the host endpoint returns this error
- Error occurs on one specific vCenter server, but not on others
- The error happens during response serialization on the vSphere server side
Requirement:
I only need the host ID (host) and name (name) from the ESXi hosts. I don't need the power_state field or other detailed information.
Question:
Is there any filter parameter or alternative endpoint in the vSphere 6.5 REST API that allows:
1. Listing hosts without including the power_state field in the response?
2. Getting the host list through another path (via clusters/datacenters)?
3. Any vCenter configuration that might resolve this serialization issue?
Any help or similar experience would be greatly appreciated!
Thank you.