AWS SDK for JavaScript Proton Client for Node.js, Browser and React Native
npm install @aws-sdk/client-protonAWS 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 anIdempotentParameterMismatch 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 isDELETE_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
npm install @aws-sdk/client-protonyarn add @aws-sdk/client-protonpnpm add @aws-sdk/client-protonThe 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:
``js`
// ES5 example
const { ProtonClient, ListComponentsCommand } = require("@aws-sdk/client-proton");
`ts`
// ES6+ example
import { ProtonClient, ListComponentsCommand } from "@aws-sdk/client-proton";
To send a request, you:
- Initiate client with configuration (e.g. credentials, region).
- Initiate command with input parameters.
- Call send operation on client with command object as input.destroy()
- If you are using a custom http handler, you may call to close open connections.
`js
// a client can be shared by different commands.
const client = new ProtonClient({ region: "REGION" });
const params = { /* input parameters / };
const command = new ListComponentsCommand(params);
`
#### Async/await
We recommend using 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.
}
Async-await is clean, concise, intuitive, easy to debug and has better error handling
as compared to using Promise chains or callbacks.
#### Promises
You can also use Promise chaining
to execute send operation.
`js`
client.send(command).then(
(data) => {
// process data.
},
(error) => {
// error handling.
}
);
Promises can also be called using .catch() and .finally() as follows:
`js`
client
.send(command)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
})
.finally(() => {
// finally.
});
#### Callbacks
We do not recommend using callbacks because of callback hell,
but they are supported by the send operation.
`js`
// callbacks.
client.send(command, (err, data) => {
// process err and data.
});
#### v2 compatible style
The client can also send requests using v2 compatible style.
However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post
on modular packages in AWS SDK for JavaScript
`ts
import * as AWS from "@aws-sdk/client-proton";
const client = new AWS.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.
client.listComponents(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).
`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;
* }
*/
}
Please use these community resources for getting help.
We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
- Visit Developer Guide
or API Reference.
- Check out the blog posts tagged with aws-sdk-js
on AWS Developer Blog.
- Ask a question on StackOverflow and tag it with aws-sdk-js.
- Join the AWS JavaScript community on gitter.
- If it turns out that you may have found a bug, please open an issue.
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-proton` 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.
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