John Nettles
John Nettles

Reputation: 181

Vsphere REST API - how to specify fields in JSON response

I am trying to return the names of VMs in a REST API call to Vcenter w/ the below request. I can get all fields by removing "name" from the request. Anyone know how to filter the response JSON object down to specific fields from Vcenter REST API?

https://fqdn/rest/vcenter/vm/name

Upvotes: 0

Views: 731

Answers (1)

Kyle Ruddy
Kyle Ruddy

Reputation: 2121

You're close, but you'll need to use the filter parameter to accomplish this.

Example:

GET https://{server}/rest/vcenter/vm&filter.names.1=vmname

More information about the filter options here: VM List Method

Upvotes: 2

Related Questions