Back to Aws Sdk Js V3

@aws-sdk/client-workspaces

clients/client-workspaces/README.md

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

@aws-sdk/client-workspaces

Description

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

<fullname>Amazon WorkSpaces Service</fullname>

<p>Amazon WorkSpaces enables you to provision virtual, cloud-based Microsoft Windows or Amazon Linux desktops for your users, known as <i>WorkSpaces</i>. WorkSpaces eliminates the need to procure and deploy hardware or install complex software. You can quickly add or remove users as your needs change. Users can access their virtual desktops from multiple devices or web browsers.</p> <p>This API Reference provides detailed information about the actions, data types, parameters, and errors of the WorkSpaces service. For more information about the supported Amazon Web Services Regions, endpoints, and service quotas of the Amazon WorkSpaces service, see <a href="https://docs.aws.amazon.com/general/latest/gr/wsp.html">WorkSpaces endpoints and quotas</a> in the <i>Amazon Web Services General Reference</i>.</p> <p>You can also manage your WorkSpaces resources using the WorkSpaces console, Command Line Interface (CLI), and SDKs. For more information about administering WorkSpaces, see the <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/">Amazon WorkSpaces Administration Guide</a>. For more information about using the Amazon WorkSpaces client application or web browser to access provisioned WorkSpaces, see the <a href="https://docs.aws.amazon.com/workspaces/latest/userguide/">Amazon WorkSpaces User Guide</a>. For more information about using the CLI to manage your WorkSpaces resources, see the <a href="https://docs.aws.amazon.com/cli/latest/reference/workspaces/index.html">WorkSpaces section of the CLI Reference</a>.</p>

Installing

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

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

Getting Started

Import

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

js
// ES5 example
const { WorkSpacesClient, ListAccountLinksCommand } = require("@aws-sdk/client-workspaces");
ts
// ES6+ example
import { WorkSpacesClient, ListAccountLinksCommand } from "@aws-sdk/client-workspaces";

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 WorkSpacesClient({ region: "REGION" });

const params = { /** input parameters */ };
const command = new ListAccountLinksCommand(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.

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

ts
import { WorkSpaces } from "@aws-sdk/client-workspaces";

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

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

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

// callbacks (not recommended).
client.listAccountLinks(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-workspaces 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> AcceptAccountLinkInvitation </summary>

Command API Reference / Input / Output

</details> <details> <summary> AssociateConnectionAlias </summary>

Command API Reference / Input / Output

</details> <details> <summary> AssociateIpGroups </summary>

Command API Reference / Input / Output

</details> <details> <summary> AssociateWorkspaceApplication </summary>

Command API Reference / Input / Output

</details> <details> <summary> AuthorizeIpRules </summary>

Command API Reference / Input / Output

</details> <details> <summary> CopyWorkspaceImage </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateAccountLinkInvitation </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateConnectClientAddIn </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateConnectionAlias </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateIpGroup </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateStandbyWorkspaces </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateTags </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateUpdatedWorkspaceImage </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateWorkspaceBundle </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateWorkspaceImage </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateWorkspaces </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateWorkspacesPool </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteAccountLinkInvitation </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteClientBranding </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteConnectClientAddIn </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteConnectionAlias </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteIpGroup </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteTags </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteWorkspaceBundle </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteWorkspaceImage </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeployWorkspaceApplications </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeregisterWorkspaceDirectory </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeAccount </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeAccountModifications </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeApplicationAssociations </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeApplications </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeBundleAssociations </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeClientBranding </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeClientProperties </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeConnectClientAddIns </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeConnectionAliases </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeConnectionAliasPermissions </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeCustomWorkspaceImageImport </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeImageAssociations </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeIpGroups </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeTags </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeWorkspaceAssociations </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeWorkspaceBundles </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeWorkspaceDirectories </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeWorkspaceImagePermissions </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeWorkspaceImages </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeWorkspaces </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeWorkspacesConnectionStatus </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeWorkspaceSnapshots </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeWorkspacesPools </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeWorkspacesPoolSessions </summary>

Command API Reference / Input / Output

</details> <details> <summary> DisassociateConnectionAlias </summary>

Command API Reference / Input / Output

</details> <details> <summary> DisassociateIpGroups </summary>

Command API Reference / Input / Output

</details> <details> <summary> DisassociateWorkspaceApplication </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetAccountLink </summary>

Command API Reference / Input / Output

</details> <details> <summary> ImportClientBranding </summary>

Command API Reference / Input / Output

</details> <details> <summary> ImportCustomWorkspaceImage </summary>

Command API Reference / Input / Output

</details> <details> <summary> ImportWorkspaceImage </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListAccountLinks </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListAvailableManagementCidrRanges </summary>

Command API Reference / Input / Output

</details> <details> <summary> MigrateWorkspace </summary>

Command API Reference / Input / Output

</details> <details> <summary> ModifyAccount </summary>

Command API Reference / Input / Output

</details> <details> <summary> ModifyCertificateBasedAuthProperties </summary>

Command API Reference / Input / Output

</details> <details> <summary> ModifyClientProperties </summary>

Command API Reference / Input / Output

</details> <details> <summary> ModifyEndpointEncryptionMode </summary>

Command API Reference / Input / Output

</details> <details> <summary> ModifySamlProperties </summary>

Command API Reference / Input / Output

</details> <details> <summary> ModifySelfservicePermissions </summary>

Command API Reference / Input / Output

</details> <details> <summary> ModifyStreamingProperties </summary>

Command API Reference / Input / Output

</details> <details> <summary> ModifyWorkspaceAccessProperties </summary>

Command API Reference / Input / Output

</details> <details> <summary> ModifyWorkspaceCreationProperties </summary>

Command API Reference / Input / Output

</details> <details> <summary> ModifyWorkspaceProperties </summary>

Command API Reference / Input / Output

</details> <details> <summary> ModifyWorkspaceState </summary>

Command API Reference / Input / Output

</details> <details> <summary> RebootWorkspaces </summary>

Command API Reference / Input / Output

</details> <details> <summary> RebuildWorkspaces </summary>

Command API Reference / Input / Output

</details> <details> <summary> RegisterWorkspaceDirectory </summary>

Command API Reference / Input / Output

</details> <details> <summary> RejectAccountLinkInvitation </summary>

Command API Reference / Input / Output

</details> <details> <summary> RestoreWorkspace </summary>

Command API Reference / Input / Output

</details> <details> <summary> RevokeIpRules </summary>

Command API Reference / Input / Output

</details> <details> <summary> StartWorkspaces </summary>

Command API Reference / Input / Output

</details> <details> <summary> StartWorkspacesPool </summary>

Command API Reference / Input / Output

</details> <details> <summary> StopWorkspaces </summary>

Command API Reference / Input / Output

</details> <details> <summary> StopWorkspacesPool </summary>

Command API Reference / Input / Output

</details> <details> <summary> TerminateWorkspaces </summary>

Command API Reference / Input / Output

</details> <details> <summary> TerminateWorkspacesPool </summary>

Command API Reference / Input / Output

</details> <details> <summary> TerminateWorkspacesPoolSession </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateConnectClientAddIn </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateConnectionAliasPermission </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateRulesOfIpGroup </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateWorkspaceBundle </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateWorkspaceImagePermission </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateWorkspacesPool </summary>

Command API Reference / Input / Output

</details>