VMware Cloud Community
xpy3106
Contributor
Contributor

Why my request to https://{vcenterip}/rest/vcenter/vm returns 404?

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.

0 Kudos
2 Replies
daphnissov
Immortal
Immortal

You need to use FQDN when addressing vCenter's REST API.

0 Kudos
xpy3106
Contributor
Contributor

Thanks for your reply. I will have a try with FQDN.

0 Kudos