This package has been deprecated

Author message:

The package @aws-sdk/client-codepipeline-node has been renamed to @aws-sdk/client-codepipeline. Please install the renamed package.

@aws-sdk/client-codepipeline-node
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-preview.2 • Public • Published

@aws-sdk/client-codepipeline-node

NPM version NPM downloads

Description

AWS CodePipeline

Overview

This is the AWS CodePipeline API Reference. This guide provides descriptions of the actions and data types for AWS CodePipeline. Some functionality for your pipeline is only configurable through the API. For additional information, see the AWS CodePipeline User Guide.

You can use the AWS CodePipeline API to work with pipelines, stages, actions, and transitions, as described below.

Pipelines are models of automated release processes. Each pipeline is uniquely named, and consists of stages, actions, and transitions.

You can work with pipelines by calling:

  • CreatePipeline, which creates a uniquely-named pipeline.

  • DeletePipeline, which deletes the specified pipeline.

  • GetPipeline, which returns information about the pipeline structure and pipeline metadata, including the pipeline Amazon Resource Name (ARN).

  • GetPipelineExecution, which returns information about a specific execution of a pipeline.

  • GetPipelineState, which returns information about the current state of the stages and actions of a pipeline.

  • ListActionExecutions, which returns action-level details for past executions. The details include full stage and action-level details, including individual action duration, status, any errors which occurred during the execution, and input and output artifact location details.

  • ListPipelines, which gets a summary of all of the pipelines associated with your account.

  • ListPipelineExecutions, which gets a summary of the most recent executions for a pipeline.

  • StartPipelineExecution, which runs the the most recent revision of an artifact through the pipeline.

  • UpdatePipeline, which updates a pipeline with edits or changes to the structure of the pipeline.

Pipelines include stages. Each stage contains one or more actions that must complete before the next stage begins. A stage will result in success or failure. If a stage fails, then the pipeline stops at that stage and will remain stopped until either a new version of an artifact appears in the source location, or a user takes action to re-run the most recent artifact through the pipeline. You can call GetPipelineState, which displays the status of a pipeline, including the status of stages in the pipeline, or GetPipeline, which returns the entire structure of the pipeline, including the stages of that pipeline. For more information about the structure of stages and actions, also refer to the AWS CodePipeline Pipeline Structure Reference.

Pipeline stages include actions, which are categorized into categories such as source or build actions performed within a stage of a pipeline. For example, you can use a source action to import artifacts into a pipeline from a source such as Amazon S3. Like stages, you do not work with actions directly in most cases, but you do define and interact with actions when working with pipeline operations such as CreatePipeline and GetPipelineState. Valid action categories are:

  • Source

  • Build

  • Test

  • Deploy

  • Approval

  • Invoke

Pipelines also include transitions, which allow the transition of artifacts from one stage to the next in a pipeline after the actions in one stage complete.

You can work with transitions by calling:

  • DisableStageTransition, which prevents artifacts from transitioning to the next stage in a pipeline.

  • EnableStageTransition, which enables transition of artifacts between stages in a pipeline.

Using the API to integrate with AWS CodePipeline

For third-party integrators or developers who want to create their own integrations with AWS CodePipeline, the expected sequence varies from the standard API user. In order to integrate with AWS CodePipeline, developers will need to work with the following items:

Jobs, which are instances of an action. For example, a job for a source action might import a revision of an artifact from a source.

You can work with jobs by calling:

  • AcknowledgeJob, which confirms whether a job worker has received the specified job,

  • GetJobDetails, which returns the details of a job,

  • PollForJobs, which determines whether there are any jobs to act upon,

  • PutJobFailureResult, which provides details of a job failure, and

  • PutJobSuccessResult, which provides details of a job success.

Third party jobs, which are instances of an action created by a partner action and integrated into AWS CodePipeline. Partner actions are created by members of the AWS Partner Network.

You can work with third party jobs by calling:

  • AcknowledgeThirdPartyJob, which confirms whether a job worker has received the specified job,

  • GetThirdPartyJobDetails, which requests the details of a job for a partner action,

  • PollForThirdPartyJobs, which determines whether there are any jobs to act upon,

  • PutThirdPartyJobFailureResult, which provides details of a job failure, and

  • PutThirdPartyJobSuccessResult, which provides details of a job success.

Installing

To install the this package using NPM, simply type the following into a terminal window:

npm install @aws-sdk/client-codepipeline-node

Getting Started

Import

The AWS SDK is modulized by clients and commands in CommonJS modules. To send a request, you only need to import the client(CodePipelineClient) and the commands you need, for example AcknowledgeJobCommand:

//JavaScript
const {
  CodePipelineClient
} = require("@aws-sdk/client-codepipeline-node/CodePipelineClient");
const {
  AcknowledgeJobCommand
} = require("@aws-sdk/client-codepipeline-node/commands/AcknowledgeJobCommand");
//TypeScript
import { CodePipelineClient } from "@aws-sdk/client-codepipeline-node/CodePipelineClient";
import { AcknowledgeJobCommand } from "@aws-sdk/client-codepipeline-node/commands/AcknowledgeJobCommand";

Usage

To send a request, you:

  • Initiate client with configuration (e.g. credentials, region). For more information you can refer to the API reference.
  • Initiate command with input parameters.
  • Call send operation on client with command object as input.
  • If you are using a custom http handler, you may call destroy() to close open connections.
const codePipeline = new CodePipelineClient({region: 'region'});
//clients can be shared by different commands
const params = {
  jobId: /**a string value*/,
  nonce: /**a string value*/,
};
const acknowledgeJobCommand = new AcknowledgeJobCommand(params);
codePipeline.send(acknowledgeJobCommand).then(data => {
    // do something
}).catch(error => {
    // error handling
})

In addition to using promises, there are 2 other ways to send a request:

// async/await
try {
  const data = await codePipeline.send(acknowledgeJobCommand);
  // do something
} catch (error) {
  // error handling
}
// callback
codePipeline.send(acknowledgeJobCommand, (err, data) => {
  //do something
});

The SDK can also send requests using the simplified callback style from version 2 of the SDK.

import * as AWS from "@aws-sdk/@aws-sdk/client-codepipeline-node/CodePipeline";
const codePipeline = new AWS.CodePipeline({ region: "region" });
codePipeline.acknowledgeJob(params, (err, data) => {
  //do something
});

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 codePipeline.send(acknowledgeJobCommand);
  // do something
} catch (error) {
  const metadata = error.$metadata;
  console.log(
    `requestId: ${metadata.requestId}
cfId: ${metadata.cfId}
extendedRequestId: ${metadata.extendedRequestId}`
  );
  /*
The keys within exceptions are also parsed. You can access them by specifying exception names:
    if(error.name === 'SomeServiceException') {
        const value = error.specialKeyInException;
    }
*/
}

Getting Help

Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests and have limited bandwidth to address them.

  • Ask a question on StackOverflow and tag it with aws-sdk-js
  • Come join the AWS JavaScript community on gitter
  • If it turns out that you may have found a bug, please open an issue

Contributing

This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/@aws-sdk/client-codepipeline-node' package is updated. To contribute to SDK you can checkout our code generator package.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Readme

Keywords

none

Package Sidebar

Install

npm i @aws-sdk/client-codepipeline-node

Weekly Downloads

0

Version

0.1.0-preview.2

License

Apache-2.0

Unpacked Size

726 kB

Total Files

1382

Last publish

Collaborators

  • mattsb42-aws
  • kuhe
  • amzn-oss
  • aws-sdk-bot
  • trivikr-aws