Back to Aws Sdk Js V3

@aws-sdk/client-device-farm

clients/client-device-farm/README.md

3.1043.042.2 KB
Original Source
<!-- generated file, do not edit directly -->

@aws-sdk/client-device-farm

Description

AWS SDK for JavaScript DeviceFarm Client for Node.js, Browser and React Native.

<p>Welcome to the AWS Device Farm API documentation, which contains APIs for:</p> <ul> <li> <p>Testing on desktop browsers</p> <p> Device Farm makes it possible for you to test your web applications on desktop browsers using Selenium. The APIs for desktop browser testing contain <code>TestGrid</code> in their names. For more information, see <a href="https://docs.aws.amazon.com/devicefarm/latest/testgrid/">Testing Web Applications on Selenium with Device Farm</a>.</p> </li> <li> <p>Testing on real mobile devices</p> <p>Device Farm makes it possible for you to test apps on physical phones, tablets, and other devices in the cloud. For more information, see the <a href="https://docs.aws.amazon.com/devicefarm/latest/developerguide/">Device Farm Developer Guide</a>.</p> </li> </ul>

Installing

To install this package, use the CLI of your favorite package manager:

  • npm install @aws-sdk/client-device-farm
  • yarn add @aws-sdk/client-device-farm
  • pnpm add @aws-sdk/client-device-farm

Getting Started

Import

The AWS SDK is modulized by clients and commands. To send a request, you only need to import the DeviceFarmClient and the commands you need, for example ListDevicesCommand:

js
// ES5 example
const { DeviceFarmClient, ListDevicesCommand } = require("@aws-sdk/client-device-farm");
ts
// ES6+ example
import { DeviceFarmClient, ListDevicesCommand } from "@aws-sdk/client-device-farm";

Usage

To send a request:

  • Instantiate a client with configuration (e.g. credentials, region).
  • Instantiate a command with input parameters.
  • Call the send operation on the client, providing the command object as input.
js
const client = new DeviceFarmClient({ region: "REGION" });

const params = { /** input parameters */ };
const command = new ListDevicesCommand(params);

Async/await

We recommend using the await operator to wait for the promise returned by send operation as follows:

js
// async/await.
try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  // error handling.
} finally {
  // finally.
}

Promises

You can also use Promise chaining.

js
client
  .send(command)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  })
  .finally(() => {
    // finally.
  });

Aggregated client

The aggregated client class is exported from the same package, but without the "Client" suffix.

DeviceFarm extends DeviceFarmClient 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 (DeviceFarmClient). More details are in the blog post on modular packages in AWS SDK for JavaScript.

ts
import { DeviceFarm } from "@aws-sdk/client-device-farm";

const client = new DeviceFarm({ region: "REGION" });

// async/await.
try {
  const data = await client.listDevices(params);
  // process data.
} catch (error) {
  // error handling.
}

// Promises.
client
  .listDevices(params)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  });

// callbacks (not recommended).
client.listDevices(params, (err, data) => {
  // process err and data.
});

Troubleshooting

When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).

js
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.

Getting Help

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.

To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.

Contributing

This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-device-farm package is updated. To contribute to client you can check our generate clients scripts.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Client Commands (Operations List)

<details> <summary> CreateDevicePool </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateInstanceProfile </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateNetworkProfile </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateProject </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateRemoteAccessSession </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateTestGridProject </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateTestGridUrl </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateUpload </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateVPCEConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteDevicePool </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteInstanceProfile </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteNetworkProfile </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteProject </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteRemoteAccessSession </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteRun </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteTestGridProject </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteUpload </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteVPCEConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetAccountSettings </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDevice </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDeviceInstance </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDevicePool </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDevicePoolCompatibility </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetInstanceProfile </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetJob </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetNetworkProfile </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetOfferingStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetProject </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetRemoteAccessSession </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetRun </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetSuite </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetTest </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetTestGridProject </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetTestGridSession </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetUpload </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetVPCEConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> InstallToRemoteAccessSession </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListArtifacts </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListDeviceInstances </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListDevicePools </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListDevices </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListInstanceProfiles </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListJobs </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListNetworkProfiles </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListOfferingPromotions </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListOfferings </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListOfferingTransactions </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListProjects </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListRemoteAccessSessions </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListRuns </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListSamples </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListSuites </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListTagsForResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListTestGridProjects </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListTestGridSessionActions </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListTestGridSessionArtifacts </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListTestGridSessions </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListTests </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListUniqueProblems </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListUploads </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListVPCEConfigurations </summary>

Command API Reference / Input / Output

</details> <details> <summary> PurchaseOffering </summary>

Command API Reference / Input / Output

</details> <details> <summary> RenewOffering </summary>

Command API Reference / Input / Output

</details> <details> <summary> ScheduleRun </summary>

Command API Reference / Input / Output

</details> <details> <summary> StopJob </summary>

Command API Reference / Input / Output

</details> <details> <summary> StopRemoteAccessSession </summary>

Command API Reference / Input / Output

</details> <details> <summary> StopRun </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> UpdateDeviceInstance </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateDevicePool </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateInstanceProfile </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateNetworkProfile </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateProject </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateTestGridProject </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateUpload </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateVPCEConfiguration </summary>

Command API Reference / Input / Output

</details>