get method
Retrieves information about the specified host.
Request parameters:
project - The project ID for this request.
zone - The name of the zone for this request, formatted as RFC1035.
association - The parent resource association for the Host. This field
specifies the
hierarchical context (e.g., reservation, block, sub-block) when
accessing the host. For example, reservations/reservation_name,
reservations/reservation_name/reservationBlocks/reservation_block_name or
reservations/reservation_name/reservationBlocks/reservation_block_name/reservationSubBlocks/reservation_sub_block_name.
host - The name of the host, formatted as RFC1035 or a resource ID
number.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a Host.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<Host> get(
core.String project,
core.String zone,
core.String association,
core.String host, {
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'projects/' +
commons.escapeVariable('$project') +
'/zones/' +
commons.escapeVariable('$zone') +
'/' +
commons.escapeVariable('$association') +
'/hosts/' +
commons.escapeVariable('$host');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Host.fromJson(response_ as core.Map<core.String, core.dynamic>);
}