You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::DataSync::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for AWS DataSync. To construct a client, you need to configure a :region and :credentials.

datasync = Aws::DataSync::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

See #initialize for a full list of supported configuration options.

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::DataSync::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::DataSync::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :active_endpoint_cache (Boolean)

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :disable_host_prefix_injection (Boolean)

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available. See Plugins::EndpointPattern for more details.

  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :endpoint_cache_max_entries (Integer)

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_max_threads (Integer)

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_poll_interval (Integer)

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec. See Plugins::EndpointDiscovery for more details.

  • :endpoint_discovery (Boolean)

    When set to true, endpoint discovery will be enabled for operations when available. Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :simple_json (Boolean) — default: false

    Disables request parameter conversion, validation, and formatting. Also disable response data type conversions. This option is useful when you want to ensure the highest level of performance by avoiding overhead of walking request parameters and response data structures.

    When :simple_json is enabled, the request parameters hash must be formatted exactly as the DynamoDB API expects. See Plugins::Protocols::JsonRpc for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#cancel_task_execution(options = {}) ⇒ Struct

Cancels execution of a task.

When you cancel a task execution, the transfer of some files is abruptly interrupted. The contents of files that are transferred to the destination might be incomplete or inconsistent with the source files. However, if you start a new task execution on the same task and you allow the task execution to complete, file content on the destination is complete and consistent. This applies to other unexpected failures that interrupt a task execution. In all of these cases, AWS DataSync successfully complete the transfer when you start the next task execution.

Examples:

Request syntax with placeholder values


resp = client.cancel_task_execution({
  task_execution_arn: "TaskExecutionArn", # required
})

Options Hash (options):

  • :task_execution_arn (required, String)

    The Amazon Resource Name (ARN) of the task execution to cancel.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_agent(options = {}) ⇒ Types::CreateAgentResponse

Activates an AWS DataSync agent that you have deployed on your host. The activation process associates your agent with your account. In the activation process, you specify information such as the AWS Region that you want to activate the agent in. You activate the agent in the AWS Region where your target locations (in Amazon S3 or Amazon EFS) reside. Your tasks are created in this AWS Region.

You can activate the agent in a VPC (virtual private cloud) or provide the agent access to a VPC endpoint so you can run tasks without going over the public internet.

You can use an agent for more than one location. If a task uses multiple agents, all of them need to have status AVAILABLE for the task to run. If you use multiple agents for a source location, the status of all the agents must be AVAILABLE for the task to run.

Agents are automatically updated by AWS on a regular basis, using a mechanism that ensures minimal interruption to your tasks.

Examples:

Request syntax with placeholder values


resp = client.create_agent({
  activation_key: "ActivationKey", # required
  agent_name: "TagValue",
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
  vpc_endpoint_id: "VpcEndpointId",
  subnet_arns: ["Ec2SubnetArn"],
  security_group_arns: ["Ec2SecurityGroupArn"],
})

Response structure


resp.agent_arn #=> String

Options Hash (options):

  • :activation_key (required, String)

    Your agent activation key. You can get the activation key either by sending an HTTP GET request with redirects that enable you to get the agent IP address (port 80). Alternatively, you can get it from the AWS DataSync console.

    The redirect URL returned in the response provides you the activation key for your agent in the query string parameter activationKey. It might also include other activation-related parameters; however, these are merely defaults. The arguments you pass to this API call determine the actual configuration of your agent.

    For more information, see Activating an Agent in the AWS DataSync User Guide.

  • :agent_name (String)

    The name you configured for your agent. This value is a text reference that is used to identify the agent in the console.

  • :tags (Array<Types::TagListEntry>)

    The key-value pair that represents the tag that you want to associate with the agent. The value can be an empty string. This value helps you manage, filter, and search for your agents.

    Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @.

  • :vpc_endpoint_id (String)

    The ID of the VPC (virtual private cloud) endpoint that the agent has access to. This is the client-side VPC endpoint, also called a PrivateLink. If you don\'t have a PrivateLink VPC endpoint, see Creating a VPC Endpoint Service Configuration in the Amazon VPC User Guide.

    VPC endpoint ID looks like this: vpce-01234d5aff67890e1.

  • :subnet_arns (Array<String>)

    The Amazon Resource Names (ARNs) of the subnets in which DataSync will create elastic network interfaces for each data transfer task. The agent that runs a task must be private. When you start a task that is associated with an agent created in a VPC, or one that has access to an IP address in a VPC, then the task is also private. In this case, DataSync creates four network interfaces for each task in your subnet. For a data transfer to work, the agent must be able to route to all these four network interfaces.

  • :security_group_arns (Array<String>)

    The ARNs of the security groups used to protect your data transfer task subnets. See CreateAgentRequest$SubnetArns.

Returns:

See Also:

#create_location_efs(options = {}) ⇒ Types::CreateLocationEfsResponse

Creates an endpoint for an Amazon EFS file system.

Examples:

Request syntax with placeholder values


resp = client.create_location_efs({
  subdirectory: "EfsSubdirectory",
  efs_filesystem_arn: "EfsFilesystemArn", # required
  ec2_config: { # required
    subnet_arn: "Ec2SubnetArn", # required
    security_group_arns: ["Ec2SecurityGroupArn"], # required
  },
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Response structure


resp.location_arn #=> String

Options Hash (options):

  • :subdirectory (String)

    A subdirectory in the location’s path. This subdirectory in the EFS file system is used to read data from the EFS source location or write data to the EFS destination. By default, AWS DataSync uses the root directory.

    Subdirectory must be specified with forward slashes. For example, /path/to/folder.

  • :efs_filesystem_arn (required, String)

    The Amazon Resource Name (ARN) for the Amazon EFS file system.

  • :ec2_config (required, Types::Ec2Config)

    The subnet and security group that the Amazon EFS file system uses. The security group that you provide needs to be able to communicate with the security group on the mount target in the subnet specified.

    The exact relationship between security group M (of the mount target) and security group S (which you provide for DataSync to use at this stage) is as follows:

    • Security group M (which you associate with the mount target) must allow inbound access for the Transmission Control Protocol (TCP) on the NFS port (2049) from security group S. You can enable inbound connections either by IP address (CIDR range) or security group.

    • Security group S (provided to DataSync to access EFS) should have a rule that enables outbound connections to the NFS port on one of the file system’s mount targets. You can enable outbound connections either by IP address (CIDR range) or security group.

      For information about security groups and mount targets, see Security Groups for Amazon EC2 Instances and Mount Targets in the Amazon EFS User Guide.

  • :tags (Array<Types::TagListEntry>)

    The key-value pair that represents a tag that you want to add to the resource. The value can be an empty string. This value helps you manage, filter, and search for your resources. We recommend that you create a name tag for your location.

Returns:

See Also:

#create_location_fsx_windows(options = {}) ⇒ Types::CreateLocationFsxWindowsResponse

Creates an endpoint for an Amazon FSx for Windows file system.

Examples:

Request syntax with placeholder values


resp = client.create_location_fsx_windows({
  subdirectory: "FsxWindowsSubdirectory",
  fsx_filesystem_arn: "FsxFilesystemArn", # required
  security_group_arns: ["Ec2SecurityGroupArn"], # required
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
  user: "SmbUser", # required
  domain: "SmbDomain",
  password: "SmbPassword", # required
})

Response structure


resp.location_arn #=> String

Options Hash (options):

  • :subdirectory (String)

    A subdirectory in the location’s path. This subdirectory in the Amazon FSx for Windows file system is used to read data from the Amazon FSx for Windows source location or write data to the FSx for Windows destination.

  • :fsx_filesystem_arn (required, String)

    The Amazon Resource Name (ARN) for the FSx for Windows file system.

  • :security_group_arns (required, Array<String>)

    The Amazon Resource Names (ARNs) of the security groups that are to use to configure the FSx for Windows file system.

  • :tags (Array<Types::TagListEntry>)

    The key-value pair that represents a tag that you want to add to the resource. The value can be an empty string. This value helps you manage, filter, and search for your resources. We recommend that you create a name tag for your location.

  • :user (required, String)

    The user who has the permissions to access files and folders in the FSx for Windows file system.

  • :domain (String)

    The name of the Windows domain that the FSx for Windows server belongs to.

  • :password (required, String)

    The password of the user who has the permissions to access files and folders in the FSx for Windows file system.

Returns:

See Also:

#create_location_nfs(options = {}) ⇒ Types::CreateLocationNfsResponse

Defines a file system on a Network File System (NFS) server that can be read from or written to.

Examples:

Request syntax with placeholder values


resp = client.create_location_nfs({
  subdirectory: "NfsSubdirectory", # required
  server_hostname: "ServerHostname", # required
  on_prem_config: { # required
    agent_arns: ["AgentArn"], # required
  },
  mount_options: {
    version: "AUTOMATIC", # accepts AUTOMATIC, NFS3, NFS4_0, NFS4_1
  },
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Response structure


resp.location_arn #=> String

Options Hash (options):

  • :subdirectory (required, String)

    The subdirectory in the NFS file system that is used to read data from the NFS source location or write data to the NFS destination. The NFS path should be a path that\'s exported by the NFS server, or a subdirectory of that path. The path should be such that it can be mounted by other NFS clients in your network.

    To see all the paths exported by your NFS server, run \"showmount -e nfs-server-name\" from an NFS client that has access to your server. You can specify any directory that appears in the results, and any subdirectory of that directory. Ensure that the NFS export is accessible without Kerberos authentication.

    To transfer all the data in the folder you specified, DataSync needs to have permissions to read all the data. To ensure this, either configure the NFS export with no_root_squash, or ensure that the permissions for all of the files that you want DataSync allow read access for all users. Doing either enables the agent to read the files. For the agent to access directories, you must additionally enable all execute access.

    If you are copying data to or from your AWS Snowcone device, see NFS Server on AWS Snowcone for more information.

    For information about NFS export configuration, see 18.7. The /etc/exports Configuration File in the Red Hat Enterprise Linux documentation.

  • :server_hostname (required, String)

    The name of the NFS server. This value is the IP address or Domain Name Service (DNS) name of the NFS server. An agent that is installed on-premises uses this host name to mount the NFS server in a network.

    If you are copying data to or from your AWS Snowcone device, see NFS Server on AWS Snowcone for more information.

    This name must either be DNS-compliant or must be an IP version 4 (IPv4) address.

  • :on_prem_config (required, Types::OnPremConfig)

    Contains a list of Amazon Resource Names (ARNs) of agents that are used to connect to an NFS server.

    If you are copying data to or from your AWS Snowcone device, see NFS Server on AWS Snowcone for more information.

  • :mount_options (Types::NfsMountOptions)

    The NFS mount options that DataSync can use to mount your NFS share.

  • :tags (Array<Types::TagListEntry>)

    The key-value pair that represents the tag that you want to add to the location. The value can be an empty string. We recommend using tags to name your resources.

Returns:

See Also:

#create_location_object_storage(options = {}) ⇒ Types::CreateLocationObjectStorageResponse

Creates an endpoint for a self-managed object storage bucket. For more information about self-managed object storage locations, see create-object-location.

Examples:

Request syntax with placeholder values


resp = client.create_location_object_storage({
  server_hostname: "ServerHostname", # required
  server_port: 1,
  server_protocol: "HTTPS", # accepts HTTPS, HTTP
  subdirectory: "S3Subdirectory",
  bucket_name: "ObjectStorageBucketName", # required
  access_key: "ObjectStorageAccessKey",
  secret_key: "ObjectStorageSecretKey",
  agent_arns: ["AgentArn"], # required
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Response structure


resp.location_arn #=> String

Options Hash (options):

  • :server_hostname (required, String)

    The name of the self-managed object storage server. This value is the IP address or Domain Name Service (DNS) name of the object storage server. An agent uses this host name to mount the object storage server in a network.

  • :server_port (Integer)

    The port that your self-managed object storage server accepts inbound network traffic on. The server port is set by default to TCP 80 (HTTP) or TCP 443 (HTTPS). You can specify a custom port if your self-managed object storage server requires one.

  • :server_protocol (String)

    The protocol that the object storage server uses to communicate. Valid values are HTTP or HTTPS.

  • :subdirectory (String)

    The subdirectory in the self-managed object storage server that is used to read data from.

  • :bucket_name (required, String)

    The bucket on the self-managed object storage server that is used to read data from.

  • :access_key (String)

    Optional. The access key is used if credentials are required to access the self-managed object storage server. If your object storage requires a user name and password to authenticate, use AccessKey and SecretKey to provide the user name and password, respectively.

  • :secret_key (String)

    Optional. The secret key is used if credentials are required to access the self-managed object storage server. If your object storage requires a user name and password to authenticate, use AccessKey and SecretKey to provide the user name and password, respectively.

  • :agent_arns (required, Array<String>)

    The Amazon Resource Name (ARN) of the agents associated with the self-managed object storage server location.

  • :tags (Array<Types::TagListEntry>)

    The key-value pair that represents the tag that you want to add to the location. The value can be an empty string. We recommend using tags to name your resources.

Returns:

See Also:

#create_location_s3(options = {}) ⇒ Types::CreateLocationS3Response

Creates an endpoint for an Amazon S3 bucket.

For more information, see https://docs.aws.amazon.com/datasync/latest/userguide/create-locations-cli.html#create-location-s3-cli in the AWS DataSync User Guide.

Examples:

Request syntax with placeholder values


resp = client.create_location_s3({
  subdirectory: "S3Subdirectory",
  s3_bucket_arn: "S3BucketArn", # required
  s3_storage_class: "STANDARD", # accepts STANDARD, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE, OUTPOSTS
  s3_config: { # required
    bucket_access_role_arn: "IamRoleArn", # required
  },
  agent_arns: ["AgentArn"],
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Response structure


resp.location_arn #=> String

Options Hash (options):

  • :subdirectory (String)

    A subdirectory in the Amazon S3 bucket. This subdirectory in Amazon S3 is used to read data from the S3 source location or write data to the S3 destination.

  • :s3_bucket_arn (required, String)

    The ARN of the Amazon S3 bucket. If the bucket is on an AWS Outpost, this must be an access point ARN.

  • :s3_storage_class (String)

    The Amazon S3 storage class that you want to store your files in when this location is used as a task destination. For buckets in AWS Regions, the storage class defaults to Standard. For buckets on AWS Outposts, the storage class defaults to AWS S3 Outposts.

    For more information about S3 storage classes, see Amazon S3 Storage Classes. Some storage classes have behaviors that can affect your S3 storage cost. For detailed information, see using-storage-classes.

  • :s3_config (required, Types::S3Config)

    The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that is used to access an Amazon S3 bucket.

    For detailed information about using such a role, see Creating a Location for Amazon S3 in the AWS DataSync User Guide.

  • :agent_arns (Array<String>)

    If you are using DataSync on an AWS Outpost, specify the Amazon Resource Names (ARNs) of the DataSync agents deployed on your Outpost. For more information about launching a DataSync agent on an AWS Outpost, see outposts-agent.

  • :tags (Array<Types::TagListEntry>)

    The key-value pair that represents the tag that you want to add to the location. The value can be an empty string. We recommend using tags to name your resources.

Returns:

See Also:

#create_location_smb(options = {}) ⇒ Types::CreateLocationSmbResponse

Defines a file system on a Server Message Block (SMB) server that can be read from or written to.

Examples:

Request syntax with placeholder values


resp = client.create_location_smb({
  subdirectory: "SmbSubdirectory", # required
  server_hostname: "ServerHostname", # required
  user: "SmbUser", # required
  domain: "SmbDomain",
  password: "SmbPassword", # required
  agent_arns: ["AgentArn"], # required
  mount_options: {
    version: "AUTOMATIC", # accepts AUTOMATIC, SMB2, SMB3
  },
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Response structure


resp.location_arn #=> String

Options Hash (options):

  • :subdirectory (required, String)

    The subdirectory in the SMB file system that is used to read data from the SMB source location or write data to the SMB destination. The SMB path should be a path that\'s exported by the SMB server, or a subdirectory of that path. The path should be such that it can be mounted by other SMB clients in your network.

    Subdirectory must be specified with forward slashes. For example, /path/to/folder.

    To transfer all the data in the folder you specified, DataSync needs to have permissions to mount the SMB share, as well as to access all the data in that share. To ensure this, either ensure that the user/password specified belongs to the user who can mount the share, and who has the appropriate permissions for all of the files and directories that you want DataSync to access, or use credentials of a member of the Backup Operators group to mount the share. Doing either enables the agent to access the data. For the agent to access directories, you must additionally enable all execute access.

  • :server_hostname (required, String)

    The name of the SMB server. This value is the IP address or Domain Name Service (DNS) name of the SMB server. An agent that is installed on-premises uses this hostname to mount the SMB server in a network.

    This name must either be DNS-compliant or must be an IP version 4 (IPv4) address.

  • :user (required, String)

    The user who can mount the share, has the permissions to access files and folders in the SMB share.

  • :domain (String)

    The name of the Windows domain that the SMB server belongs to.

  • :password (required, String)

    The password of the user who can mount the share, has the permissions to access files and folders in the SMB share.

  • :agent_arns (required, Array<String>)

    The Amazon Resource Names (ARNs) of agents to use for a Simple Message Block (SMB) location.

  • :mount_options (Types::SmbMountOptions)

    The mount options used by DataSync to access the SMB server.

  • :tags (Array<Types::TagListEntry>)

    The key-value pair that represents the tag that you want to add to the location. The value can be an empty string. We recommend using tags to name your resources.

Returns:

See Also:

#create_task(options = {}) ⇒ Types::CreateTaskResponse

Creates a task. A task is a set of two locations (source and destination) and a set of Options that you use to control the behavior of a task. If you don't specify Options when you create a task, AWS DataSync populates them with service defaults.

When you create a task, it first enters the CREATING state. During CREATING AWS DataSync attempts to mount the on-premises Network File System (NFS) location. The task transitions to the AVAILABLE state without waiting for the AWS location to become mounted. If required, AWS DataSync mounts the AWS location before each task execution.

If an agent that is associated with a source (NFS) location goes offline, the task transitions to the UNAVAILABLE status. If the status of the task remains in the CREATING status for more than a few minutes, it means that your agent might be having trouble mounting the source NFS file system. Check the task's ErrorCode and ErrorDetail. Mount issues are often caused by either a misconfigured firewall or a mistyped NFS server hostname.

Examples:

Request syntax with placeholder values


resp = client.create_task({
  source_location_arn: "LocationArn", # required
  destination_location_arn: "LocationArn", # required
  cloud_watch_log_group_arn: "LogGroupArn",
  name: "TagValue",
  options: {
    verify_mode: "POINT_IN_TIME_CONSISTENT", # accepts POINT_IN_TIME_CONSISTENT, ONLY_FILES_TRANSFERRED, NONE
    overwrite_mode: "ALWAYS", # accepts ALWAYS, NEVER
    atime: "NONE", # accepts NONE, BEST_EFFORT
    mtime: "NONE", # accepts NONE, PRESERVE
    uid: "NONE", # accepts NONE, INT_VALUE, NAME, BOTH
    gid: "NONE", # accepts NONE, INT_VALUE, NAME, BOTH
    preserve_deleted_files: "PRESERVE", # accepts PRESERVE, REMOVE
    preserve_devices: "NONE", # accepts NONE, PRESERVE
    posix_permissions: "NONE", # accepts NONE, PRESERVE
    bytes_per_second: 1,
    task_queueing: "ENABLED", # accepts ENABLED, DISABLED
    log_level: "OFF", # accepts OFF, BASIC, TRANSFER
    transfer_mode: "CHANGED", # accepts CHANGED, ALL
  },
  excludes: [
    {
      filter_type: "SIMPLE_PATTERN", # accepts SIMPLE_PATTERN
      value: "FilterValue",
    },
  ],
  schedule: {
    schedule_expression: "ScheduleExpressionCron", # required
  },
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Response structure


resp.task_arn #=> String

Options Hash (options):

  • :source_location_arn (required, String)

    The Amazon Resource Name (ARN) of the source location for the task.

  • :destination_location_arn (required, String)

    The Amazon Resource Name (ARN) of an AWS storage resource\'s location.

  • :cloud_watch_log_group_arn (String)

    The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that is used to monitor and log events in the task.

  • :name (String)

    The name of a task. This value is a text reference that is used to identify the task in the console.

  • :options (Types::Options)

    The set of configuration options that control the behavior of a single execution of the task that occurs when you call StartTaskExecution. You can configure these options to preserve metadata such as user ID (UID) and group ID (GID), file permissions, data integrity verification, and so on.

    For each individual task execution, you can override these options by specifying the OverrideOptions before starting the task execution. For more information, see the operation.

  • :excludes (Array<Types::FilterRule>)

    A list of filter rules that determines which files to exclude from a task. The list should contain a single filter string that consists of the patterns to exclude. The patterns are delimited by \"|\" (that is, a pipe), for example, "/folder1|/folder2".

  • :schedule (Types::TaskSchedule)

    Specifies a schedule used to periodically transfer files from a source to a destination location. The schedule should be specified in UTC time. For more information, see task-scheduling.

  • :tags (Array<Types::TagListEntry>)

    The key-value pair that represents the tag that you want to add to the resource. The value can be an empty string.

Returns:

See Also:

#delete_agent(options = {}) ⇒ Struct

Deletes an agent. To specify which agent to delete, use the Amazon Resource Name (ARN) of the agent in your request. The operation disassociates the agent from your AWS account. However, it doesn't delete the agent virtual machine (VM) from your on-premises environment.

Examples:

Request syntax with placeholder values


resp = client.delete_agent({
  agent_arn: "AgentArn", # required
})

Options Hash (options):

  • :agent_arn (required, String)

    The Amazon Resource Name (ARN) of the agent to delete. Use the ListAgents operation to return a list of agents for your account and AWS Region.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_location(options = {}) ⇒ Struct

Deletes the configuration of a location used by AWS DataSync.

Examples:

Request syntax with placeholder values


resp = client.delete_location({
  location_arn: "LocationArn", # required
})

Options Hash (options):

  • :location_arn (required, String)

    The Amazon Resource Name (ARN) of the location to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_task(options = {}) ⇒ Struct

Deletes a task.

Examples:

Request syntax with placeholder values


resp = client.delete_task({
  task_arn: "TaskArn", # required
})

Options Hash (options):

  • :task_arn (required, String)

    The Amazon Resource Name (ARN) of the task to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#describe_agent(options = {}) ⇒ Types::DescribeAgentResponse

Returns metadata such as the name, the network interfaces, and the status (that is, whether the agent is running or not) for an agent. To specify which agent to describe, use the Amazon Resource Name (ARN) of the agent in your request.

Examples:

Request syntax with placeholder values


resp = client.describe_agent({
  agent_arn: "AgentArn", # required
})

Response structure


resp.agent_arn #=> String
resp.name #=> String
resp.status #=> String, one of "ONLINE", "OFFLINE"
resp.last_connection_time #=> Time
resp.creation_time #=> Time
resp.endpoint_type #=> String, one of "PUBLIC", "PRIVATE_LINK", "FIPS"
resp.private_link_config.vpc_endpoint_id #=> String
resp.private_link_config.private_link_endpoint #=> String
resp.private_link_config.subnet_arns #=> Array
resp.private_link_config.subnet_arns[0] #=> String
resp.private_link_config.security_group_arns #=> Array
resp.private_link_config.security_group_arns[0] #=> String

Options Hash (options):

  • :agent_arn (required, String)

    The Amazon Resource Name (ARN) of the agent to describe.

Returns:

See Also:

#describe_location_efs(options = {}) ⇒ Types::DescribeLocationEfsResponse

Returns metadata, such as the path information about an Amazon EFS location.

Examples:

Request syntax with placeholder values


resp = client.describe_location_efs({
  location_arn: "LocationArn", # required
})

Response structure


resp.location_arn #=> String
resp.location_uri #=> String
resp.ec2_config.subnet_arn #=> String
resp.ec2_config.security_group_arns #=> Array
resp.ec2_config.security_group_arns[0] #=> String
resp.creation_time #=> Time

Options Hash (options):

  • :location_arn (required, String)

    The Amazon Resource Name (ARN) of the EFS location to describe.

Returns:

See Also:

#describe_location_fsx_windows(options = {}) ⇒ Types::DescribeLocationFsxWindowsResponse

Returns metadata, such as the path information about an Amazon FSx for Windows location.

Examples:

Request syntax with placeholder values


resp = client.describe_location_fsx_windows({
  location_arn: "LocationArn", # required
})

Response structure


resp.location_arn #=> String
resp.location_uri #=> String
resp.security_group_arns #=> Array
resp.security_group_arns[0] #=> String
resp.creation_time #=> Time
resp.user #=> String
resp.domain #=> String

Options Hash (options):

  • :location_arn (required, String)

    The Amazon Resource Name (ARN) of the FSx for Windows location to describe.

Returns:

See Also:

#describe_location_nfs(options = {}) ⇒ Types::DescribeLocationNfsResponse

Returns metadata, such as the path information, about an NFS location.

Examples:

Request syntax with placeholder values


resp = client.describe_location_nfs({
  location_arn: "LocationArn", # required
})

Response structure


resp.location_arn #=> String
resp.location_uri #=> String
resp.on_prem_config.agent_arns #=> Array
resp.on_prem_config.agent_arns[0] #=> String
resp.mount_options.version #=> String, one of "AUTOMATIC", "NFS3", "NFS4_0", "NFS4_1"
resp.creation_time #=> Time

Options Hash (options):

  • :location_arn (required, String)

    The Amazon Resource Name (ARN) of the NFS location to describe.

Returns:

See Also:

#describe_location_object_storage(options = {}) ⇒ Types::DescribeLocationObjectStorageResponse

Returns metadata about a self-managed object storage server location. For more information about self-managed object storage locations, see create-object-location.

Examples:

Request syntax with placeholder values


resp = client.describe_location_object_storage({
  location_arn: "LocationArn", # required
})

Response structure


resp.location_arn #=> String
resp.location_uri #=> String
resp.access_key #=> String
resp.server_port #=> Integer
resp.server_protocol #=> String, one of "HTTPS", "HTTP"
resp.agent_arns #=> Array
resp.agent_arns[0] #=> String
resp.creation_time #=> Time

Options Hash (options):

  • :location_arn (required, String)

    The Amazon Resource Name (ARN) of the self-managed object storage server location that was described.

Returns:

See Also:

#describe_location_s3(options = {}) ⇒ Types::DescribeLocationS3Response

Returns metadata, such as bucket name, about an Amazon S3 bucket location.

Examples:

Request syntax with placeholder values


resp = client.describe_location_s3({
  location_arn: "LocationArn", # required
})

Response structure


resp.location_arn #=> String
resp.location_uri #=> String
resp.s3_storage_class #=> String, one of "STANDARD", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER", "DEEP_ARCHIVE", "OUTPOSTS"
resp.s3_config.bucket_access_role_arn #=> String
resp.agent_arns #=> Array
resp.agent_arns[0] #=> String
resp.creation_time #=> Time

Options Hash (options):

  • :location_arn (required, String)

    The Amazon Resource Name (ARN) of the Amazon S3 bucket location to describe.

Returns:

See Also:

#describe_location_smb(options = {}) ⇒ Types::DescribeLocationSmbResponse

Returns metadata, such as the path and user information about an SMB location.

Examples:

Request syntax with placeholder values


resp = client.describe_location_smb({
  location_arn: "LocationArn", # required
})

Response structure


resp.location_arn #=> String
resp.location_uri #=> String
resp.agent_arns #=> Array
resp.agent_arns[0] #=> String
resp.user #=> String
resp.domain #=> String
resp.mount_options.version #=> String, one of "AUTOMATIC", "SMB2", "SMB3"
resp.creation_time #=> Time

Options Hash (options):

  • :location_arn (required, String)

    The Amazon Resource Name (ARN) of the SMB location to describe.

Returns:

See Also:

#describe_task(options = {}) ⇒ Types::DescribeTaskResponse

Returns metadata about a task.

Examples:

Request syntax with placeholder values


resp = client.describe_task({
  task_arn: "TaskArn", # required
})

Response structure


resp.task_arn #=> String
resp.status #=> String, one of "AVAILABLE", "CREATING", "QUEUED", "RUNNING", "UNAVAILABLE"
resp.name #=> String
resp.current_task_execution_arn #=> String
resp.source_location_arn #=> String
resp.destination_location_arn #=> String
resp.cloud_watch_log_group_arn #=> String
resp.source_network_interface_arns #=> Array
resp.source_network_interface_arns[0] #=> String
resp.destination_network_interface_arns #=> Array
resp.destination_network_interface_arns[0] #=> String
resp.options.verify_mode #=> String, one of "POINT_IN_TIME_CONSISTENT", "ONLY_FILES_TRANSFERRED", "NONE"
resp.options.overwrite_mode #=> String, one of "ALWAYS", "NEVER"
resp.options.atime #=> String, one of "NONE", "BEST_EFFORT"
resp.options.mtime #=> String, one of "NONE", "PRESERVE"
resp.options.uid #=> String, one of "NONE", "INT_VALUE", "NAME", "BOTH"
resp.options.gid #=> String, one of "NONE", "INT_VALUE", "NAME", "BOTH"
resp.options.preserve_deleted_files #=> String, one of "PRESERVE", "REMOVE"
resp.options.preserve_devices #=> String, one of "NONE", "PRESERVE"
resp.options.posix_permissions #=> String, one of "NONE", "PRESERVE"
resp.options.bytes_per_second #=> Integer
resp.options.task_queueing #=> String, one of "ENABLED", "DISABLED"
resp.options.log_level #=> String, one of "OFF", "BASIC", "TRANSFER"
resp.options.transfer_mode #=> String, one of "CHANGED", "ALL"
resp.excludes #=> Array
resp.excludes[0].filter_type #=> String, one of "SIMPLE_PATTERN"
resp.excludes[0].value #=> String
resp.schedule.schedule_expression #=> String
resp.error_code #=> String
resp.error_detail #=> String
resp.creation_time #=> Time

Options Hash (options):

  • :task_arn (required, String)

    The Amazon Resource Name (ARN) of the task to describe.

Returns:

See Also:

#describe_task_execution(options = {}) ⇒ Types::DescribeTaskExecutionResponse

Returns detailed metadata about a task that is being executed.

Examples:

Request syntax with placeholder values


resp = client.describe_task_execution({
  task_execution_arn: "TaskExecutionArn", # required
})

Response structure


resp.task_execution_arn #=> String
resp.status #=> String, one of "QUEUED", "LAUNCHING", "PREPARING", "TRANSFERRING", "VERIFYING", "SUCCESS", "ERROR"
resp.options.verify_mode #=> String, one of "POINT_IN_TIME_CONSISTENT", "ONLY_FILES_TRANSFERRED", "NONE"
resp.options.overwrite_mode #=> String, one of "ALWAYS", "NEVER"
resp.options.atime #=> String, one of "NONE", "BEST_EFFORT"
resp.options.mtime #=> String, one of "NONE", "PRESERVE"
resp.options.uid #=> String, one of "NONE", "INT_VALUE", "NAME", "BOTH"
resp.options.gid #=> String, one of "NONE", "INT_VALUE", "NAME", "BOTH"
resp.options.preserve_deleted_files #=> String, one of "PRESERVE", "REMOVE"
resp.options.preserve_devices #=> String, one of "NONE", "PRESERVE"
resp.options.posix_permissions #=> String, one of "NONE", "PRESERVE"
resp.options.bytes_per_second #=> Integer
resp.options.task_queueing #=> String, one of "ENABLED", "DISABLED"
resp.options.log_level #=> String, one of "OFF", "BASIC", "TRANSFER"
resp.options.transfer_mode #=> String, one of "CHANGED", "ALL"
resp.excludes #=> Array
resp.excludes[0].filter_type #=> String, one of "SIMPLE_PATTERN"
resp.excludes[0].value #=> String
resp.includes #=> Array
resp.includes[0].filter_type #=> String, one of "SIMPLE_PATTERN"
resp.includes[0].value #=> String
resp.start_time #=> Time
resp.estimated_files_to_transfer #=> Integer
resp.estimated_bytes_to_transfer #=> Integer
resp.files_transferred #=> Integer
resp.bytes_written #=> Integer
resp.bytes_transferred #=> Integer
resp.result.prepare_duration #=> Integer
resp.result.prepare_status #=> String, one of "PENDING", "SUCCESS", "ERROR"
resp.result.total_duration #=> Integer
resp.result.transfer_duration #=> Integer
resp.result.transfer_status #=> String, one of "PENDING", "SUCCESS", "ERROR"
resp.result.verify_duration #=> Integer
resp.result.verify_status #=> String, one of "PENDING", "SUCCESS", "ERROR"
resp.result.error_code #=> String
resp.result.error_detail #=> String

Options Hash (options):

  • :task_execution_arn (required, String)

    The Amazon Resource Name (ARN) of the task that is being executed.

Returns:

See Also:

#list_agents(options = {}) ⇒ Types::ListAgentsResponse

Returns a list of agents owned by an AWS account in the AWS Region specified in the request. The returned list is ordered by agent Amazon Resource Name (ARN).

By default, this operation returns a maximum of 100 agents. This operation supports pagination that enables you to optionally reduce the number of agents returned in a response.

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

Examples:

Request syntax with placeholder values


resp = client.list_agents({
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.agents #=> Array
resp.agents[0].agent_arn #=> String
resp.agents[0].name #=> String
resp.agents[0].status #=> String, one of "ONLINE", "OFFLINE"
resp.next_token #=> String

Options Hash (options):

  • :max_results (Integer)

    The maximum number of agents to list.

  • :next_token (String)

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

Returns:

See Also:

#list_locations(options = {}) ⇒ Types::ListLocationsResponse

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.

Examples:

Request syntax with placeholder values


resp = client.list_locations({
  max_results: 1,
  next_token: "NextToken",
  filters: [
    {
      name: "LocationUri", # required, accepts LocationUri, LocationType, CreationTime
      values: ["FilterAttributeValue"], # required
      operator: "Equals", # required, accepts Equals, NotEquals, In, LessThanOrEqual, LessThan, GreaterThanOrEqual, GreaterThan, Contains, NotContains, BeginsWith
    },
  ],
})

Response structure


resp.locations #=> Array
resp.locations[0].location_arn #=> String
resp.locations[0].location_uri #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (Integer)

    The maximum number of locations to return.

  • :next_token (String)

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

  • :filters (Array<Types::LocationFilter>)

    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.

Returns:

See Also:

#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse

Returns all the tags associated with a specified resource.

Examples:

Request syntax with placeholder values


resp = client.list_tags_for_resource({
  resource_arn: "TaggableResourceArn", # required
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.tags #=> Array
resp.tags[0].key #=> String
resp.tags[0].value #=> String
resp.next_token #=> String

Options Hash (options):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource whose tags to list.

  • :max_results (Integer)

    The maximum number of locations to return.

  • :next_token (String)

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

Returns:

See Also:

#list_task_executions(options = {}) ⇒ Types::ListTaskExecutionsResponse

Returns a list of executed tasks.

Examples:

Request syntax with placeholder values


resp = client.list_task_executions({
  task_arn: "TaskArn",
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.task_executions #=> Array
resp.task_executions[0].task_execution_arn #=> String
resp.task_executions[0].status #=> String, one of "QUEUED", "LAUNCHING", "PREPARING", "TRANSFERRING", "VERIFYING", "SUCCESS", "ERROR"
resp.next_token #=> String

Options Hash (options):

  • :task_arn (String)

    The Amazon Resource Name (ARN) of the task whose tasks you want to list.

  • :max_results (Integer)

    The maximum number of executed tasks to list.

  • :next_token (String)

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

Returns:

See Also:

#list_tasks(options = {}) ⇒ Types::ListTasksResponse

Returns a list of all the tasks.

Examples:

Request syntax with placeholder values


resp = client.list_tasks({
  max_results: 1,
  next_token: "NextToken",
  filters: [
    {
      name: "LocationId", # required, accepts LocationId, CreationTime
      values: ["FilterAttributeValue"], # required
      operator: "Equals", # required, accepts Equals, NotEquals, In, LessThanOrEqual, LessThan, GreaterThanOrEqual, GreaterThan, Contains, NotContains, BeginsWith
    },
  ],
})

Response structure


resp.tasks #=> Array
resp.tasks[0].task_arn #=> String
resp.tasks[0].status #=> String, one of "AVAILABLE", "CREATING", "QUEUED", "RUNNING", "UNAVAILABLE"
resp.tasks[0].name #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (Integer)

    The maximum number of tasks to return.

  • :next_token (String)

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

  • :filters (Array<Types::TaskFilter>)

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

Returns:

See Also:

#start_task_execution(options = {}) ⇒ Types::StartTaskExecutionResponse

Starts a specific invocation of a task. A TaskExecution value represents an individual run of a task. Each task can have at most one TaskExecution at a time.

TaskExecution has the following transition phases: INITIALIZING | PREPARING | TRANSFERRING | VERIFYING | SUCCESS/FAILURE.

For detailed information, see the Task Execution section in the Components and Terminology topic in the AWS DataSync User Guide.

Examples:

Request syntax with placeholder values


resp = client.start_task_execution({
  task_arn: "TaskArn", # required
  override_options: {
    verify_mode: "POINT_IN_TIME_CONSISTENT", # accepts POINT_IN_TIME_CONSISTENT, ONLY_FILES_TRANSFERRED, NONE
    overwrite_mode: "ALWAYS", # accepts ALWAYS, NEVER
    atime: "NONE", # accepts NONE, BEST_EFFORT
    mtime: "NONE", # accepts NONE, PRESERVE
    uid: "NONE", # accepts NONE, INT_VALUE, NAME, BOTH
    gid: "NONE", # accepts NONE, INT_VALUE, NAME, BOTH
    preserve_deleted_files: "PRESERVE", # accepts PRESERVE, REMOVE
    preserve_devices: "NONE", # accepts NONE, PRESERVE
    posix_permissions: "NONE", # accepts NONE, PRESERVE
    bytes_per_second: 1,
    task_queueing: "ENABLED", # accepts ENABLED, DISABLED
    log_level: "OFF", # accepts OFF, BASIC, TRANSFER
    transfer_mode: "CHANGED", # accepts CHANGED, ALL
  },
  includes: [
    {
      filter_type: "SIMPLE_PATTERN", # accepts SIMPLE_PATTERN
      value: "FilterValue",
    },
  ],
})

Response structure


resp.task_execution_arn #=> String

Options Hash (options):

  • :task_arn (required, String)

    The Amazon Resource Name (ARN) of the task to start.

  • :override_options (Types::Options)

    Represents the options that are available to control the behavior of a StartTaskExecution operation. Behavior includes preserving metadata such as user ID (UID), group ID (GID), and file permissions, and also overwriting files in the destination, data integrity verification, and so on.

    A task has a set of default options associated with it. If you don't specify an option in StartTaskExecution, the default value is used. You can override the defaults options on each task execution by specifying an overriding Options value to StartTaskExecution.

  • :includes (Array<Types::FilterRule>)

    A list of filter rules that determines which files to include when running a task. The pattern should contain a single filter string that consists of the patterns to include. The patterns are delimited by \"|\" (that is, a pipe). For example: "/folder1|/folder2"

Returns:

See Also:

#tag_resource(options = {}) ⇒ Struct

Applies a key-value pair to an AWS resource.

Examples:

Request syntax with placeholder values


resp = client.tag_resource({
  resource_arn: "TaggableResourceArn", # required
  tags: [ # required
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Options Hash (options):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource to apply the tag to.

  • :tags (required, Array<Types::TagListEntry>)

    The tags to apply.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#untag_resource(options = {}) ⇒ Struct

Removes a tag from an AWS resource.

Examples:

Request syntax with placeholder values


resp = client.untag_resource({
  resource_arn: "TaggableResourceArn", # required
  keys: ["TagKey"], # required
})

Options Hash (options):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource to remove the tag from.

  • :keys (required, Array<String>)

    The keys in the key-value pair in the tag to remove.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_agent(options = {}) ⇒ Struct

Updates the name of an agent.

Examples:

Request syntax with placeholder values


resp = client.update_agent({
  agent_arn: "AgentArn", # required
  name: "TagValue",
})

Options Hash (options):

  • :agent_arn (required, String)

    The Amazon Resource Name (ARN) of the agent to update.

  • :name (String)

    The name that you want to use to configure the agent.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_task(options = {}) ⇒ Struct

Updates the metadata associated with a task.

Examples:

Request syntax with placeholder values


resp = client.update_task({
  task_arn: "TaskArn", # required
  options: {
    verify_mode: "POINT_IN_TIME_CONSISTENT", # accepts POINT_IN_TIME_CONSISTENT, ONLY_FILES_TRANSFERRED, NONE
    overwrite_mode: "ALWAYS", # accepts ALWAYS, NEVER
    atime: "NONE", # accepts NONE, BEST_EFFORT
    mtime: "NONE", # accepts NONE, PRESERVE
    uid: "NONE", # accepts NONE, INT_VALUE, NAME, BOTH
    gid: "NONE", # accepts NONE, INT_VALUE, NAME, BOTH
    preserve_deleted_files: "PRESERVE", # accepts PRESERVE, REMOVE
    preserve_devices: "NONE", # accepts NONE, PRESERVE
    posix_permissions: "NONE", # accepts NONE, PRESERVE
    bytes_per_second: 1,
    task_queueing: "ENABLED", # accepts ENABLED, DISABLED
    log_level: "OFF", # accepts OFF, BASIC, TRANSFER
    transfer_mode: "CHANGED", # accepts CHANGED, ALL
  },
  excludes: [
    {
      filter_type: "SIMPLE_PATTERN", # accepts SIMPLE_PATTERN
      value: "FilterValue",
    },
  ],
  schedule: {
    schedule_expression: "ScheduleExpressionCron", # required
  },
  name: "TagValue",
  cloud_watch_log_group_arn: "LogGroupArn",
})

Options Hash (options):

  • :task_arn (required, String)

    The Amazon Resource Name (ARN) of the resource name of the task to update.

  • :options (Types::Options)

    Represents the options that are available to control the behavior of a StartTaskExecution operation. Behavior includes preserving metadata such as user ID (UID), group ID (GID), and file permissions, and also overwriting files in the destination, data integrity verification, and so on.

    A task has a set of default options associated with it. If you don't specify an option in StartTaskExecution, the default value is used. You can override the defaults options on each task execution by specifying an overriding Options value to StartTaskExecution.

  • :excludes (Array<Types::FilterRule>)

    A list of filter rules that determines which files to exclude from a task. The list should contain a single filter string that consists of the patterns to exclude. The patterns are delimited by \"|\" (that is, a pipe), for example: "/folder1|/folder2"

  • :schedule (Types::TaskSchedule)

    Specifies a schedule used to periodically transfer files from a source to a destination location. You can configure your task to execute hourly, daily, weekly or on specific days of the week. You control when in the day or hour you want the task to execute. The time you specify is UTC time. For more information, see task-scheduling.

  • :name (String)

    The name of the task to update.

  • :cloud_watch_log_group_arn (String)

    The Amazon Resource Name (ARN) of the resource name of the CloudWatch LogGroup.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_task_execution(options = {}) ⇒ Struct

Updates execution of a task.

You can modify bandwidth throttling for a task execution that is running or queued. For more information, see Adjusting Bandwidth Throttling for a Task Execution.

The only Option that can be modified by UpdateTaskExecution is BytesPerSecond .

Examples:

Request syntax with placeholder values


resp = client.update_task_execution({
  task_execution_arn: "TaskExecutionArn", # required
  options: { # required
    verify_mode: "POINT_IN_TIME_CONSISTENT", # accepts POINT_IN_TIME_CONSISTENT, ONLY_FILES_TRANSFERRED, NONE
    overwrite_mode: "ALWAYS", # accepts ALWAYS, NEVER
    atime: "NONE", # accepts NONE, BEST_EFFORT
    mtime: "NONE", # accepts NONE, PRESERVE
    uid: "NONE", # accepts NONE, INT_VALUE, NAME, BOTH
    gid: "NONE", # accepts NONE, INT_VALUE, NAME, BOTH
    preserve_deleted_files: "PRESERVE", # accepts PRESERVE, REMOVE
    preserve_devices: "NONE", # accepts NONE, PRESERVE
    posix_permissions: "NONE", # accepts NONE, PRESERVE
    bytes_per_second: 1,
    task_queueing: "ENABLED", # accepts ENABLED, DISABLED
    log_level: "OFF", # accepts OFF, BASIC, TRANSFER
    transfer_mode: "CHANGED", # accepts CHANGED, ALL
  },
})

Options Hash (options):

  • :task_execution_arn (required, String)

    The Amazon Resource Name (ARN) of the specific task execution that is being updated.

  • :options (required, Types::Options)

    Represents the options that are available to control the behavior of a StartTaskExecution operation. Behavior includes preserving metadata such as user ID (UID), group ID (GID), and file permissions, and also overwriting files in the destination, data integrity verification, and so on.

    A task has a set of default options associated with it. If you don't specify an option in StartTaskExecution, the default value is used. You can override the defaults options on each task execution by specifying an overriding Options value to StartTaskExecution.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

  • params (Hash) (defaults to: {})

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:

Returns:

  • (Array<Symbol>)

    the list of supported waiters.