AWS attributes via REST AIP


#1

Hi, I am wondering if there is a definitive list somewhere of the attributes on AWS instances that I can query using the REST API?

Thanks
Bill


#2

I’ve just done a quick test and it seems you can retrieve any of the attributes or virtual columns that object_walker shows for the instance, i.e.:

$evm.root['vm'] => i-****   (type: DRb::DRbObject, URI: drbunix:///tmp/automation_engine20180918-11794-1txd0lg)
|    --- attributes follow ---
|    $evm.root['vm'].autostart = nil
|    $evm.root['vm'].availability_zone_id = 1000000000011   (type: Fixnum)
|    $evm.root['vm'].boot_time = 2018-09-14 19:40:36 UTC   (type: ActiveSupport::TimeWithZone)
|    $evm.root['vm'].busy = nil
|    $evm.root['vm'].cloud = true   (type: TrueClass)
|    $evm.root['vm'].cloud_network_id = nil
|    $evm.root['vm'].cloud_subnet_id = nil
|    $evm.root['vm'].cloud_tenant_id = nil
|    $evm.root['vm'].config_xml = nil
|    $evm.root['vm'].connection_state = nil
|    $evm.root['vm'].cpu_affinity = nil
|    $evm.root['vm'].cpu_hot_add_enabled = nil
|    $evm.root['vm'].cpu_hot_remove_enabled = nil
|    $evm.root['vm'].cpu_limit = nil
|    $evm.root['vm'].cpu_reserve = nil
|    $evm.root['vm'].cpu_reserve_expand = nil
|    $evm.root['vm'].cpu_shares = nil
|    $evm.root['vm'].cpu_shares_level = nil
|    $evm.root['vm'].created_on = 2018-09-14 20:36:43 UTC   (type: ActiveSupport::TimeWithZone)
|    $evm.root['vm'].deprecated = nil
|    $evm.root['vm'].description = nil
|    $evm.root['vm'].ems_cluster_id = nil
|    $evm.root['vm'].ems_created_on = nil
|    $evm.root['vm'].ems_id = 1000000000017   (type: Fixnum)
|    $evm.root['vm'].ems_ref = i-****   (type: String)
|    $evm.root['vm'].ems_ref_obj = nil
|    $evm.root['vm'].evm_owner_id = nil
|    $evm.root['vm'].fault_tolerance = nil
|    $evm.root['vm'].flavor_id = 1000000000088   (type: Fixnum)
|    $evm.root['vm'].format = nil
|    $evm.root['vm'].guid = e0fc2140-5232-****-****-e38c42433f1d   (type: String)
|    $evm.root['vm'].host_id = nil
|    $evm.root['vm'].id = 1000000004218   (type: Fixnum)
|    $evm.root['vm'].last_perf_capture_on = 2018-09-18 07:24:00 UTC   (type: ActiveSupport::TimeWithZone)
|    $evm.root['vm'].last_scan_attempt_on = nil
|    $evm.root['vm'].last_scan_on = nil
|    $evm.root['vm'].last_sync_on = nil
|    $evm.root['vm'].linked_clone = nil
|    $evm.root['vm'].location = ec2-**.compute-1.amazonaws.com   (type: String)
|    $evm.root['vm'].memory_hot_add_enabled = nil
|    $evm.root['vm'].memory_hot_add_increment = nil
|    $evm.root['vm'].memory_hot_add_limit = nil
|    $evm.root['vm'].memory_limit = nil
|    $evm.root['vm'].memory_reserve = nil
|    $evm.root['vm'].memory_reserve_expand = nil
|    $evm.root['vm'].memory_shares = nil
|    $evm.root['vm'].memory_shares_level = nil
|    $evm.root['vm'].miq_group_id = 1000000000001   (type: Fixnum)
|    $evm.root['vm'].name = i-****   (type: String)
|    $evm.root['vm'].orchestration_stack_id = nil
|    $evm.root['vm'].power_state = on   (type: String)
|    $evm.root['vm'].previous_state = nil
|    $evm.root['vm'].publicly_available = nil
|    $evm.root['vm'].raw_power_state = running   (type: String)
|    $evm.root['vm'].registered = nil
|    $evm.root['vm'].resource_group_id = nil
|    $evm.root['vm'].retired = nil
|    $evm.root['vm'].retirement_last_warn = nil
|    $evm.root['vm'].retirement_requester = nil
|    $evm.root['vm'].retirement_state = nil
|    $evm.root['vm'].retirement_warn = nil
|    $evm.root['vm'].retires_on = nil
|    $evm.root['vm'].smart = nil
|    $evm.root['vm'].standby_action = nil
|    $evm.root['vm'].state_changed_on = 2018-09-14 20:36:43 UTC   (type: ActiveSupport::TimeWithZone)
|    $evm.root['vm'].storage_id = nil
|    $evm.root['vm'].storage_profile_id = nil
|    $evm.root['vm'].template = false   (type: FalseClass)
|    $evm.root['vm'].tenant_id = 1000000000001   (type: Fixnum)
|    $evm.root['vm'].tools_status = nil
|    $evm.root['vm'].type = ManageIQ::Providers::Amazon::CloudManager::Vm   (type: String)
|    $evm.root['vm'].uid_ems = i-****   (type: String)
|    $evm.root['vm'].updated_on = 2018-09-18 07:30:40 UTC   (type: ActiveSupport::TimeWithZone)
|    $evm.root['vm'].vendor = amazon   (type: String)
|    $evm.root['vm'].version = nil
|    $evm.root['vm'].vnc_port = nil
|    --- end of attributes ---
|    --- virtual columns follow ---
|    $evm.root['vm'].active = true   (type: TrueClass)
|    $evm.root['vm'].aggressive_mem_recommended_change = 16352   (type: Fixnum)
|    $evm.root['vm'].aggressive_mem_recommended_change_pct = 99.8   (type: Float)
|    $evm.root['vm'].aggressive_recommended_mem = 32   (type: Fixnum)
|    $evm.root['vm'].aggressive_recommended_vcpus = 1   (type: Fixnum)
|    $evm.root['vm'].aggressive_vcpus_recommended_change = 3   (type: Fixnum)
|    $evm.root['vm'].aggressive_vcpus_recommended_change_pct = 75.0   (type: Float)
|    $evm.root['vm'].allocated_disk_storage = 214748364800.0   (type: BigDecimal)
|    $evm.root['vm'].archived = false   (type: FalseClass)
|    $evm.root['vm'].conservative_mem_recommended_change = nil
|    $evm.root['vm'].conservative_mem_recommended_change_pct = nil
|    $evm.root['vm'].conservative_recommended_mem = nil
|    $evm.root['vm'].conservative_recommended_vcpus = 1   (type: Fixnum)
|    $evm.root['vm'].conservative_vcpus_recommended_change = 3   (type: Fixnum)
|    $evm.root['vm'].conservative_vcpus_recommended_change_pct = 75.0   (type: Float)
|    $evm.root['vm'].cpu_cores_per_socket = 1   (type: Fixnum)
|    $evm.root['vm'].cpu_total_cores = 4   (type: Fixnum)
|    $evm.root['vm'].cpu_usagemhz_rate_average_avg_over_time_period = 0.0   (type: Float)
|    $evm.root['vm'].cpu_usagemhz_rate_average_high_over_time_period = 0.0   (type: Float)
|    $evm.root['vm'].cpu_usagemhz_rate_average_low_over_time_period = 0.0   (type: Float)
|    $evm.root['vm'].cpu_usagemhz_rate_average_max_over_time_period = nil
|    $evm.root['vm'].custom_1 = nil
|    $evm.root['vm'].custom_2 = nil
|    $evm.root['vm'].custom_3 = nil
|    $evm.root['vm'].custom_4 = nil
|    $evm.root['vm'].custom_5 = nil
|    $evm.root['vm'].custom_6 = nil
|    $evm.root['vm'].custom_7 = nil
|    $evm.root['vm'].custom_8 = nil
|    $evm.root['vm'].custom_9 = nil
|    $evm.root['vm'].debris_size = 0   (type: Fixnum)
|    $evm.root['vm'].derived_memory_used_avg_over_time_period = 0.0   (type: Float)
|    $evm.root['vm'].derived_memory_used_high_over_time_period = 0.0   (type: Float)
|    $evm.root['vm'].derived_memory_used_low_over_time_period = 0.0   (type: Float)
|    $evm.root['vm'].derived_memory_used_max_over_time_period = nil
|    $evm.root['vm'].disconnected = false   (type: FalseClass)
|    $evm.root['vm'].disk_1_disk_type = nil
|    $evm.root['vm'].disk_1_mode = nil
|    $evm.root['vm'].disk_1_partitions_aligned = Unknown   (type: String)
|    $evm.root['vm'].disk_1_size = 107374182400   (type: Fixnum)
|    $evm.root['vm'].disk_1_size_on_disk = nil
|    $evm.root['vm'].disk_1_used_percent_of_provisioned = 0.0   (type: Float)
|    $evm.root['vm'].disk_2_disk_type = nil
|    $evm.root['vm'].disk_2_mode = nil
|    $evm.root['vm'].disk_2_partitions_aligned = Unknown   (type: String)
|    $evm.root['vm'].disk_2_size = 107374182400   (type: Fixnum)
|    $evm.root['vm'].disk_2_size_on_disk = nil
|    $evm.root['vm'].disk_2_used_percent_of_provisioned = 0.0   (type: Float)
|    $evm.root['vm'].disk_3_disk_type = nil
|    $evm.root['vm'].disk_3_mode = nil
|    $evm.root['vm'].disk_3_partitions_aligned = nil
|    $evm.root['vm'].disk_3_size = nil
|    $evm.root['vm'].disk_3_size_on_disk = nil
|    $evm.root['vm'].disk_3_used_percent_of_provisioned = nil
|    $evm.root['vm'].disk_4_disk_type = nil
|    $evm.root['vm'].disk_4_mode = nil
|    $evm.root['vm'].disk_4_partitions_aligned = nil
|    $evm.root['vm'].disk_4_size = nil
|    $evm.root['vm'].disk_4_size_on_disk = nil
|    $evm.root['vm'].disk_4_used_percent_of_provisioned = nil
|    $evm.root['vm'].disk_5_disk_type = nil
|    $evm.root['vm'].disk_5_mode = nil
|    $evm.root['vm'].disk_5_partitions_aligned = nil
|    $evm.root['vm'].disk_5_size = nil
|    $evm.root['vm'].disk_5_size_on_disk = nil
|    $evm.root['vm'].disk_5_used_percent_of_provisioned = nil
|    $evm.root['vm'].disk_6_disk_type = nil
|    $evm.root['vm'].disk_6_mode = nil
|    $evm.root['vm'].disk_6_partitions_aligned = nil
|    $evm.root['vm'].disk_6_size = nil
|    $evm.root['vm'].disk_6_size_on_disk = nil
|    $evm.root['vm'].disk_6_used_percent_of_provisioned = nil
|    $evm.root['vm'].disk_7_disk_type = nil
|    $evm.root['vm'].disk_7_mode = nil
|    $evm.root['vm'].disk_7_partitions_aligned = nil
|    $evm.root['vm'].disk_7_size = nil
|    $evm.root['vm'].disk_7_size_on_disk = nil
|    $evm.root['vm'].disk_7_used_percent_of_provisioned = nil
|    $evm.root['vm'].disk_8_disk_type = nil
|    $evm.root['vm'].disk_8_mode = nil
|    $evm.root['vm'].disk_8_partitions_aligned = nil
|    $evm.root['vm'].disk_8_size = nil
|    $evm.root['vm'].disk_8_size_on_disk = nil
|    $evm.root['vm'].disk_8_used_percent_of_provisioned = nil
|    $evm.root['vm'].disk_9_disk_type = nil
|    $evm.root['vm'].disk_9_mode = nil
|    $evm.root['vm'].disk_9_partitions_aligned = nil
|    $evm.root['vm'].disk_9_size = nil
|    $evm.root['vm'].disk_9_size_on_disk = nil
|    $evm.root['vm'].disk_9_used_percent_of_provisioned = nil
|    $evm.root['vm'].disk_size = 0   (type: Fixnum)
|    $evm.root['vm'].disks_aligned = Unknown   (type: String)
|    $evm.root['vm'].ems_cluster_name = nil
|    $evm.root['vm'].evm_owner_email = nil
|    $evm.root['vm'].evm_owner_name = nil
|    $evm.root['vm'].evm_owner_userid = nil
|    $evm.root['vm'].first_drift_state_timestamp = nil
|    $evm.root['vm'].fixed_ip_addresses = ["*.*.*.*"]   (type: Array)
|    $evm.root['vm'].floating_ip_addresses = ["*.*.*.*"]   (type: Array)
|    $evm.root['vm'].has_rdm_disk = false   (type: FalseClass)
|    $evm.root['vm'].host_name = nil
|    $evm.root['vm'].hostnames = ["ip-**.ec2.internal", "ec2-**.compute-1.amazonaws.com"]   (type: Array)
|    $evm.root['vm'].href_slug = instances/1000000004218   (type: String)
|    $evm.root['vm'].ipaddresses = ["*.*.*.*", "*.*.*.*"]   (type: Array)
|    $evm.root['vm'].is_evm_appliance = false   (type: FalseClass)
|    $evm.root['vm'].last_compliance_status = nil
|    $evm.root['vm'].last_compliance_timestamp = nil
|    $evm.root['vm'].last_drift_state_timestamp = nil
|    $evm.root['vm'].load_balancer_health_check_state = InService   (type: String)
|    $evm.root['vm'].load_balancer_health_check_states = ["InService", "InService"]   (type: Array)
|    $evm.root['vm'].load_balancer_health_check_states_with_reason = ["Status: InService, Status Reason: N/A", "Status: InService, Status Reason: N/A"]   (type: Array)
|    $evm.root['vm'].mac_addresses = ["12:f6:8c:**:**:**"]   (type: Array)
|    $evm.root['vm'].max_cpu_usage_rate_average_avg_over_time_period = 8.402035413000522   (type: Float)
|    $evm.root['vm'].max_cpu_usage_rate_average_avg_over_time_period_without_overhead = 8.402035413000522   (type: Float)
|    $evm.root['vm'].max_cpu_usage_rate_average_high_over_time_period = 10.83185061474012   (type: Float)
|    $evm.root['vm'].max_cpu_usage_rate_average_high_over_time_period_without_overhead = 10.83185061474012   (type: Float)
|    $evm.root['vm'].max_cpu_usage_rate_average_low_over_time_period = 5.972220211260925   (type: Float)
|    $evm.root['vm'].max_cpu_usage_rate_average_low_over_time_period_without_overhead = 5.972220211260925   (type: Float)
|    $evm.root['vm'].max_cpu_usage_rate_average_max_over_time_period = 15.6583333333328   (type: Float)
|    $evm.root['vm'].max_mem_usage_absolute_average_avg_over_time_period = 0.0   (type: Float)
|    $evm.root['vm'].max_mem_usage_absolute_average_avg_over_time_period_without_overhead = 0.0   (type: Float)
|    $evm.root['vm'].max_mem_usage_absolute_average_high_over_time_period = 0.0   (type: Float)
|    $evm.root['vm'].max_mem_usage_absolute_average_high_over_time_period_without_overhead = 0.0   (type: Float)
|    $evm.root['vm'].max_mem_usage_absolute_average_low_over_time_period = 0.0   (type: Float)
|    $evm.root['vm'].max_mem_usage_absolute_average_low_over_time_period_without_overhead = 0.0   (type: Float)
|    $evm.root['vm'].max_mem_usage_absolute_average_max_over_time_period = nil
|    $evm.root['vm'].mem_cpu = 16384   (type: Fixnum)
|    $evm.root['vm'].memory_exceeds_current_host_headroom = false   (type: FalseClass)
|    $evm.root['vm'].moderate_mem_recommended_change = 16352   (type: Fixnum)
|    $evm.root['vm'].moderate_mem_recommended_change_pct = 99.8   (type: Float)
|    $evm.root['vm'].moderate_recommended_mem = 32   (type: Fixnum)
|    $evm.root['vm'].moderate_recommended_vcpus = 1   (type: Fixnum)
|    $evm.root['vm'].moderate_vcpus_recommended_change = 3   (type: Fixnum)
|    $evm.root['vm'].moderate_vcpus_recommended_change_pct = 75.0   (type: Float)
|    $evm.root['vm'].num_cpu = 4   (type: Fixnum)
|    $evm.root['vm'].num_disks = 2   (type: Fixnum)
|    $evm.root['vm'].num_hard_disks = 2   (type: Fixnum)
|    $evm.root['vm'].orphaned = false   (type: FalseClass)
|    $evm.root['vm'].os_image_name = linux_generic   (type: String)
|    $evm.root['vm'].overallocated_mem_pct = 99.8   (type: Float)
|    $evm.root['vm'].overallocated_vcpus_pct = 75.0   (type: Float)
|    $evm.root['vm'].owned_by_current_ldap_group = nil
|    $evm.root['vm'].owned_by_current_user = nil
|    $evm.root['vm'].owning_ldap_group = Tenant My Company access   (type: String)
|    $evm.root['vm'].paravirtualization = nil
|    $evm.root['vm'].parent_blue_folder_1_name =    (type: String)
|    $evm.root['vm'].parent_blue_folder_2_name =    (type: String)
|    $evm.root['vm'].parent_blue_folder_3_name =    (type: String)
|    $evm.root['vm'].parent_blue_folder_4_name =    (type: String)
|    $evm.root['vm'].parent_blue_folder_5_name =    (type: String)
|    $evm.root['vm'].parent_blue_folder_6_name =    (type: String)
|    $evm.root['vm'].parent_blue_folder_7_name =    (type: String)
|    $evm.root['vm'].parent_blue_folder_8_name =    (type: String)
|    $evm.root['vm'].parent_blue_folder_9_name =    (type: String)
|    $evm.root['vm'].platform = linux   (type: String)
|    $evm.root['vm'].provisioned_storage = 231928233984   (type: Fixnum)
|    $evm.root['vm'].ram_size = 16384   (type: Fixnum)
|    $evm.root['vm'].ram_size_in_bytes = 17179869184   (type: Fixnum)
|    $evm.root['vm'].recommended_mem = 32   (type: Fixnum)
|    $evm.root['vm'].recommended_vcpus = 1   (type: Fixnum)
|    $evm.root['vm'].region_description = Region 1   (type: String)
|    $evm.root['vm'].region_number = 1   (type: Fixnum)
|    $evm.root['vm'].snapshot_size = 0   (type: Fixnum)
|    $evm.root['vm'].storage_name = nil
|    $evm.root['vm'].thin_provisioned = false   (type: FalseClass)
|    $evm.root['vm'].uncommitted_storage = 0   (type: Fixnum)
|    $evm.root['vm'].used_disk_storage = 214748364800   (type: Fixnum)
|    $evm.root['vm'].used_storage = 231928233984   (type: Fixnum)
|    $evm.root['vm'].used_storage_by_state = 231928233984   (type: Fixnum)
|    $evm.root['vm'].v_annotation = nil
|    $evm.root['vm'].v_datastore_path = ec2-**.compute-1.amazonaws.com   (type: String)
|    $evm.root['vm'].v_host_vmm_product = nil
|    $evm.root['vm'].v_is_a_template = False   (type: String)
|    $evm.root['vm'].v_owning_blue_folder =    (type: String)
|    $evm.root['vm'].v_owning_blue_folder_path =    (type: String)
|    $evm.root['vm'].v_owning_cluster =    (type: String)
|    $evm.root['vm'].v_owning_datacenter =    (type: String)
|    $evm.root['vm'].v_owning_folder =    (type: String)
|    $evm.root['vm'].v_owning_folder_path =    (type: String)
|    $evm.root['vm'].v_owning_resource_pool =    (type: String)
|    $evm.root['vm'].v_pct_free_disk_space = nil
|    $evm.root['vm'].v_pct_used_disk_space = nil
|    $evm.root['vm'].v_snapshot_newest_description = nil
|    $evm.root['vm'].v_snapshot_newest_name = nil
|    $evm.root['vm'].v_snapshot_newest_timestamp = nil
|    $evm.root['vm'].v_snapshot_newest_total_size = nil
|    $evm.root['vm'].v_snapshot_oldest_description = nil
|    $evm.root['vm'].v_snapshot_oldest_name = nil
|    $evm.root['vm'].v_snapshot_oldest_timestamp = nil
|    $evm.root['vm'].v_snapshot_oldest_total_size = nil
|    $evm.root['vm'].v_total_snapshots = 0   (type: Fixnum)
|    $evm.root['vm'].vendor_display = Amazon   (type: String)
|    $evm.root['vm'].vm_misc_size = 0   (type: Fixnum)
|    $evm.root['vm'].vm_ram_size = 0   (type: Fixnum)
|    $evm.root['vm'].vmsafe_agent_address = nil
|    $evm.root['vm'].vmsafe_agent_port = nil
|    $evm.root['vm'].vmsafe_enable = nil
|    $evm.root['vm'].vmsafe_fail_open = nil
|    $evm.root['vm'].vmsafe_immutable_vm = nil
|    $evm.root['vm'].vmsafe_timeout_ms = nil
|    --- end of virtual columns ---

#3

Thanks! Thats what I needed, should have had a look at object walker, I used it a while back while following your automation book, which is excellent work by the way.


#4

Thanks, I’m glad the book is useful.

If you’re interested I recently updated object_walker to v2.0 so that it’s also now callable as an embedded method, like so:

Investigative_Debugging::Discovery::ObjectWalker.walk_objects

The advantage of this is that object_walker is now walking your $evm.object rather than being instantiated as a child object in the workspace. It’s still callable as a standalone instance as before as /Discovery/ObjectWalker/object_walker or /System/Request/object_walker

Hope that helps,
pemcg


#5

Know More Info About AWS::ApiGateway::RestApi
Please go through this link here::: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html