listOnPremisesInstances method

Future<ListOnPremisesInstancesOutput> listOnPremisesInstances({
  1. String? nextToken,
  2. RegistrationStatus? registrationStatus,
  3. List<TagFilter>? tagFilters,
})

Gets a list of names for one or more on-premises instances.

Unless otherwise specified, both registered and deregistered on-premises instance names are listed. To list only registered or deregistered on-premises instance names, use the registration status parameter.

May throw InvalidRegistrationStatusException. May throw InvalidTagFilterException. May throw InvalidNextTokenException.

Parameter nextToken : An identifier returned from the previous list on-premises instances call. It can be used to return the next set of on-premises instances in the list.

Parameter registrationStatus : The registration status of the on-premises instances:

  • Deregistered: Include deregistered on-premises instances in the resulting list.
  • Registered: Include registered on-premises instances in the resulting list.

Parameter tagFilters : The on-premises instance tags that are used to restrict the on-premises instance names returned.

Implementation

Future<ListOnPremisesInstancesOutput> listOnPremisesInstances({
  String? nextToken,
  RegistrationStatus? registrationStatus,
  List<TagFilter>? tagFilters,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CodeDeploy_20141006.ListOnPremisesInstances'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (nextToken != null) 'nextToken': nextToken,
      if (registrationStatus != null)
        'registrationStatus': registrationStatus.toValue(),
      if (tagFilters != null) 'tagFilters': tagFilters,
    },
  );

  return ListOnPremisesInstancesOutput.fromJson(jsonResponse.body);
}