clients/client-datasync/README.md
AWS SDK for JavaScript DataSync Client for Node.js, Browser and React Native.
<fullname>DataSync</fullname>
<p>DataSync is an online data movement service that simplifies data migration and helps you quickly, easily, and securely transfer your file or object data to, from, and between Amazon Web Services storage services.</p> <p>This API interface reference includes documentation for using DataSync programmatically. For complete information, see the <i> <a href="https://docs.aws.amazon.com/datasync/latest/userguide/what-is-datasync.html">DataSync User Guide</a> </i>.</p>To install this package, use the CLI of your favorite package manager:
npm install @aws-sdk/client-datasyncyarn add @aws-sdk/client-datasyncpnpm add @aws-sdk/client-datasyncThe AWS SDK is modulized by clients and commands.
To send a request, you only need to import the DataSyncClient and
the commands you need, for example ListAgentsCommand:
// ES5 example
const { DataSyncClient, ListAgentsCommand } = require("@aws-sdk/client-datasync");
// ES6+ example
import { DataSyncClient, ListAgentsCommand } from "@aws-sdk/client-datasync";
To send a request:
send operation on the client, providing the command object as input.const client = new DataSyncClient({ region: "REGION" });
const params = { /** input parameters */ };
const command = new ListAgentsCommand(params);
We recommend using the await operator to wait for the promise returned by send operation as follows:
// async/await.
try {
const data = await client.send(command);
// process data.
} catch (error) {
// error handling.
} finally {
// finally.
}
You can also use Promise chaining.
client
.send(command)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
})
.finally(() => {
// finally.
});
The aggregated client class is exported from the same package, but without the "Client" suffix.
DataSync extends DataSyncClient and additionally supports all operations, waiters, and paginators as methods.
This style may be familiar to you from the AWS SDK for JavaScript v2.
If you are bundling the AWS SDK, we recommend using only the bare-bones client (DataSyncClient).
More details are in the blog post on
modular packages in AWS SDK for JavaScript.
import { DataSync } from "@aws-sdk/client-datasync";
const client = new DataSync({ region: "REGION" });
// async/await.
try {
const data = await client.listAgents(params);
// process data.
} catch (error) {
// error handling.
}
// Promises.
client
.listAgents(params)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
});
// callbacks (not recommended).
client.listAgents(params, (err, data) => {
// process err and data.
});
When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).
try {
const data = await client.send(command);
// process data.
} catch (error) {
const { requestId, cfId, extendedRequestId } = error.$metadata;
console.log({ requestId, cfId, extendedRequestId });
/**
* The keys within exceptions are also parsed.
* You can access them by specifying exception names:
* if (error.name === 'SomeServiceException') {
* const value = error.specialKeyInException;
* }
*/
}
See also docs/ERROR_HANDLING.
Please use these community resources for getting help. We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
aws-sdk-js
on AWS Developer Blog.aws-sdk-js.To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.
This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-datasync package is updated.
To contribute to client you can check our generate clients scripts.
This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.
Command API Reference / Input / Output
</details> <details> <summary> CreateAgent </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateLocationAzureBlob </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateLocationEfs </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateLocationFsxLustre </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateLocationFsxOntap </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateLocationFsxOpenZfs </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateLocationFsxWindows </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateLocationHdfs </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateLocationNfs </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateLocationObjectStorage </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateLocationS3 </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateLocationSmb </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateTask </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteAgent </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteLocation </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteTask </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeAgent </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeLocationAzureBlob </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeLocationEfs </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeLocationFsxLustre </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeLocationFsxOntap </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeLocationFsxOpenZfs </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeLocationFsxWindows </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeLocationHdfs </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeLocationNfs </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeLocationObjectStorage </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeLocationS3 </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeLocationSmb </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeTask </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeTaskExecution </summary>Command API Reference / Input / Output
</details> <details> <summary> ListAgents </summary>Command API Reference / Input / Output
</details> <details> <summary> ListLocations </summary>Command API Reference / Input / Output
</details> <details> <summary> ListTagsForResource </summary>Command API Reference / Input / Output
</details> <details> <summary> ListTaskExecutions </summary>Command API Reference / Input / Output
</details> <details> <summary> ListTasks </summary>Command API Reference / Input / Output
</details> <details> <summary> StartTaskExecution </summary>Command API Reference / Input / Output
</details> <details> <summary> TagResource </summary>Command API Reference / Input / Output
</details> <details> <summary> UntagResource </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateAgent </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateLocationAzureBlob </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateLocationEfs </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateLocationFsxLustre </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateLocationFsxOntap </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateLocationFsxOpenZfs </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateLocationFsxWindows </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateLocationHdfs </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateLocationNfs </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateLocationObjectStorage </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateLocationS3 </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateLocationSmb </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateTask </summary> </details> <details> <summary> UpdateTaskExecution </summary> </details>