ListAgents
Returns a list of AWS DataSync agents that belong to an AWS account in the AWS Region specified in the request.
With pagination, you can reduce the number of agents returned in a response. If you get a truncated list of agents in a response, the response contains a marker that you can specify in your next request to fetch the next page of agents.
ListAgents
is eventually consistent. This means the result of running the
operation might not reflect that you just created or deleted an agent. For example, if you
create an agent with CreateAgent and then
immediately run ListAgents
, that agent might not show up in the list right away.
In situations like this, you can always confirm whether an agent has been created (or deleted)
by using DescribeAgent.
Request Syntax
{
"MaxResults": number
,
"NextToken": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- MaxResults
-
Specifies the maximum number of DataSync agents to list in a response. By default, a response shows a maximum of 100 agents.
Type: Integer
Valid Range: Minimum value of 0. Maximum value of 100.
Required: No
- NextToken
-
Specifies an opaque string that indicates the position to begin the next list of results in the response.
Type: String
Length Constraints: Maximum length of 65535.
Pattern:
[a-zA-Z0-9=_-]+
Required: No
Response Syntax
{
"Agents": [
{
"AgentArn": "string",
"Name": "string",
"Platform": {
"Version": "string"
},
"Status": "string"
}
],
"NextToken": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- Agents
-
A list of DataSync agents in your AWS account in the AWS Region specified in the request. The list is ordered by the agents' Amazon Resource Names (ARNs).
Type: Array of AgentListEntry objects
- NextToken
-
The opaque string that indicates the position to begin the next list of results in the response.
Type: String
Length Constraints: Maximum length of 65535.
Pattern:
[a-zA-Z0-9=_-]+
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalException
-
This exception is thrown when an error occurs in the AWS DataSync service.
HTTP Status Code: 500
- InvalidRequestException
-
This exception is thrown when the client submits a malformed request.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: