listSpokes method
Lists the Network Connectivity Center spokes associated with a specified hub and location.
The list includes both spokes that are attached to the hub and spokes that have been proposed but not yet accepted.
Request parameters:
name
- Required. The name of the hub.
Value must have pattern
^projects/\[^/\]+/locations/global/hubs/\[^/\]+$
.
filter
- An expression that filters the list of results.
orderBy
- Sort the results by name or create_time.
pageSize
- The maximum number of results to return per page.
pageToken
- The page token.
spokeLocations
- A list of locations. Specify one of the following:
[global]
, a single region (for example, [us-central1]
), or a
combination of values (for example, [global, us-central1, us-west1]
). If
the spoke_locations field is populated, the list of results includes only
spokes in the specified location. If the spoke_locations field is not
populated, the list of results includes spokes in all locations.
view
- The view of the spoke to return. The view that you use determines
which spoke fields are included in the response.
Possible string values are:
- "SPOKE_VIEW_UNSPECIFIED" : The spoke view is unspecified. When the spoke
view is unspecified, the API returns the same fields as the
BASIC
view. - "BASIC" : Includes
name
,create_time
,hub
,unique_id
,state
,reasons
, andspoke_type
. This is the default value. - "DETAILED" : Includes all spoke fields except
labels
. You can use theDETAILED
view only when you set thespoke_locations
field to[global]
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListHubSpokesResponse.
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<ListHubSpokesResponse> listSpokes(
core.String name, {
core.String? filter,
core.String? orderBy,
core.int? pageSize,
core.String? pageToken,
core.List<core.String>? spokeLocations,
core.String? view,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (filter != null) 'filter': [filter],
if (orderBy != null) 'orderBy': [orderBy],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if (spokeLocations != null) 'spokeLocations': spokeLocations,
if (view != null) 'view': [view],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':listSpokes';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListHubSpokesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}