DataSync / Client / list_agents

list_agents#

DataSync.Client.list_agents(**kwargs)#

Returns a list of DataSync agents that belong to an Amazon Web Services account in the Amazon Web Services 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.

See also: AWS API Documentation

Request Syntax

response = client.list_agents(
    MaxResults=123,
    NextToken='string'
)
Parameters:
  • MaxResults (integer) – Specifies the maximum number of DataSync agents to list in a response. By default, a response shows a maximum of 100 agents.

  • NextToken (string) – Specifies an opaque string that indicates the position to begin the next list of results in the response.

Return type:

dict

Returns:

Response Syntax

{
    'Agents': [
        {
            'AgentArn': 'string',
            'Name': 'string',
            'Status': 'ONLINE'|'OFFLINE'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    ListAgentsResponse

    • Agents (list) –

      A list of DataSync agents in your Amazon Web Services account in the Amazon Web Services Region specified in the request. The list is ordered by the agents’ Amazon Resource Names (ARNs).

      • (dict) –

        Represents a single entry in a list (or array) of DataSync agents when you call the ListAgents operation.

        • AgentArn (string) –

          The Amazon Resource Name (ARN) of a DataSync agent.

        • Name (string) –

          The name of an agent.

        • Status (string) –

          The status of an agent. For more information, see DataSync agent statuses.

    • NextToken (string) –

      The opaque string that indicates the position to begin the next list of results in the response.

Exceptions

  • DataSync.Client.exceptions.InvalidRequestException

  • DataSync.Client.exceptions.InternalException