Bug 1316578 - REST vm api lacks the "hardware" and "ws_attributes" sections
Summary: REST vm api lacks the "hardware" and "ws_attributes" sections
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.4.0
Hardware: All
OS: All
unspecified
high
Target Milestone: GA
: 5.6.0
Assignee: Tim Wade
QA Contact: Martin Kourim
URL:
Whiteboard: rest
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-10 14:13 UTC by Josh Carter
Modified: 2019-10-10 11:30 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-06 16:40:35 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:


Attachments (Terms of Use)

Description Josh Carter 2016-03-10 14:13:04 UTC
Description of problem:

While comparing the current 2.0 and 3.2 SOAP and REST api’s in Cloudforms we found an issue with the REST api. It lacks the "hardware" and "ws_attributes" sections that contains the vcpus, memory, disk, ip addresses, host names, and a number of other important bits of information.  Without this we cannot upgrade to 4.0 since the SOAP api has been removed.

--

The issue is with the amount of data returned with accessing a vm directly, or I suppose, what is available from the expand/attributes.

ws_values (and children) is returned with SOAP, it does not exist in what is returned from REST, requesting it directly with expand/attributes does not help.


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Tim Wade 2016-03-14 21:39:13 UTC
Josh,

When you say that requesting the data with the attributes parameter does not help, do you mean it doesn't work, or that it doesn't solve your problem? 

You can still retrieve all the same data as the with SOAP API. `ws_attribute` just doesn't exist any more - it was an abstraction that was specific to the SOAP API. Instead, you can query for the specific virtual attributes (which are not returned by default) you need using the attributes param. The full list of attributes is as follows: 

active
aggressive_mem_recommended_change
aggressive_mem_recommended_change_pct
aggressive_recommended_mem
aggressive_recommended_vcpus
aggressive_vcpus_recommended_change
aggressive_vcpus_recommended_change_pct
allocated_disk_storage
archived
conservative_mem_recommended_change
conservative_mem_recommended_change_pct
conservative_recommended_mem
conservative_recommended_vcpus
conservative_vcpus_recommended_change
conservative_vcpus_recommended_change_pct
cores_per_socket
cpu_cores_per_socket
cpu_total_cores
cpu_usagemhz_rate_average_avg_over_time_period
cpu_usagemhz_rate_average_high_over_time_period
cpu_usagemhz_rate_average_low_over_time_period
cpu_usagemhz_rate_average_max_over_time_period
debris_size
derived_memory_used_avg_over_time_period
derived_memory_used_high_over_time_period
derived_memory_used_low_over_time_period
derived_memory_used_max_over_time_period
disconnected
disk_1_disk_type
disk_1_mode
disk_1_partitions_aligned
disk_1_size
disk_1_size_on_disk
disk_1_used_percent_of_provisioned
disk_2_disk_type
disk_2_mode
disk_2_partitions_aligned
disk_2_size
disk_2_size_on_disk
disk_2_used_percent_of_provisioned
disk_3_disk_type
disk_3_mode
disk_3_partitions_aligned
disk_3_size
disk_3_size_on_disk
disk_3_used_percent_of_provisioned
disk_4_disk_type
disk_4_mode
disk_4_partitions_aligned
disk_4_size
disk_4_size_on_disk
disk_4_used_percent_of_provisioned
disk_5_disk_type
disk_5_mode
disk_5_partitions_aligned
disk_5_size
disk_5_size_on_disk
disk_5_used_percent_of_provisioned
disk_6_disk_type
disk_6_mode
disk_6_partitions_aligned
disk_6_size
disk_6_size_on_disk
disk_6_used_percent_of_provisioned
disk_7_disk_type
disk_7_mode
disk_7_partitions_aligned
disk_7_size
disk_7_size_on_disk
disk_7_used_percent_of_provisioned
disk_8_disk_type
disk_8_mode
disk_8_partitions_aligned
disk_8_size
disk_8_size_on_disk
disk_8_used_percent_of_provisioned
disk_9_disk_type
disk_9_mode
disk_9_partitions_aligned
disk_9_size
disk_9_size_on_disk
disk_9_used_percent_of_provisioned
disk_size
disks_aligned
ems_cluster_name
evm_owner_email
evm_owner_name
evm_owner_userid
first_drift_state_timestamp
has_rdm_disk
host_name
hostnames
ipaddresses
is_evm_appliance
last_compliance_status
last_compliance_timestamp
last_drift_state_timestamp
logical_cpus
mac_addresses
max_cpu_usage_rate_average_avg_over_time_period
max_cpu_usage_rate_average_avg_over_time_period_without_overhead
max_cpu_usage_rate_average_high_over_time_period
max_cpu_usage_rate_average_high_over_time_period_without_overhead
max_cpu_usage_rate_average_low_over_time_period
max_cpu_usage_rate_average_low_over_time_period_without_overhead
max_cpu_usage_rate_average_max_over_time_period
max_mem_usage_absolute_average_avg_over_time_period
max_mem_usage_absolute_average_avg_over_time_period_without_overhead
max_mem_usage_absolute_average_high_over_time_period
max_mem_usage_absolute_average_high_over_time_period_without_overhead
max_mem_usage_absolute_average_low_over_time_period
max_mem_usage_absolute_average_low_over_time_period_without_overhead
max_mem_usage_absolute_average_max_over_time_period
mem_cpu
moderate_mem_recommended_change
moderate_mem_recommended_change_pct
moderate_recommended_mem
moderate_recommended_vcpus
moderate_vcpus_recommended_change
moderate_vcpus_recommended_change_pct
num_cpu
num_disks
num_hard_disks
orphaned
os_image_name
overallocated_mem_pct
overallocated_vcpus_pct
owned_by_current_ldap_group
owned_by_current_user
owning_ldap_group
paravirtualization
parent_blue_folder_1_name
parent_blue_folder_2_name
parent_blue_folder_3_name
parent_blue_folder_4_name
parent_blue_folder_5_name
parent_blue_folder_6_name
parent_blue_folder_7_name
parent_blue_folder_8_name
parent_blue_folder_9_name
platform
provisioned_storage
recommended_mem
recommended_vcpus
region_description
region_number
snapshot_size
storage_name
thin_provisioned
uncommitted_storage
used_disk_storage
used_storage
used_storage_by_state
v_annotation
v_datastore_path
v_host_vmm_product
v_is_a_template
v_owning_blue_folder
v_owning_blue_folder_path
v_owning_cluster
v_owning_datacenter
v_owning_folder
v_owning_folder_path
v_owning_resource_pool
v_pct_free_disk_space
v_pct_used_disk_space
v_snapshot_newest_description
v_snapshot_newest_name
v_snapshot_newest_timestamp
v_snapshot_newest_total_size
v_snapshot_oldest_description
v_snapshot_oldest_name
v_snapshot_oldest_timestamp
v_snapshot_oldest_total_size
v_total_snapshots
vm_misc_size
vm_ram_size
vmsafe_agent_address
vmsafe_agent_port
vmsafe_enable
vmsafe_fail_open
vmsafe_immutable_vm
vmsafe_timeout_ms

AFAICS this was all `ws_attributes` was doing - returning these virtual attributes of Vms.

Querying for hardware should work - just add `hardware` to the attributes param.

In the future we may enhance the API to add an option to return all virtual attributes for a resource if that is what is needed, but that is not something we would backport.

Tim

Comment 5 Tim Wade 2016-04-06 16:40:35 UTC
Josh,

Thanks! Marking this as closed.


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