/AWS1/CL_EC2=>DESCRIBEHOSTS()
¶
About DescribeHosts¶
Describes the specified Dedicated Hosts or all your Dedicated Hosts.
The results describe only the Dedicated Hosts in the Region you're currently using.
All listed instances consume capacity on your Dedicated Host. Dedicated Hosts that have
recently been released are listed with the state released
.
Method Signature¶
IMPORTING¶
Optional arguments:¶
it_hostids
TYPE /AWS1/CL_EC2REQHOSTIDLIST_W=>TT_REQUESTHOSTIDLIST
TT_REQUESTHOSTIDLIST
¶
The IDs of the Dedicated Hosts. The IDs are used for targeted instance launches.
iv_nexttoken
TYPE /AWS1/EC2STRING
/AWS1/EC2STRING
¶
The token to use to retrieve the next page of results.
iv_maxresults
TYPE /AWS1/EC2INTEGER
/AWS1/EC2INTEGER
¶
The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned
nextToken
value. This value can be between 5 and 500. IfmaxResults
is given a larger value than 500, you receive an error.You cannot specify this parameter and the host IDs parameter in the same request.
it_filter
TYPE /AWS1/CL_EC2FILTER=>TT_FILTERLIST
TT_FILTERLIST
¶
The filters.
auto-placement
- Whether auto-placement is enabled or disabled (on
|off
).
availability-zone
- The Availability Zone of the host.
client-token
- The idempotency token that you provided when you allocated the host.
host-reservation-id
- The ID of the reservation assigned to this host.
instance-type
- The instance type size that the Dedicated Host is configured to support.
state
- The allocation state of the Dedicated Host (available
|under-assessment
|permanent-failure
|released
|released-permanent-failure
).
tag-key
- The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.
RETURNING¶
oo_output
TYPE REF TO /aws1/cl_ec2descrhostsresult
/AWS1/CL_EC2DESCRHOSTSRESULT
¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->/aws1/if_ec2~describehosts(
it_filter = VALUE /aws1/cl_ec2filter=>tt_filterlist(
(
new /aws1/cl_ec2filter(
it_values = VALUE /aws1/cl_ec2valuestringlist_w=>tt_valuestringlist(
( new /aws1/cl_ec2valuestringlist_w( |string| ) )
)
iv_name = |string|
)
)
)
it_hostids = VALUE /aws1/cl_ec2reqhostidlist_w=>tt_requesthostidlist(
( new /aws1/cl_ec2reqhostidlist_w( |string| ) )
)
iv_maxresults = 123
iv_nexttoken = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
LOOP AT lo_result->get_hosts( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_autoplacement = lo_row_1->get_autoplacement( ).
lv_string = lo_row_1->get_availabilityzone( ).
lo_availablecapacity = lo_row_1->get_availablecapacity( ).
IF lo_availablecapacity IS NOT INITIAL.
LOOP AT lo_availablecapacity->get_availableinstancecap( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_integer = lo_row_3->get_availablecapacity( ).
lv_string = lo_row_3->get_instancetype( ).
lv_integer = lo_row_3->get_totalcapacity( ).
ENDIF.
ENDLOOP.
lv_integer = lo_availablecapacity->get_availablevcpus( ).
ENDIF.
lv_string = lo_row_1->get_clienttoken( ).
lv_string = lo_row_1->get_hostid( ).
lo_hostproperties = lo_row_1->get_hostproperties( ).
IF lo_hostproperties IS NOT INITIAL.
lv_integer = lo_hostproperties->get_cores( ).
lv_string = lo_hostproperties->get_instancetype( ).
lv_string = lo_hostproperties->get_instancefamily( ).
lv_integer = lo_hostproperties->get_sockets( ).
lv_integer = lo_hostproperties->get_totalvcpus( ).
ENDIF.
lv_string = lo_row_1->get_hostreservationid( ).
LOOP AT lo_row_1->get_instances( ) into lo_row_4.
lo_row_5 = lo_row_4.
IF lo_row_5 IS NOT INITIAL.
lv_string = lo_row_5->get_instanceid( ).
lv_string = lo_row_5->get_instancetype( ).
lv_string = lo_row_5->get_ownerid( ).
ENDIF.
ENDLOOP.
lv_allocationstate = lo_row_1->get_state( ).
lv_datetime = lo_row_1->get_allocationtime( ).
lv_datetime = lo_row_1->get_releasetime( ).
LOOP AT lo_row_1->get_tags( ) into lo_row_6.
lo_row_7 = lo_row_6.
IF lo_row_7 IS NOT INITIAL.
lv_string = lo_row_7->get_key( ).
lv_string = lo_row_7->get_value( ).
ENDIF.
ENDLOOP.
lv_hostrecovery = lo_row_1->get_hostrecovery( ).
lv_allowsmultipleinstancet = lo_row_1->get_allowsmultipleinsttypes( ).
lv_string = lo_row_1->get_ownerid( ).
lv_string = lo_row_1->get_availabilityzoneid( ).
lv_boolean = lo_row_1->get_memberofsvclnkresrcgroup( ).
lv_string = lo_row_1->get_outpostarn( ).
lv_hostmaintenance = lo_row_1->get_hostmaintenance( ).
lv_assetid = lo_row_1->get_assetid( ).
ENDIF.
ENDLOOP.
lv_string = lo_result->get_nexttoken( ).
ENDIF.