listInstalledComponents method

Future<ListInstalledComponentsResponse> listInstalledComponents({
  1. required String coreDeviceThingName,
  2. int? maxResults,
  3. String? nextToken,
  4. InstalledComponentTopologyFilter? topologyFilter,
})

Retrieves a paginated list of the components that a Greengrass core device runs. By default, this list doesn't include components that are deployed as dependencies of other components. To include dependencies in the response, set the topologyFilter parameter to ALL.

Core devices send status updates at the following times:

  • When the IoT Greengrass Core software starts
  • When the core device receives a deployment from the Amazon Web Services Cloud
  • When the status of any component on the core device becomes BROKEN
  • At a regular interval that you can configure, which defaults to 24 hours
  • For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and cloud deployment

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

Parameter coreDeviceThingName : The name of the core device. This is also the name of the IoT thing.

Parameter maxResults : The maximum number of results to be returned per paginated request.

Parameter nextToken : The token to be used for the next set of paginated results.

Parameter topologyFilter : The filter for the list of components. Choose from the following options:

  • ALL – The list includes all components installed on the core device.
  • ROOT – The list includes only root components, which are components that you specify in a deployment. When you choose this option, the list doesn't include components that the core device installs as dependencies of other components.
Default: ROOT

Implementation

Future<ListInstalledComponentsResponse> listInstalledComponents({
  required String coreDeviceThingName,
  int? maxResults,
  String? nextToken,
  InstalledComponentTopologyFilter? topologyFilter,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (topologyFilter != null) 'topologyFilter': [topologyFilter.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/greengrass/v2/coreDevices/${Uri.encodeComponent(coreDeviceThingName)}/installedComponents',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListInstalledComponentsResponse.fromJson(response);
}