clients/client-codebuild/README.md
AWS SDK for JavaScript CodeBuild Client for Node.js, Browser and React Native.
<fullname>CodeBuild</fullname>
<p>CodeBuild is a fully managed build service in the cloud. CodeBuild compiles your source code, runs unit tests, and produces artifacts that are ready to deploy. CodeBuild eliminates the need to provision, manage, and scale your own build servers. It provides prepackaged build environments for the most popular programming languages and build tools, such as Apache Maven, Gradle, and more. You can also fully customize build environments in CodeBuild to use your own build tools. CodeBuild scales automatically to meet peak build requests. You pay only for the build time you consume. For more information about CodeBuild, see the <i> <a href="https://docs.aws.amazon.com/codebuild/latest/userguide/welcome.html">CodeBuild User Guide</a>.</i> </p>To install this package, use the CLI of your favorite package manager:
npm install @aws-sdk/client-codebuildyarn add @aws-sdk/client-codebuildpnpm add @aws-sdk/client-codebuildThe AWS SDK is modulized by clients and commands.
To send a request, you only need to import the CodeBuildClient and
the commands you need, for example ListBuildsCommand:
// ES5 example
const { CodeBuildClient, ListBuildsCommand } = require("@aws-sdk/client-codebuild");
// ES6+ example
import { CodeBuildClient, ListBuildsCommand } from "@aws-sdk/client-codebuild";
To send a request:
send operation on the client, providing the command object as input.const client = new CodeBuildClient({ region: "REGION" });
const params = { /** input parameters */ };
const command = new ListBuildsCommand(params);
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.
}
You can also use Promise chaining.
client
.send(command)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
})
.finally(() => {
// finally.
});
The aggregated client class is exported from the same package, but without the "Client" suffix.
CodeBuild extends CodeBuildClient 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 (CodeBuildClient).
More details are in the blog post on
modular packages in AWS SDK for JavaScript.
import { CodeBuild } from "@aws-sdk/client-codebuild";
const client = new CodeBuild({ region: "REGION" });
// async/await.
try {
const data = await client.listBuilds(params);
// process data.
} catch (error) {
// error handling.
}
// Promises.
client
.listBuilds(params)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
});
// callbacks (not recommended).
client.listBuilds(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).
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.
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.
aws-sdk-js
on AWS Developer Blog.aws-sdk-js.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-codebuild 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.
Command API Reference / Input / Output
</details> <details> <summary> BatchGetBuildBatches </summary>Command API Reference / Input / Output
</details> <details> <summary> BatchGetBuilds </summary>Command API Reference / Input / Output
</details> <details> <summary> BatchGetCommandExecutions </summary>Command API Reference / Input / Output
</details> <details> <summary> BatchGetFleets </summary>Command API Reference / Input / Output
</details> <details> <summary> BatchGetProjects </summary>Command API Reference / Input / Output
</details> <details> <summary> BatchGetReportGroups </summary>Command API Reference / Input / Output
</details> <details> <summary> BatchGetReports </summary>Command API Reference / Input / Output
</details> <details> <summary> BatchGetSandboxes </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateFleet </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateProject </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateReportGroup </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateWebhook </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteBuildBatch </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteFleet </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteProject </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteReport </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteReportGroup </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteResourcePolicy </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteSourceCredentials </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteWebhook </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeCodeCoverages </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeTestCases </summary>Command API Reference / Input / Output
</details> <details> <summary> GetReportGroupTrend </summary>Command API Reference / Input / Output
</details> <details> <summary> GetResourcePolicy </summary>Command API Reference / Input / Output
</details> <details> <summary> ImportSourceCredentials </summary>Command API Reference / Input / Output
</details> <details> <summary> InvalidateProjectCache </summary>Command API Reference / Input / Output
</details> <details> <summary> ListBuildBatches </summary>Command API Reference / Input / Output
</details> <details> <summary> ListBuildBatchesForProject </summary>Command API Reference / Input / Output
</details> <details> <summary> ListBuilds </summary>Command API Reference / Input / Output
</details> <details> <summary> ListBuildsForProject </summary>Command API Reference / Input / Output
</details> <details> <summary> ListCommandExecutionsForSandbox </summary>Command API Reference / Input / Output
</details> <details> <summary> ListCuratedEnvironmentImages </summary>Command API Reference / Input / Output
</details> <details> <summary> ListFleets </summary>Command API Reference / Input / Output
</details> <details> <summary> ListProjects </summary>Command API Reference / Input / Output
</details> <details> <summary> ListReportGroups </summary>Command API Reference / Input / Output
</details> <details> <summary> ListReports </summary>Command API Reference / Input / Output
</details> <details> <summary> ListReportsForReportGroup </summary>Command API Reference / Input / Output
</details> <details> <summary> ListSandboxes </summary>Command API Reference / Input / Output
</details> <details> <summary> ListSandboxesForProject </summary>Command API Reference / Input / Output
</details> <details> <summary> ListSharedProjects </summary>Command API Reference / Input / Output
</details> <details> <summary> ListSharedReportGroups </summary>Command API Reference / Input / Output
</details> <details> <summary> ListSourceCredentials </summary>Command API Reference / Input / Output
</details> <details> <summary> PutResourcePolicy </summary>Command API Reference / Input / Output
</details> <details> <summary> RetryBuild </summary>Command API Reference / Input / Output
</details> <details> <summary> RetryBuildBatch </summary>Command API Reference / Input / Output
</details> <details> <summary> StartBuild </summary>Command API Reference / Input / Output
</details> <details> <summary> StartBuildBatch </summary>Command API Reference / Input / Output
</details> <details> <summary> StartCommandExecution </summary>Command API Reference / Input / Output
</details> <details> <summary> StartSandbox </summary>Command API Reference / Input / Output
</details> <details> <summary> StartSandboxConnection </summary>Command API Reference / Input / Output
</details> <details> <summary> StopBuild </summary>Command API Reference / Input / Output
</details> <details> <summary> StopBuildBatch </summary>Command API Reference / Input / Output
</details> <details> <summary> StopSandbox </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateFleet </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateProject </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateProjectVisibility </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateReportGroup </summary> </details> <details> <summary> UpdateWebhook </summary> </details>