VMware Cloud Community
kebes
Contributor
Contributor

Getting guest network information with API

Hello Experts,

I'm trying to get inforomation about Guest IP with API call on vCenter 6.7

I got session token, got guest VMs' ids, but when I run command 

curl -k -v -H 'vmware-api-session-id:<vmware-session-api-id>' 'https://<vcenter-ip>/rest/vcenter/vm/<vm-id>/guest/networking'

it returns 

{"name":"com.vmware.vapi.rest.httpNotFound","localizableMessages":[{"defaultMessage":"Not found.","id":"com.vmware.vapi.rest.httpNotFound"}],"majorErrorCode":40

I checked "local-filesystem" and "cdrom" variables and they work fine.

Tested on 6.7.0.50000 and 6.7.0.40000.

The API call run against vCenter 7.0U3 works fine.

Did I miss anything or there is a bug in vCenter 6.7 API?

Tags (3)
Reply
0 Kudos
1 Reply
kebes
Contributor
Contributor

Self-answered

To get the detailed information about guest networking, the correct syntax should be 

curl -k -v -H 'vmware-api-session-id:<api-session-id>' 'https://<vcenter-ip>/rest/vcenter/vm/<vm-id>/guest/networking/interfaces'

but.. it looks that networking is not implemented in vcenter 6.7, as per API explorer - see screenshots of 6.7 and 7.0 😞

Any ideas how to get IP address of guest VM using API?

Reply
0 Kudos