Bug 1372025 - [RFE] return VM's ip address via REST
Summary: [RFE] return VM's ip address via REST
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.6.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: GA
: 5.7.0
Assignee: Šimon Lukašík
QA Contact: Dave Johnson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-31 17:56 UTC by Colin Arnott
Modified: 2019-12-16 06:34 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-01 09:35:34 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:


Attachments (Terms of Use)

Description Colin Arnott 2016-08-31 17:56:52 UTC
Description of problem:
We need to know how to query a VM's IP Address via the Rest API in Cloudforms 4.1

Version-Release number of selected component (if applicable):
cfme-5.6.1.2

How reproducible:
trivial

Steps to Reproduce:
1. curl -k https://admin:smartvm@example.com/api/vms/1
 note) sample vm is hosted on vmware

Actual results:
Results do not include a "ip" or "ip_addr" key:
{
    "href": "https://example.com/api/vms/1",
    "id": 1,
    "vendor": "vmware",
    "name": "vm",
    "location": "vm/vm.vmx",
    "host_id": 1,
    "created_on": "2016-06-24T01:04:45Z",
    "updated_on": "2016-08-31T17:01:00Z",
    "storage_id": 1,
    "guid": "a3b6fd16-39a7-11e6-94ac-fa163e33deb1",
    "ems_id": 9,
    "uid_ems": "420fc934-1cc2-b23f-7300-2e220ef1abb3",
    "boot_time": "2016-06-29T12:59:59Z",
    "tools_status": "toolsOk",
    "standby_action": "checkpoint",
    "power_state": "on",
    "state_changed_on": "2016-06-29T13:00:05Z",
    "previous_state": "poweredOff",
    "connection_state": "connected",
    "last_perf_capture_on": "2016-08-31T17:05:00Z",
    "memory_reserve": 0,
    "memory_reserve_expand": false,
    "memory_limit": -1,
    "memory_shares": 61440,
    "memory_shares_level": "normal",
    "cpu_reserve": 0,
    "cpu_reserve_expand": false,
    "cpu_limit": -1,
    "cpu_shares": 4000,
    "cpu_shares_level": "normal",
    "template": false,
    "ems_ref_obj": "vm-494",
    "miq_group_id": 1,
    "linked_clone": false,
    "fault_tolerance": false,
    "type": "ManageIQ::Providers::Vmware::InfraManager::Vm",
    "ems_ref": "vm-494",
    "ems_cluster_id": 1,
    "cloud": false,
    "raw_power_state": "poweredOn",
    "tenant_id": 1,
    "actions": […]
}
Expected results:
I would like the ip address of the vm (if known to the provider), displayed in this json

Additional info:
(pending)

Comment 3 Šimon Lukašík 2016-09-01 09:35:21 UTC
The list of IP addresses is available upon

curl -k https://admin:smartvm@example.com/api/vms/1?attributes=ipaddresses

Additionally, you can use 'attributes=hostnames` to get list of hostnames in the response.

The other available fields are for example: os_image_name, platform, vendor_display, thin_provisioned, provisioned_storage, used_storage, mac_addresses, num_hard_disks, num_disks, num_cpu, cpu_total_cores, cpu_cores_per_socket, annotation, has_rdm_disk, disks_aligned. The problem is that we these attributes may change in future releases. We plan to have a global option to list all the possible attributes, so I am inclined to close this specific request.


Note You need to log in before you can comment on or make changes to this bug.