getNetworkResourceCounts method

Future<GetNetworkResourceCountsResponse> getNetworkResourceCounts({
  1. required String globalNetworkId,
  2. int? maxResults,
  3. String? nextToken,
  4. String? resourceType,
})

Gets the count of network resources, by resource type, for the specified global network.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter globalNetworkId : The ID of the global network.

Parameter maxResults : The maximum number of results to return.

Parameter nextToken : The token for the next page of results.

Parameter resourceType : The resource type.

The following are the supported resource types for Direct Connect:

  • dxcon
  • dx-gateway
  • dx-vif
The following are the supported resource types for Network Manager:
  • attachment
  • connect-peer
  • connection
  • core-network
  • device
  • link
  • peering
  • site
The following are the supported resource types for Amazon VPC:
  • customer-gateway
  • transit-gateway
  • transit-gateway-attachment
  • transit-gateway-connect-peer
  • transit-gateway-route-table
  • vpn-connection

Implementation

Future<GetNetworkResourceCountsResponse> getNetworkResourceCounts({
  required String globalNetworkId,
  int? maxResults,
  String? nextToken,
  String? resourceType,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    500,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (resourceType != null) 'resourceType': [resourceType],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/global-networks/${Uri.encodeComponent(globalNetworkId)}/network-resource-count',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetNetworkResourceCountsResponse.fromJson(response);
}