describeAgents method
Lists agents or connectors as specified by ID or other filters. All
agents/connectors associated with your user account can be listed if you
call DescribeAgents
as is without passing any parameters.
May throw AuthorizationErrorException. May throw InvalidParameterException. May throw InvalidParameterValueException. May throw ServerInternalErrorException. May throw HomeRegionNotSetException.
Parameter agentIds
:
The agent or the Connector IDs for which you want information. If you
specify no IDs, the system returns information about all agents/Connectors
associated with your AWS user account.
Parameter filters
:
You can filter the request using various logical operators and a
key-value format. For example:
{"key": "collectionStatus", "value": "STARTED"}
Parameter maxResults
:
The total number of agents/Connectors to return in a single page of
output. The maximum value is 100.
Parameter nextToken
:
Token to retrieve the next set of results. For example, if you previously
specified 100 IDs for DescribeAgentsRequest$agentIds
but set
DescribeAgentsRequest$maxResults
to 10, you received a set of
10 results along with a token. Use that token in this query to get the
next set of 10.
Implementation
Future<DescribeAgentsResponse> describeAgents({
List<String>? agentIds,
List<Filter>? filters,
int? maxResults,
String? nextToken,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSPoseidonService_V2015_11_01.DescribeAgents'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (agentIds != null) 'agentIds': agentIds,
if (filters != null) 'filters': filters,
if (maxResults != null) 'maxResults': maxResults,
if (nextToken != null) 'nextToken': nextToken,
},
);
return DescribeAgentsResponse.fromJson(jsonResponse.body);
}