@aws-sdk/client-proton

中文文档
3.1164.0发布于 2026/11/07Apache-2.0TypeScriptESM + CJS近 30 天下载 9.7万

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

原始使用文档
文档目录10 节
  1. Description
  2. Installing
  3. Getting Started
  4. Import
  5. Usage
  6. Troubleshooting
  7. Getting Help
  8. Contributing
  9. License
  10. Client Commands (Operations List)

@aws-sdk/client-proton

Description

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

This is the Proton Service API Reference. It provides descriptions, syntax and usage examples for each of the actions and data types for the Proton service.

The documentation for each action shows the Query API request parameters and the XML response.

Alternatively, you can use the Amazon Web Services CLI to access an API. For more information, see the Amazon Web Services Command Line Interface User Guide.

The Proton service is a two-pronged automation framework. Administrators create service templates to provide standardized infrastructure and deployment tooling for serverless and container based applications. Developers, in turn, select from the available service templates to automate their application or service deployments.

Because administrators define the infrastructure and tooling that Proton deploys and manages, they need permissions to use all of the listed API operations.

When developers select a specific infrastructure and tooling set, Proton deploys their applications. To monitor their applications that are running on Proton, developers need permissions to the service create, list, update and delete API operations and the service instance list and update API operations.

To learn more about Proton, see the Proton User Guide.

Ensuring Idempotency

When you make a mutating API request, the request typically returns a result before the asynchronous workflows of the operation are complete. Operations might also time out or encounter other server issues before they're complete, even if the request already returned a result. This might make it difficult to determine whether the request succeeded. Moreover, you might need to retry the request multiple times to ensure that the operation completes successfully. However, if the original request and the subsequent retries are successful, the operation occurs multiple times. This means that you might create more resources than you intended.

Idempotency ensures that an API request action completes no more than one time. With an idempotent request, if the original request action completes successfully, any subsequent retries complete successfully without performing any further actions. However, the result might contain updated information, such as the current creation status.

The following lists of APIs are grouped according to methods that ensure idempotency.

Idempotent create APIs with a client token

The API actions in this list support idempotency with the use of a client token. The corresponding Amazon Web Services CLI commands also support idempotency using a client token. A client token is a unique, case-sensitive string of up to 64 ASCII characters. To make an idempotent API request using one of these actions, specify a client token in the request. We recommend that you don't reuse the same client token for other API requests. If you don’t provide a client token for these APIs, a default client token is automatically provided by SDKs.

Given a request action that has succeeded:

If you retry the request using the same client token and the same parameters, the retry succeeds without performing any further actions other than returning the original resource detail data in the response.

If you retry the request using the same client token, but one or more of the parameters are different, the retry throws a ValidationException with an IdempotentParameterMismatch error.

Client tokens expire eight hours after a request is made. If you retry the request with the expired token, a new resource is created.

If the original resource is deleted and you retry the request, a new resource is created.

Idempotent create APIs with a client token:

  • CreateEnvironmentTemplateVersion

  • CreateServiceTemplateVersion

  • CreateEnvironmentAccountConnection

Idempotent create APIs

Given a request action that has succeeded:

If you retry the request with an API from this group, and the original resource hasn't been modified, the retry succeeds without performing any further actions other than returning the original resource detail data in the response.

If the original resource has been modified, the retry throws a ConflictException.

If you retry with different input parameters, the retry throws a ValidationException with an IdempotentParameterMismatch error.

Idempotent create APIs:

  • CreateEnvironmentTemplate

  • CreateServiceTemplate

  • CreateEnvironment

  • CreateService

Idempotent delete APIs

Given a request action that has succeeded:

When you retry the request with an API from this group and the resource was deleted, its metadata is returned in the response.

If you retry and the resource doesn't exist, the response is empty.

In both cases, the retry succeeds.

Idempotent delete APIs:

  • DeleteEnvironmentTemplate

  • DeleteEnvironmentTemplateVersion

  • DeleteServiceTemplate

  • DeleteServiceTemplateVersion

  • DeleteEnvironmentAccountConnection

Asynchronous idempotent delete APIs

Given a request action that has succeeded:

If you retry the request with an API from this group, if the original request delete operation status is DELETE_IN_PROGRESS, the retry returns the resource detail data in the response without performing any further actions.

If the original request delete operation is complete, a retry returns an empty response.

Asynchronous idempotent delete APIs:

  • DeleteEnvironment

  • DeleteService

Installing

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

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

Getting Started

Import

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

// ES5 example
const { ProtonClient, ListComponentsCommand } = require("@aws-sdk/client-proton");
// ES6+ example
import { ProtonClient, ListComponentsCommand } from "@aws-sdk/client-proton";

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.
const client = new ProtonClient({ region: "REGION" });

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

Async/await

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

Promises

You can also use Promise chaining.

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.

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

import { Proton } from "@aws-sdk/client-proton";

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

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

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

// callbacks (not recommended).
client.listComponents(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).

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-proton 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)

AcceptEnvironmentAccountConnection

Command API Reference / Input / Output

CancelComponentDeployment

Command API Reference / Input / Output

CancelEnvironmentDeployment

Command API Reference / Input / Output

CancelServiceInstanceDeployment

Command API Reference / Input / Output

CancelServicePipelineDeployment

Command API Reference / Input / Output

CreateComponent

Command API Reference / Input / Output

CreateEnvironment

Command API Reference / Input / Output

CreateEnvironmentAccountConnection

Command API Reference / Input / Output

CreateEnvironmentTemplate

Command API Reference / Input / Output

CreateEnvironmentTemplateVersion

Command API Reference / Input / Output

CreateRepository

Command API Reference / Input / Output

CreateService

Command API Reference / Input / Output

CreateServiceInstance

Command API Reference / Input / Output

CreateServiceSyncConfig

Command API Reference / Input / Output

CreateServiceTemplate

Command API Reference / Input / Output

CreateServiceTemplateVersion

Command API Reference / Input / Output

CreateTemplateSyncConfig

Command API Reference / Input / Output

DeleteComponent

Command API Reference / Input / Output

DeleteDeployment

Command API Reference / Input / Output

DeleteEnvironment

Command API Reference / Input / Output

DeleteEnvironmentAccountConnection

Command API Reference / Input / Output

DeleteEnvironmentTemplate

Command API Reference / Input / Output

DeleteEnvironmentTemplateVersion

Command API Reference / Input / Output

DeleteRepository

Command API Reference / Input / Output

DeleteService

Command API Reference / Input / Output

DeleteServiceSyncConfig

Command API Reference / Input / Output

DeleteServiceTemplate

Command API Reference / Input / Output

DeleteServiceTemplateVersion

Command API Reference / Input / Output

DeleteTemplateSyncConfig

Command API Reference / Input / Output

GetAccountSettings

Command API Reference / Input / Output

GetComponent

Command API Reference / Input / Output

GetDeployment

Command API Reference / Input / Output

GetEnvironment

Command API Reference / Input / Output

GetEnvironmentAccountConnection

Command API Reference / Input / Output

GetEnvironmentTemplate

Command API Reference / Input / Output

GetEnvironmentTemplateVersion

Command API Reference / Input / Output

GetRepository

Command API Reference / Input / Output

GetRepositorySyncStatus

Command API Reference / Input / Output

GetResourcesSummary

Command API Reference / Input / Output

GetService

Command API Reference / Input / Output

GetServiceInstance

Command API Reference / Input / Output

GetServiceInstanceSyncStatus

Command API Reference / Input / Output

GetServiceSyncBlockerSummary

Command API Reference / Input / Output

GetServiceSyncConfig

Command API Reference / Input / Output

GetServiceTemplate

Command API Reference / Input / Output

GetServiceTemplateVersion

Command API Reference / Input / Output

GetTemplateSyncConfig

Command API Reference / Input / Output

GetTemplateSyncStatus

Command API Reference / Input / Output

ListComponentOutputs

Command API Reference / Input / Output

ListComponentProvisionedResources

Command API Reference / Input / Output

ListComponents

Command API Reference / Input / Output

ListDeployments

Command API Reference / Input / Output

ListEnvironmentAccountConnections

Command API Reference / Input / Output

ListEnvironmentOutputs

Command API Reference / Input / Output

ListEnvironmentProvisionedResources

Command API Reference / Input / Output

ListEnvironments

Command API Reference / Input / Output

ListEnvironmentTemplates

Command API Reference / Input / Output

ListEnvironmentTemplateVersions

Command API Reference / Input / Output

ListRepositories

Command API Reference / Input / Output

ListRepositorySyncDefinitions

Command API Reference / Input / Output

ListServiceInstanceOutputs

Command API Reference / Input / Output

ListServiceInstanceProvisionedResources

Command API Reference / Input / Output

ListServiceInstances

Command API Reference / Input / Output

ListServicePipelineOutputs

Command API Reference / Input / Output

ListServicePipelineProvisionedResources

Command API Reference / Input / Output

ListServices

Command API Reference / Input / Output

ListServiceTemplates

Command API Reference / Input / Output

ListServiceTemplateVersions

Command API Reference / Input / Output

ListTagsForResource

Command API Reference / Input / Output

NotifyResourceDeploymentStatusChange

Command API Reference / Input / Output

RejectEnvironmentAccountConnection

Command API Reference / Input / Output

TagResource

Command API Reference / Input / Output

UntagResource

Command API Reference / Input / Output

UpdateAccountSettings

Command API Reference / Input / Output

UpdateComponent

Command API Reference / Input / Output

UpdateEnvironment

Command API Reference / Input / Output

UpdateEnvironmentAccountConnection

Command API Reference / Input / Output

UpdateEnvironmentTemplate

Command API Reference / Input / Output

UpdateEnvironmentTemplateVersion

Command API Reference / Input / Output

UpdateService

Command API Reference / Input / Output

UpdateServiceInstance

Command API Reference / Input / Output

UpdateServicePipeline

Command API Reference / Input / Output

UpdateServiceSyncBlocker

Command API Reference / Input / Output

UpdateServiceSyncConfig

Command API Reference / Input / Output

UpdateServiceTemplate

Command API Reference / Input / Output

UpdateServiceTemplateVersion

Command API Reference / Input / Output

UpdateTemplateSyncConfig

Command API Reference / Input / Output

版本与发布记录

@aws-sdk/client-proton 共发布 660 个版本,首次发布于 2021/06/25;过去 12 个月发布了 220 个版本。

版本发布日期距今
3.1164.0latest2026/11/071 天前
3.1163.02026/11/062 天前
3.1162.02026/11/052 天前
3.1161.02026/10/318 天前
3.1160.02026/10/309 天前
3.1159.02026/10/2910 天前

关于 @aws-sdk/client-proton 的常见问题

@aws-sdk/client-proton 是什么?

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

如何安装 @aws-sdk/client-proton?

在项目目录运行 npm install @aws-sdk/client-proton,或使用 pnpm add / yarn add / bun add。

@aws-sdk/client-proton 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aws-sdk/client-proton 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@aws-sdk/client-proton 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@aws-sdk/client-proton 可以商用吗?

@aws-sdk/client-proton 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@aws-sdk/client-proton 的下载量有多少?

根据 npm 官方下载统计,@aws-sdk/client-proton 在 2026/10/08 – 2026/11/06 这 30 天内被下载 97,483 次,日均约 3,249 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aws-sdk/client-proton 还在维护吗?

最新版本 3.1164.0 发布于 2026/11/07(1 天前);至今共发布 660 个版本,其中过去 12 个月发布了 220 个;首次发布于 2021/06/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。