list_locations

list_locations(**kwargs)

Returns a list of source and destination locations.

If you have more locations than are returned in a response (that is, the response returns only a truncated list of your agents), the response contains a token that you can specify in your next request to fetch the next page of locations.

See also: AWS API Documentation

Request Syntax

response = client.list_locations(
    MaxResults=123,
    NextToken='string',
    Filters=[
        {
            'Name': 'LocationUri'|'LocationType'|'CreationTime',
            'Values': [
                'string',
            ],
            'Operator': 'Equals'|'NotEquals'|'In'|'LessThanOrEqual'|'LessThan'|'GreaterThanOrEqual'|'GreaterThan'|'Contains'|'NotContains'|'BeginsWith'
        },
    ]
)
Parameters
  • MaxResults (integer) -- The maximum number of locations to return.
  • NextToken (string) -- An opaque string that indicates the position at which to begin the next list of locations.
  • Filters (list) --

    You can use API filters to narrow down the list of resources returned by ListLocations . For example, to retrieve all tasks on a specific source location, you can use ListLocations with filter name LocationType S3 and Operator Equals .

    • (dict) --

      Narrow down the list of resources returned by ListLocations . For example, to see all your Amazon S3 locations, create a filter using "Name": "LocationType" , "Operator": "Equals" , and "Values": "S3" .

      For more information, see filtering resources.

      • Name (string) -- [REQUIRED]

        The name of the filter being used. Each API call supports a list of filters that are available for it (for example, LocationType for ListLocations ).

      • Values (list) -- [REQUIRED]

        The values that you want to filter for. For example, you might want to display only Amazon S3 locations.

        • (string) --
      • Operator (string) -- [REQUIRED]

        The operator that is used to compare filter values (for example, Equals or Contains ).

Return type

dict

Returns

Response Syntax

{
    'Locations': [
        {
            'LocationArn': 'string',
            'LocationUri': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    ListLocationsResponse

    • Locations (list) --

      An array that contains a list of locations.

      • (dict) --

        Represents a single entry in a list of locations. LocationListEntry returns an array that contains a list of locations when the ListLocations operation is called.

        • LocationArn (string) --

          The Amazon Resource Name (ARN) of the location. For Network File System (NFS) or Amazon EFS, the location is the export path. For Amazon S3, the location is the prefix path that you want to mount and use as the root of the location.

        • LocationUri (string) --

          Represents a list of URIs of a location. LocationUri returns an array that contains a list of locations when the ListLocations operation is called.

          Format: TYPE://GLOBAL_ID/SUBDIR .

          TYPE designates the type of location (for example, nfs or s3 ).

          GLOBAL_ID is the globally unique identifier of the resource that backs the location. An example for EFS is us-east-2.fs-abcd1234 . An example for Amazon S3 is the bucket name, such as myBucket . An example for NFS is a valid IPv4 address or a hostname that is compliant with Domain Name Service (DNS).

          SUBDIR is a valid file system path, delimited by forward slashes as is the *nix convention. For NFS and Amazon EFS, it's the export path to mount the location. For Amazon S3, it's the prefix path that you mount to and treat as the root of the location.

    • NextToken (string) --

      An opaque string that indicates the position at which to begin returning the next list of locations.

Exceptions

  • DataSync.Client.exceptions.InvalidRequestException
  • DataSync.Client.exceptions.InternalException