Skip to content

DataSyncClient#

Index > DataSync > DataSyncClient

Auto-generated documentation for DataSync type annotations stubs module mypy-boto3-datasync.

DataSyncClient#

Type annotations and code completion for boto3.client("datasync"). boto3 documentation

# DataSyncClient usage example

from boto3.session import Session
from mypy_boto3_datasync.client import DataSyncClient

def get_datasync_client() -> DataSyncClient:
    return Session().client("datasync")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("datasync").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("datasync")

try:
    do_something(client)
except (
    client.exceptions.ClientError,
    client.exceptions.InternalException,
    client.exceptions.InvalidRequestException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_datasync.client import Exceptions

def handle_error(exc: Exceptions.ClientError) -> None:
    ...

Methods#

add_storage_system#

Creates an Amazon Web Services resource for an on-premises storage system that you want DataSync Discovery to collect information about.

Type annotations and code completion for boto3.client("datasync").add_storage_system method. boto3 documentation

# add_storage_system method definition

def add_storage_system(
    self,
    *,
    ServerConfiguration: DiscoveryServerConfigurationTypeDef,  # (1)
    SystemType: DiscoverySystemTypeType,  # (2)
    AgentArns: Sequence[str],
    ClientToken: str,
    Credentials: CredentialsTypeDef,  # (3)
    CloudWatchLogGroupArn: str = ...,
    Tags: Sequence[TagListEntryTypeDef] = ...,  # (4)
    Name: str = ...,
) -> AddStorageSystemResponseTypeDef:  # (5)
    ...
  1. See DiscoveryServerConfigurationTypeDef
  2. See DiscoverySystemTypeType
  3. See CredentialsTypeDef
  4. See TagListEntryTypeDef
  5. See AddStorageSystemResponseTypeDef
# add_storage_system method usage example with argument unpacking

kwargs: AddStorageSystemRequestRequestTypeDef = {  # (1)
    "ServerConfiguration": ...,
    "SystemType": ...,
    "AgentArns": ...,
    "ClientToken": ...,
    "Credentials": ...,
}

parent.add_storage_system(**kwargs)
  1. See AddStorageSystemRequestRequestTypeDef

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("datasync").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

cancel_task_execution#

Stops an DataSync task execution that's in progress.

Type annotations and code completion for boto3.client("datasync").cancel_task_execution method. boto3 documentation

# cancel_task_execution method definition

def cancel_task_execution(
    self,
    *,
    TaskExecutionArn: str,
) -> Dict[str, Any]:
    ...
# cancel_task_execution method usage example with argument unpacking

kwargs: CancelTaskExecutionRequestRequestTypeDef = {  # (1)
    "TaskExecutionArn": ...,
}

parent.cancel_task_execution(**kwargs)
  1. See CancelTaskExecutionRequestRequestTypeDef

close#

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("datasync").close method. boto3 documentation

# close method definition

def close(
    self,
) -> None:
    ...

create_agent#

Activates an DataSync agent that you've deployed in your storage environment.

Type annotations and code completion for boto3.client("datasync").create_agent method.