describeServers method

Future<DescribeServersResponse> describeServers({
  1. int? maxResults,
  2. String? nextToken,
  3. String? serverName,
})

Lists all configuration management servers that are identified with your account. Only the stored results from Amazon DynamoDB are returned. AWS OpsWorks CM does not query other services.

This operation is synchronous.

A ResourceNotFoundException is thrown when the server does not exist. A ValidationException is raised when parameters of the request are not valid.

May throw ValidationException. May throw ResourceNotFoundException. May throw InvalidNextTokenException.

Parameter maxResults : This is not currently implemented for DescribeServers requests.

Parameter nextToken : This is not currently implemented for DescribeServers requests.

Parameter serverName : Describes the server with the specified ServerName.

Implementation

Future<DescribeServersResponse> describeServers({
  int? maxResults,
  String? nextToken,
  String? serverName,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1152921504606846976,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    10000,
  );
  _s.validateStringLength(
    'serverName',
    serverName,
    1,
    40,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OpsWorksCM_V2016_11_01.DescribeServers'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (serverName != null) 'ServerName': serverName,
    },
  );

  return DescribeServersResponse.fromJson(jsonResponse.body);
}