Class: AWS.CodeCommit

Inherits:
AWS.Service show all
Identifier:
codecommit
API Version:
2015-04-13
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Sending a Request Using CodeCommit

var codecommit = new AWS.CodeCommit();
codecommit.batchGetRepositories(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the CodeCommit object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var codecommit = new AWS.CodeCommit({apiVersion: '2015-04-13'});

You can also set the API version globally in AWS.config.apiVersions using the codecommit service identifier:

AWS.config.apiVersions = {
  codecommit: '2015-04-13',
  // other service API versions
};

var codecommit = new AWS.CodeCommit();

Version:

  • 2015-04-13

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.CodeCommit(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a CodeCommit object

var codecommit = new AWS.CodeCommit({apiVersion: '2015-04-13'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.CodeCommit.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.CodeCommit.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.CodeCommit.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and returns the amount of time to delay in milliseconds. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

batchGetRepositories(params = {}, callback) ⇒ AWS.Request

Returns information about one or more repositories.

Note: The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a web page could expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a web page.

Service Reference:

Examples:

Calling the batchGetRepositories operation

var params = {
  repositoryNames: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
codecommit.batchGetRepositories(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryNames — (Array<String>)

      The names of the repositories to get information about.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repositories — (Array<map>)

        A list of repositories returned by the batch get repositories operation.

        • accountId — (String)

          The ID of the AWS account associated with the repository.

        • repositoryId — (String)

          The ID of the repository.

        • repositoryName — (String)

          The repository's name.

        • repositoryDescription — (String)

          A comment or description about the repository.

        • defaultBranch — (String)

          The repository's default branch name.

        • lastModifiedDate — (Date)

          The date and time the repository was last modified, in timestamp format.

        • creationDate — (Date)

          The date and time the repository was created, in timestamp format.

        • cloneUrlHttp — (String)

          The URL to use for cloning the repository over HTTPS.

        • cloneUrlSsh — (String)

          The URL to use for cloning the repository over SSH.

        • Arn — (String)

          The Amazon Resource Name (ARN) of the repository.

      • repositoriesNotFound — (Array<String>)

        Returns a list of repository names for which information could not be found.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createBranch(params = {}, callback) ⇒ AWS.Request

Creates a new branch in a repository and points the branch to a commit.

Note: Calling the create branch operation does not set a repository's default branch. To do this, call the update default branch operation.

Service Reference:

Examples:

Calling the createBranch operation

var params = {
  branchName: 'STRING_VALUE', /* required */
  commitId: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.createBranch(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository in which you want to create the new branch.

    • branchName — (String)

      The name of the new branch to create.

    • commitId — (String)

      The ID of the commit to point the new branch to.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createRepository(params = {}, callback) ⇒ AWS.Request

Creates a new, empty repository.

Service Reference:

Examples:

Calling the createRepository operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  repositoryDescription: 'STRING_VALUE'
};
codecommit.createRepository(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the new repository to be created.

      Note: The repository name must be unique across the calling AWS account. In addition, repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. For a full description of the limits on repository names, see Limits in the AWS CodeCommit User Guide. The suffix ".git" is prohibited.
    • repositoryDescription — (String)

      A comment or description about the new repository.

      Note: The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a web page could expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a web page.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repositoryMetadata — (map)

        Information about the newly created repository.

        • accountId — (String)

          The ID of the AWS account associated with the repository.

        • repositoryId — (String)

          The ID of the repository.

        • repositoryName — (String)

          The repository's name.

        • repositoryDescription — (String)

          A comment or description about the repository.

        • defaultBranch — (String)

          The repository's default branch name.

        • lastModifiedDate — (Date)

          The date and time the repository was last modified, in timestamp format.

        • creationDate — (Date)

          The date and time the repository was created, in timestamp format.

        • cloneUrlHttp — (String)

          The URL to use for cloning the repository over HTTPS.

        • cloneUrlSsh — (String)

          The URL to use for cloning the repository over SSH.

        • Arn — (String)

          The Amazon Resource Name (ARN) of the repository.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteRepository(params = {}, callback) ⇒ AWS.Request

Deletes a repository. If a specified repository was already deleted, a null repository ID will be returned.

Deleting a repository also deletes all associated objects and metadata. After a repository is deleted, all future push calls to the deleted repository will fail.

Service Reference:

Examples:

Calling the deleteRepository operation

var params = {
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.deleteRepository(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repositoryId — (String)

        The ID of the repository that was deleted.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBlob(params = {}, callback) ⇒ AWS.Request

Returns the base-64 encoded content of an individual blob within a repository.

Service Reference:

Examples:

Calling the getBlob operation

var params = {
  blobId: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.getBlob(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository that contains the blob.

    • blobId — (String)

      The ID of the blob, which is its SHA-1 pointer.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • content — (Buffer, Typed Array, Blob, String)

        The content of the blob, usually a file.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBranch(params = {}, callback) ⇒ AWS.Request

Returns information about a repository branch, including its name and the last commit ID.

Service Reference:

Examples:

Calling the getBranch operation

var params = {
  branchName: 'STRING_VALUE',
  repositoryName: 'STRING_VALUE'
};
codecommit.getBranch(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository that contains the branch for which you want to retrieve information.

    • branchName — (String)

      The name of the branch for which you want to retrieve information.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • branch — (map)

        The name of the branch.

        • branchName — (String)

          The name of the branch.

        • commitId — (String)

          The ID of the last commit made to the branch.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getCommit(params = {}, callback) ⇒ AWS.Request

Returns information about a commit, including commit message and committer information.

Service Reference:

Examples:

Calling the getCommit operation

var params = {
  commitId: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.getCommit(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository to which the commit was made.

    • commitId — (String)

      The commit ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • commit — (map)

        A commit data type object that contains information about the specified commit.

        • treeId — (String)

          Tree information for the specified commit.

        • parents — (Array<String>)

          The parent list for the specified commit.

        • message — (String)

          The commit message associated with the specified commit.

        • author — (map)

          Information about the author of the specified commit. Information includes the date in timestamp format with GMT offset, the name of the author, and the email address for the author, as configured in Git.

          • name — (String)

            The name of the user who made the specified commit.

          • email — (String)

            The email address associated with the user who made the commit, if any.

          • date — (String)

            The date when the specified commit was pushed to the repository.

        • committer — (map)

          Information about the person who committed the specified commit, also known as the committer. Information includes the date in timestamp format with GMT offset, the name of the committer, and the email address for the committer, as configured in Git.

          For more information about the difference between an author and a committer in Git, see Viewing the Commit History in Pro Git by Scott Chacon and Ben Straub.

          • name — (String)

            The name of the user who made the specified commit.

          • email — (String)

            The email address associated with the user who made the commit, if any.

          • date — (String)

            The date when the specified commit was pushed to the repository.

        • additionalData — (String)

          Any additional data associated with the specified commit.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getDifferences(params = {}, callback) ⇒ AWS.Request

Returns information about the differences in a valid commit specifier (such as a branch, tag, HEAD, commit ID or other fully qualified reference). Results can be limited to a specified path.

Service Reference:

Examples:

Calling the getDifferences operation

var params = {
  afterCommitSpecifier: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  MaxResults: 0,
  NextToken: 'STRING_VALUE',
  afterPath: 'STRING_VALUE',
  beforeCommitSpecifier: 'STRING_VALUE',
  beforePath: 'STRING_VALUE'
};
codecommit.getDifferences(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository where you want to get differences.

    • beforeCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit. For example, the full commit ID. Optional. If not specified, all changes prior to the afterCommitSpecifier value will be shown. If you do not use beforeCommitSpecifier in your request, consider limiting the results with maxResults.

    • afterCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit.

    • beforePath — (String)

      The file path in which to check for differences. Limits the results to this path. Can also be used to specify the previous name of a directory or folder. If beforePath and afterPath are not specified, differences will be shown for all paths.

    • afterPath — (String)

      The file path in which to check differences. Limits the results to this path. Can also be used to specify the changed name of a directory or folder, if it has changed. If not specified, differences will be shown for all paths.

    • MaxResults — (Integer)

      A non-negative integer used to limit the number of returned results.

    • NextToken — (String)

      An enumeration token that when provided in a request, returns the next batch of the results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • differences — (Array<map>)

        A differences data type object that contains information about the differences, including whether the difference is added, modified, or deleted (A, D, M).

        • beforeBlob — (map)

          Information about a beforeBlob data type object, including the ID, the file mode permission code, and the path.

          • blobId — (String)

            The full ID of the blob.

          • path — (String)

            The path to the blob and any associated file name, if any.

          • mode — (String)

            The file mode permissions of the blob. File mode permission codes include:

            • 100644 indicates read/write

            • 100755 indicates read/write/execute

            • 160000 indicates a submodule

            • 120000 indicates a symlink

        • afterBlob — (map)

          Information about an afterBlob data type object, including the ID, the file mode permission code, and the path.

          • blobId — (String)

            The full ID of the blob.

          • path — (String)

            The path to the blob and any associated file name, if any.

          • mode — (String)

            The file mode permissions of the blob. File mode permission codes include:

            • 100644 indicates read/write

            • 100755 indicates read/write/execute

            • 160000 indicates a submodule

            • 120000 indicates a symlink

        • changeType — (String)

          Whether the change type of the difference is an addition (A), deletion (D), or modification (M).

          Possible values include:
          • "A"
          • "M"
          • "D"
      • NextToken — (String)

        An enumeration token that can be used in a request to return the next batch of the results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getRepository(params = {}, callback) ⇒ AWS.Request

Returns information about a repository.

Note: The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a web page could expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a web page.

Service Reference:

Examples:

Calling the getRepository operation

var params = {
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.getRepository(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository to get information about.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repositoryMetadata — (map)

        Information about the repository.

        • accountId — (String)

          The ID of the AWS account associated with the repository.

        • repositoryId — (String)

          The ID of the repository.

        • repositoryName — (String)

          The repository's name.

        • repositoryDescription — (String)

          A comment or description about the repository.

        • defaultBranch — (String)

          The repository's default branch name.

        • lastModifiedDate — (Date)

          The date and time the repository was last modified, in timestamp format.

        • creationDate — (Date)

          The date and time the repository was created, in timestamp format.

        • cloneUrlHttp — (String)

          The URL to use for cloning the repository over HTTPS.

        • cloneUrlSsh — (String)

          The URL to use for cloning the repository over SSH.

        • Arn — (String)

          The Amazon Resource Name (ARN) of the repository.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getRepositoryTriggers(params = {}, callback) ⇒ AWS.Request

Gets information about triggers configured for a repository.

Service Reference:

Examples:

Calling the getRepositoryTriggers operation

var params = {
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.getRepositoryTriggers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository for which the trigger is configured.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • configurationId — (String)

        The system-generated unique ID for the trigger.

      • triggers — (Array<map>)

        The JSON block of configuration information for each trigger.

        • namerequired — (String)

          The name of the trigger.

        • destinationArnrequired — (String)

          The ARN of the resource that is the target for a trigger. For example, the ARN of a topic in Amazon Simple Notification Service (SNS).

        • customData — (String)

          Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.

        • branches — (Array<String>)

          The branches that will be included in the trigger configuration. If no branches are specified, the trigger will apply to all branches.

        • eventsrequired — (Array<String>)

          The repository events that will cause the trigger to run actions in another service, such as sending a notification through Amazon Simple Notification Service (SNS).

          Note: The valid value "all" cannot be used with any other values.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listBranches(params = {}, callback) ⇒ AWS.Request

Gets information about one or more branches in a repository.

Service Reference:

Examples:

Calling the listBranches operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  nextToken: 'STRING_VALUE'
};
codecommit.listBranches(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository that contains the branches.

    • nextToken — (String)

      An enumeration token that allows the operation to batch the results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • branches — (Array<String>)

        The list of branch names.

      • nextToken — (String)

        An enumeration token that returns the batch of the results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listRepositories(params = {}, callback) ⇒ AWS.Request

Gets information about one or more repositories.

Service Reference:

Examples:

Calling the listRepositories operation

var params = {
  nextToken: 'STRING_VALUE',
  order: ascending | descending,
  sortBy: repositoryName | lastModifiedDate
};
codecommit.listRepositories(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • nextToken — (String)

      An enumeration token that allows the operation to batch the results of the operation. Batch sizes are 1,000 for list repository operations. When the client sends the token back to AWS CodeCommit, another page of 1,000 records is retrieved.

    • sortBy — (String)

      The criteria used to sort the results of a list repositories operation.

      Possible values include:
      • "repositoryName"
      • "lastModifiedDate"
    • order — (String)

      The order in which to sort the results of a list repositories operation.

      Possible values include:
      • "ascending"
      • "descending"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repositories — (Array<map>)

        Lists the repositories called by the list repositories operation.

        • repositoryName — (String)

          The name associated with the repository.

        • repositoryId — (String)

          The ID associated with the repository.

      • nextToken — (String)

        An enumeration token that allows the operation to batch the results of the operation. Batch sizes are 1,000 for list repository operations. When the client sends the token back to AWS CodeCommit, another page of 1,000 records is retrieved.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putRepositoryTriggers(params = {}, callback) ⇒ AWS.Request

Replaces all triggers for a repository. This can be used to create or delete triggers.

Service Reference:

Examples:

Calling the putRepositoryTriggers operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  triggers: [ /* required */
    {
      destinationArn: 'STRING_VALUE', /* required */
      events: [ /* required */
        all | updateReference | createReference | deleteReference,
        /* more items */
      ],
      name: 'STRING_VALUE', /* required */
      branches: [
        'STRING_VALUE',
        /* more items */
      ],
      customData: 'STRING_VALUE'
    },
    /* more items */
  ]
};
codecommit.putRepositoryTriggers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository where you want to create or update the trigger.

    • triggers — (Array<map>)

      The JSON block of configuration information for each trigger.

      • namerequired — (String)

        The name of the trigger.

      • destinationArnrequired — (String)

        The ARN of the resource that is the target for a trigger. For example, the ARN of a topic in Amazon Simple Notification Service (SNS).

      • customData — (String)

        Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.

      • branches — (Array<String>)

        The branches that will be included in the trigger configuration. If no branches are specified, the trigger will apply to all branches.

      • eventsrequired — (Array<String>)

        The repository events that will cause the trigger to run actions in another service, such as sending a notification through Amazon Simple Notification Service (SNS).

        Note: The valid value "all" cannot be used with any other values.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • configurationId — (String)

        The system-generated unique ID for the create or update operation.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

testRepositoryTriggers(params = {}, callback) ⇒ AWS.Request

Tests the functionality of repository triggers by sending information to the trigger target. If real data is available in the repository, the test will send data from the last commit. If no data is available, sample data will be generated.

Service Reference:

Examples:

Calling the testRepositoryTriggers operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  triggers: [ /* required */
    {
      destinationArn: 'STRING_VALUE', /* required */
      events: [ /* required */
        all | updateReference | createReference | deleteReference,
        /* more items */
      ],
      name: 'STRING_VALUE', /* required */
      branches: [
        'STRING_VALUE',
        /* more items */
      ],
      customData: 'STRING_VALUE'
    },
    /* more items */
  ]
};
codecommit.testRepositoryTriggers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository in which to test the triggers.

    • triggers — (Array<map>)

      The list of triggers to test.

      • namerequired — (String)

        The name of the trigger.

      • destinationArnrequired — (String)

        The ARN of the resource that is the target for a trigger. For example, the ARN of a topic in Amazon Simple Notification Service (SNS).

      • customData — (String)

        Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.

      • branches — (Array<String>)

        The branches that will be included in the trigger configuration. If no branches are specified, the trigger will apply to all branches.

      • eventsrequired — (Array<String>)

        The repository events that will cause the trigger to run actions in another service, such as sending a notification through Amazon Simple Notification Service (SNS).

        Note: The valid value "all" cannot be used with any other values.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • successfulExecutions — (Array<String>)

        The list of triggers that were successfully tested. This list provides the names of the triggers that were successfully tested, separated by commas.

      • failedExecutions — (Array<map>)

        The list of triggers that were not able to be tested. This list provides the names of the triggers that could not be tested, separated by commas.

        • trigger — (String)

          The name of the trigger that did not run.

        • failureMessage — (String)

          Additional message information about the trigger that did not run.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateDefaultBranch(params = {}, callback) ⇒ AWS.Request

Sets or changes the default branch name for the specified repository.

Note: If you use this operation to change the default branch name to the current default branch name, a success message is returned even though the default branch did not change.

Service Reference:

Examples:

Calling the updateDefaultBranch operation

var params = {
  defaultBranchName: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.updateDefaultBranch(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository to set or change the default branch for.

    • defaultBranchName — (String)

      The name of the branch to set as the default.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateRepositoryDescription(params = {}, callback) ⇒ AWS.Request

Sets or changes the comment or description for a repository.

Note: The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a web page could expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a web page.

Service Reference:

Examples:

Calling the updateRepositoryDescription operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  repositoryDescription: 'STRING_VALUE'
};
codecommit.updateRepositoryDescription(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository to set or change the comment or description for.

    • repositoryDescription — (String)

      The new comment or description for the specified repository. Repository descriptions are limited to 1,000 characters.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateRepositoryName(params = {}, callback) ⇒ AWS.Request

Renames a repository. The repository name must be unique across the calling AWS account. In addition, repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. The suffix ".git" is prohibited. For a full description of the limits on repository names, see Limits in the AWS CodeCommit User Guide.

Service Reference:

Examples:

Calling the updateRepositoryName operation

var params = {
  newName: 'STRING_VALUE', /* required */
  oldName: 'STRING_VALUE' /* required */
};
codecommit.updateRepositoryName(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • oldName — (String)

      The existing name of the repository.

    • newName — (String)

      The new name for the repository.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.