Back to Aws Sdk Js V3

@aws-sdk/client-codecatalyst

clients/client-codecatalyst/README.md

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

@aws-sdk/client-codecatalyst

Description

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

<p>Welcome to the Amazon CodeCatalyst API reference. This reference provides descriptions of operations and data types for Amazon CodeCatalyst. You can use the Amazon CodeCatalyst API to work with the following objects. </p> <p>Spaces, by calling the following:</p> <ul> <li> <p> <a>DeleteSpace</a>, which deletes a space.</p> </li> <li> <p> <a>GetSpace</a>, which returns information about a space.</p> </li> <li> <p> <a>GetSubscription</a>, which returns information about the Amazon Web Services account used for billing purposes and the billing plan for the space.</p> </li> <li> <p> <a>ListSpaces</a>, which retrieves a list of spaces.</p> </li> <li> <p> <a>UpdateSpace</a>, which changes one or more values for a space.</p> </li> </ul> <p>Projects, by calling the following:</p> <ul> <li> <p> <a>CreateProject</a> which creates a project in a specified space.</p> </li> <li> <p> <a>GetProject</a>, which returns information about a project.</p> </li> <li> <p> <a>ListProjects</a>, which retrieves a list of projects in a space.</p> </li> </ul> <p>Users, by calling the following:</p> <ul> <li> <p> <a>GetUserDetails</a>, which returns information about a user in Amazon CodeCatalyst.</p> </li> </ul> <p>Source repositories, by calling the following:</p> <ul> <li> <p> <a>CreateSourceRepository</a>, which creates an empty Git-based source repository in a specified project.</p> </li> <li> <p> <a>CreateSourceRepositoryBranch</a>, which creates a branch in a specified repository where you can work on code.</p> </li> <li> <p> <a>DeleteSourceRepository</a>, which deletes a source repository.</p> </li> <li> <p> <a>GetSourceRepository</a>, which returns information about a source repository.</p> </li> <li> <p> <a>GetSourceRepositoryCloneUrls</a>, which returns information about the URLs that can be used with a Git client to clone a source repository.</p> </li> <li> <p> <a>ListSourceRepositories</a>, which retrieves a list of source repositories in a project.</p> </li> <li> <p> <a>ListSourceRepositoryBranches</a>, which retrieves a list of branches in a source repository.</p> </li> </ul> <p>Dev Environments and the Amazon Web Services Toolkits, by calling the following:</p> <ul> <li> <p> <a>CreateDevEnvironment</a>, which creates a Dev Environment, where you can quickly work on the code stored in the source repositories of your project.</p> </li> <li> <p> <a>DeleteDevEnvironment</a>, which deletes a Dev Environment.</p> </li> <li> <p> <a>GetDevEnvironment</a>, which returns information about a Dev Environment.</p> </li> <li> <p> <a>ListDevEnvironments</a>, which retrieves a list of Dev Environments in a project.</p> </li> <li> <p> <a>ListDevEnvironmentSessions</a>, which retrieves a list of active Dev Environment sessions in a project.</p> </li> <li> <p> <a>StartDevEnvironment</a>, which starts a specified Dev Environment and puts it into an active state.</p> </li> <li> <p> <a>StartDevEnvironmentSession</a>, which starts a session to a specified Dev Environment.</p> </li> <li> <p> <a>StopDevEnvironment</a>, which stops a specified Dev Environment and puts it into an stopped state.</p> </li> <li> <p> <a>StopDevEnvironmentSession</a>, which stops a session for a specified Dev Environment.</p> </li> <li> <p> <a>UpdateDevEnvironment</a>, which changes one or more values for a Dev Environment.</p> </li> </ul> <p>Workflows, by calling the following:</p> <ul> <li> <p> <a>GetWorkflow</a>, which returns information about a workflow.</p> </li> <li> <p> <a>GetWorkflowRun</a>, which returns information about a specified run of a workflow.</p> </li> <li> <p> <a>ListWorkflowRuns</a>, which retrieves a list of runs of a specified workflow.</p> </li> <li> <p> <a>ListWorkflows</a>, which retrieves a list of workflows in a specified project.</p> </li> <li> <p> <a>StartWorkflowRun</a>, which starts a run of a specified workflow.</p> </li> </ul> <p>Security, activity, and resource management in Amazon CodeCatalyst, by calling the following:</p> <ul> <li> <p> <a>CreateAccessToken</a>, which creates a personal access token (PAT) for the current user.</p> </li> <li> <p> <a>DeleteAccessToken</a>, which deletes a specified personal access token (PAT).</p> </li> <li> <p> <a>ListAccessTokens</a>, which lists all personal access tokens (PATs) associated with a user.</p> </li> <li> <p> <a>ListEventLogs</a>, which retrieves a list of events that occurred during a specified time period in a space.</p> </li> <li> <p> <a>VerifySession</a>, which verifies whether the calling user has a valid Amazon CodeCatalyst login and session.</p> </li> </ul> <note> <p>If you are using the Amazon CodeCatalyst APIs with an SDK or the CLI, you must configure your computer to work with Amazon CodeCatalyst and single sign-on (SSO). For more information, see <a href="https://docs.aws.amazon.com/codecatalyst/latest/userguide/set-up-cli.html">Setting up to use the CLI with Amazon CodeCatalyst</a> and the SSO documentation for your SDK.</p> </note>

Installing

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

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

Getting Started

Import

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

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

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

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

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

ts
import { CodeCatalyst } from "@aws-sdk/client-codecatalyst";

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

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

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

// callbacks (not recommended).
client.listSpaces(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-codecatalyst 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> CreateAccessToken </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateDevEnvironment </summary>

Command API Reference / Input / Output

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

Command API Reference / Input / Output

</details> <details> <summary> CreateSourceRepository </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateSourceRepositoryBranch </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteAccessToken </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteDevEnvironment </summary>

Command API Reference / Input / Output

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

Command API Reference / Input / Output

</details> <details> <summary> DeleteSourceRepository </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteSpace </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDevEnvironment </summary>

Command API Reference / Input / Output

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

Command API Reference / Input / Output

</details> <details> <summary> GetSourceRepository </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetSourceRepositoryCloneUrls </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetSpace </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetSubscription </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetUserDetails </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetWorkflow </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetWorkflowRun </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListAccessTokens </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListDevEnvironments </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListDevEnvironmentSessions </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListEventLogs </summary>

Command API Reference / Input / Output

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

Command API Reference / Input / Output

</details> <details> <summary> ListSourceRepositories </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListSourceRepositoryBranches </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListSpaces </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListWorkflowRuns </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListWorkflows </summary>

Command API Reference / Input / Output

</details> <details> <summary> StartDevEnvironment </summary>

Command API Reference / Input / Output

</details> <details> <summary> StartDevEnvironmentSession </summary>

Command API Reference / Input / Output

</details> <details> <summary> StartWorkflowRun </summary>

Command API Reference / Input / Output

</details> <details> <summary> StopDevEnvironment </summary>

Command API Reference / Input / Output

</details> <details> <summary> StopDevEnvironmentSession </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateDevEnvironment </summary>

Command API Reference / Input / Output

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

Command API Reference / Input / Output

</details> <details> <summary> UpdateSpace </summary>

Command API Reference / Input / Output

</details> <details> <summary> VerifySession </summary>

Command API Reference / Input / Output

</details>