Provisioning of VMs - retrieve IP information


#1

Hello,

On my use case I am driving the provisioning of VMs using a Jenkins pipeline; for this reason I am only allowed to use the Rest API.
I am able to order a service, follow the service request generated and check when the request has been finished. Using the services API I can expand the VM resources (api/services/?expand=resources&attributes=vms) and check the information about the VMs – but I am unable to visualise the information about which IP was assigned to the VM.
This same information is available using the UI, so it seems that the problem may lie in not exposing this information over the API.

Is it possible to get the information about a VM IP address in any other way?

Thank you,
Gis


#2

Hi,
Have you found a way to retrieve IP address of created VM?


#3

I’ve found the solution for that. May be will help for someone else. Sample query:
api/vms?expand=resources&attributes=name,ipaddresses


#4

Hey @jcornell - does this sound about right?


#5

@abellotti Can you help out here?


#6

This is the right approach, querying additional information about vms using virtual attributes, in this case ipaddresses. If you have the vm id, a:

GET /api/vms/:id?attributes=ipaddresses

would do, if you need to search by name, instead of querying all vms,

GET /api/vms?filter[]="name='pattern'"&expand=resources&attributes=ipaddresses

would also work. Other virtual attributes and relationships of vms can also be queried as needed with attributes as a comma seperated list.


#7

Should this retrieve ip-address using rest work ?

if I query like this:

uri = “https://admin:xxxxx@10.10.10.92/api/vms/111?expand=resources&attributes=name,ipaddresses

I’ll get answer:

{
“id” => “https://10.10.10.92/api/vms/111”,
“name” => “foobar”
}


#8

Same results…it looks like REST API is buggy.

Without this basic information we cannot go farther…


#9

The “id” returned is the old signature, should just be an integer. What version of the API are you running ? Do a GET of /api for that information. The virtual attributes were added to v2.0.0.


#10

Anand version use 1.0 ? Is 2.0 added to botvinnik release ?


#11

I have tested with Botvinnik RC3 and it works.