VMware Cloud Community
dikav
Contributor
Contributor
Jump to solution

vRO 7.3 API problem

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.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
eoinbyrne
Expert
Expert
Jump to solution

This is the definition of the finder type (from here - vRO API Explorer by Dr Ruurd and Flores of ITQ )

pastedImage_2.png

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?

View solution in original post

0 Kudos
10 Replies
eoinbyrne
Expert
Expert
Jump to solution

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

0 Kudos
dikav
Contributor
Contributor
Jump to solution

Seems there have no getDatastore() in vRO 7.3 API

0 Kudos
eoinbyrne
Expert
Expert
Jump to solution

have you tried "datastores()"

0 Kudos
dikav
Contributor
Contributor
Jump to solution

not work for "datastores()"

I can't find any document relate to this issue for vRO 7.3 API.

Did any body know?

0 Kudos
eoinbyrne
Expert
Expert
Jump to solution

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....

0 Kudos
eoinbyrne
Expert
Expert
Jump to solution

pastedImage_0.png

It's just "datastores" as it's an attribute not a finder method Smiley Happy

0 Kudos
dikav
Contributor
Contributor
Jump to solution

yeah, use "datastores" can work.

we use vcenter 6.5.

but, is there any document about these method?

0 Kudos
dikav
Contributor
Contributor
Jump to solution

do you know what's the relate method for: getHost(), getNetwork_DistributedVirtualPortgroup(), getResourcePool(), getVm() and so on?

0 Kudos
eoinbyrne
Expert
Expert
Jump to solution

This is the definition of the finder type (from here - vRO API Explorer by Dr Ruurd and Flores of ITQ )

pastedImage_2.png

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?

0 Kudos
dikav
Contributor
Contributor
Jump to solution

It is exactly what I need.

Many thanks.

0 Kudos