I can get a session id from https://{vcenter}/rest/com/vmware/cis/session. But when to access https://{vcenter}/rest/vcenter/vm,
curl -v -k -X GET -H 'Accept: application/json' \
-H "vmware-api-session-id: $SESSION_ID" \
$VCENTER/rest/vcenter/vm
I got
{"name":"com.vmware.vapi.rest.httpNotFound","localizableMessages":[{"defaultMessage":"Not found.","id":"com.vmware.vapi.rest.httpNotFound"}],"majorErrorCode":404}
Does anyone know why 404 response is got? Thanks.
You need to use FQDN when addressing vCenter's REST API.
Thanks for your reply. I will have a try with FQDN.