listAssets method

Future<ListAssetsOutput> listAssets({
  1. required String outpostIdentifier,
  2. List<AssetType>? assetTypeFilter,
  3. List<String>? hostIdFilter,
  4. int? maxResults,
  5. String? nextToken,
  6. List<AssetState>? statusFilter,
})

Lists the hardware assets for the specified Outpost.

Use filters to return specific results. If you specify multiple filters, the results include only the resources that match all of the specified filters. For a filter where you can specify multiple values, the results include items that match any of the values that you specify for the filter.

May throw AccessDeniedException. May throw InternalServerException. May throw NotFoundException. May throw ValidationException.

Parameter outpostIdentifier : The ID or the Amazon Resource Name (ARN) of the Outpost.

Parameter assetTypeFilter : Filters the results by asset type.

  • COMPUTE - Server asset used for customer compute
  • STORAGE - Server asset used by storage services
  • POWERSHELF - Powershelf assets
  • SWITCH - Switch assets
  • NETWORKING - Asset managed by Amazon Web Services for networking purposes

Parameter hostIdFilter : Filters the results by the host ID of a Dedicated Host.

Parameter statusFilter : Filters the results by state.

Implementation

Future<ListAssetsOutput> listAssets({
  required String outpostIdentifier,
  List<AssetType>? assetTypeFilter,
  List<String>? hostIdFilter,
  int? maxResults,
  String? nextToken,
  List<AssetState>? statusFilter,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $query = <String, List<String>>{
    if (assetTypeFilter != null)
      'AssetTypeFilter': assetTypeFilter.map((e) => e.value).toList(),
    if (hostIdFilter != null) 'HostIdFilter': hostIdFilter,
    if (maxResults != null) 'MaxResults': [maxResults.toString()],
    if (nextToken != null) 'NextToken': [nextToken],
    if (statusFilter != null)
      'StatusFilter': statusFilter.map((e) => e.value).toList(),
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/outposts/${Uri.encodeComponent(outpostIdentifier)}/assets',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListAssetsOutput.fromJson(response);
}