In the vro 6.0, we can get vm resource via API like that:
# /usr/bin/curl -s -k --user vcouser:vcouser -H Accept:application/xml -X GET https://172.20.223.20:8281/vco/api/catalog/VC/ClusterComputeResource/10.5.33.121%252Fdomain-c112/get...\(\)
or
# /usr/bin/curl -s -k --user vcouser:vcouser -H Accept:application/xml -X GET https://172.20.223.20:8281/vco/api/catalog/VC/ClusterComputeResource/10.5.33.121%252Fdomain-c112/getNetwork\(\)
by following the document: https://www.vmware.com/support/orchestrator/doc/vro-vsphere60-api/html/ClusterComputeResource.html.
But how can we use this same method in vRO 7.3?
I try it like this in vRO 7.3, but can not get anything:
# /usr/bin/curl -s -k --user vcouser:vcouser -H Accept:application/xml -X GET https://172.20.223.20:8281/vco/api/catalog/VC/ClusterComputeResource/10.5.33.121%252Cid%253Adomain-c...\(\)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><error status="404" message="findByRelation()"/>
Do anybody know it? Many thanks.
This is the definition of the finder type (from here - vRO API Explorer by Dr Ruurd and Flores of ITQ )
The "Relations" define the things you can retrieve from the object. From what we've done so far here, if you want the list of HostSystems you would use the "hosts" relation to get them. Similarly for the other types available there
I would assume you maybe need to drill into the content of the HostSystem list to get the VM list using the same approach?
You know you have a typo in your 7.3 example?
In the "working" examples the query IP address is 110.5.33.
The one giving the 404 uses 10.5.33
This might by why you're getting 404 which is HTTP NOT FOUND
-Eoin
Seems there have no getDatastore() in vRO 7.3 API
have you tried "datastores()"
not work for "datastores()"
I can't find any document relate to this issue for vRO 7.3 API.
Did any body know?
What version of vCenter are you using here? The API you want is provided by the VC plugin installed into vRO so this will make a difference as you have correctly identified that the finder method
getDatastores() was removed in 6.5 and replaced with datastores(). This was why I expected the latter to work....
It's just "datastores" as it's an attribute not a finder method
yeah, use "datastores" can work.
we use vcenter 6.5.
but, is there any document about these method?
do you know what's the relate method for: getHost(), getNetwork_DistributedVirtualPortgroup(), getResourcePool(), getVm() and so on?
This is the definition of the finder type (from here - vRO API Explorer by Dr Ruurd and Flores of ITQ )
The "Relations" define the things you can retrieve from the object. From what we've done so far here, if you want the list of HostSystems you would use the "hosts" relation to get them. Similarly for the other types available there
I would assume you maybe need to drill into the content of the HostSystem list to get the VM list using the same approach?
It is exactly what I need.
Many thanks.