AWS DataSync

2020/08/18 - AWS DataSync - 2 updated api methods

Changes  DataSync support for filters as input arguments to the ListTasks and ListLocations API calls.

ListLocations (updated) Link ¶
Changes (request)
{'Filters': [{'Name': 'LocationUri | LocationType | CreationTime',
              'Operator': 'Equals | NotEquals | In | LessThanOrEqual | '
                          'LessThan | GreaterThanOrEqual | GreaterThan | '
                          'Contains | NotContains | BeginsWith',
              'Values': ['string']}]}

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

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'
        },
    ]
)
type MaxResults

integer

param MaxResults

The maximum number of locations to return.

type NextToken

string

param NextToken

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

type Filters

list

param Filters
  • (dict) --

    • Name (string) -- [REQUIRED]

    • Values (list) -- [REQUIRED]

      • (string) --

    • Operator (string) -- [REQUIRED]

rtype

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 URLs 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. Valid values: NFS | EFS | 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 host name 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.

ListTasks (updated) Link ¶
Changes (request)
{'Filters': [{'Name': 'LocationId | CreationTime',
              'Operator': 'Equals | NotEquals | In | LessThanOrEqual | '
                          'LessThan | GreaterThanOrEqual | GreaterThan | '
                          'Contains | NotContains | BeginsWith',
              'Values': ['string']}]}

Returns a list of all the tasks.

See also: AWS API Documentation

Request Syntax

client.list_tasks(
    MaxResults=123,
    NextToken='string',
    Filters=[
        {
            'Name': 'LocationId'|'CreationTime',
            'Values': [
                'string',
            ],
            'Operator': 'Equals'|'NotEquals'|'In'|'LessThanOrEqual'|'LessThan'|'GreaterThanOrEqual'|'GreaterThan'|'Contains'|'NotContains'|'BeginsWith'
        },
    ]
)
type MaxResults

integer

param MaxResults

The maximum number of tasks to return.

type NextToken

string

param NextToken

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

type Filters

list

param Filters
  • (dict) --

    • Name (string) -- [REQUIRED]

    • Values (list) -- [REQUIRED]

      • (string) --

    • Operator (string) -- [REQUIRED]

rtype

dict

returns

Response Syntax

{
    'Tasks': [
        {
            'TaskArn': 'string',
            'Status': 'AVAILABLE'|'CREATING'|'QUEUED'|'RUNNING'|'UNAVAILABLE',
            'Name': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    ListTasksResponse

    • Tasks (list) --

      A list of all the tasks that are returned.

      • (dict) --

        Represents a single entry in a list of tasks. TaskListEntry returns an array that contains a list of tasks when the ListTasks operation is called. A task includes the source and destination file systems to sync and the options to use for the tasks.

        • TaskArn (string) --

          The Amazon Resource Name (ARN) of the task.

        • Status (string) --

          The status of the task.

        • Name (string) --

          The name of the task.

    • NextToken (string) --

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