You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::CodePipeline::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::CodePipeline::Client
- Defined in:
- (unknown)
Overview
An API client for AWS CodePipeline. To construct a client, you need to configure a :region
and :credentials
.
codepipeline = Aws::CodePipeline::Client.new(
region: region_name,
credentials: credentials,
# ...
)
See #initialize for a full list of supported configuration options.
Region
You can configure a default region in the following locations:
ENV['AWS_REGION']
Aws.config[:region]
Go here for a list of supported regions.
Credentials
Default credentials are loaded automatically from the following locations:
ENV['AWS_ACCESS_KEY_ID']
andENV['AWS_SECRET_ACCESS_KEY']
Aws.config[:credentials]
- The shared credentials ini file at
~/.aws/credentials
(more information) - From an instance profile when running on EC2
You can also construct a credentials object from one of the following classes:
Alternatively, you configure credentials with :access_key_id
and
:secret_access_key
:
# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))
Aws::CodePipeline::Client.new(
access_key_id: creds['access_key_id'],
secret_access_key: creds['secret_access_key']
)
Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
Constructor collapse
-
#initialize(options = {}) ⇒ Aws::CodePipeline::Client
constructor
Constructs an API client.
API Operations collapse
-
#acknowledge_job(options = {}) ⇒ Types::AcknowledgeJobOutput
Returns information about a specified job and whether that job has been received by the job worker.
-
#acknowledge_third_party_job(options = {}) ⇒ Types::AcknowledgeThirdPartyJobOutput
Confirms a job worker has received the specified job.
-
#create_custom_action_type(options = {}) ⇒ Types::CreateCustomActionTypeOutput
Creates a new custom action that can be used in all pipelines associated with the AWS account.
-
#create_pipeline(options = {}) ⇒ Types::CreatePipelineOutput
Creates a pipeline.
In the pipeline structure, you must include either
artifactStore
orartifactStores
in your pipeline, but you cannot use both. -
#delete_custom_action_type(options = {}) ⇒ Struct
Marks a custom action as deleted.
-
#delete_pipeline(options = {}) ⇒ Struct
Deletes the specified pipeline.
.
-
#delete_webhook(options = {}) ⇒ Struct
Deletes a previously created webhook by name.
-
#deregister_webhook_with_third_party(options = {}) ⇒ Struct
Removes the connection between the webhook that was created by CodePipeline and the external tool with events to be detected.
-
#disable_stage_transition(options = {}) ⇒ Struct
Prevents artifacts in a pipeline from transitioning to the next stage in the pipeline.
.
-
#enable_stage_transition(options = {}) ⇒ Struct
Enables artifacts in a pipeline to transition to a stage in a pipeline.
.
-
#get_job_details(options = {}) ⇒ Types::GetJobDetailsOutput
Returns information about a job.
-
#get_pipeline(options = {}) ⇒ Types::GetPipelineOutput
Returns the metadata, structure, stages, and actions of a pipeline.
-
#get_pipeline_execution(options = {}) ⇒ Types::GetPipelineExecutionOutput
Returns information about an execution of a pipeline, including details about artifacts, the pipeline execution ID, and the name, version, and status of the pipeline.
.
-
#get_pipeline_state(options = {}) ⇒ Types::GetPipelineStateOutput
Returns information about the state of a pipeline, including the stages and actions.
Values returned in the
revisionId
andrevisionUrl
fields indicate the source revision information, such as the commit ID, for the current state. -
#get_third_party_job_details(options = {}) ⇒ Types::GetThirdPartyJobDetailsOutput
Requests the details of a job for a third party action.
-
#list_action_executions(options = {}) ⇒ Types::ListActionExecutionsOutput
Lists the action executions that have occurred in a pipeline.
.
-
#list_action_types(options = {}) ⇒ Types::ListActionTypesOutput
Gets a summary of all AWS CodePipeline action types associated with your account.
.
-
#list_pipeline_executions(options = {}) ⇒ Types::ListPipelineExecutionsOutput
Gets a summary of the most recent executions for a pipeline.
.
-
#list_pipelines(options = {}) ⇒ Types::ListPipelinesOutput
Gets a summary of all of the pipelines associated with your account.
.
-
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceOutput
Gets the set of key-value pairs (metadata) that are used to manage the resource.
.
-
#list_webhooks(options = {}) ⇒ Types::ListWebhooksOutput
Gets a listing of all the webhooks in this AWS Region for this account.
-
#poll_for_jobs(options = {}) ⇒ Types::PollForJobsOutput
Returns information about any jobs for AWS CodePipeline to act on.
-
#poll_for_third_party_jobs(options = {}) ⇒ Types::PollForThirdPartyJobsOutput
Determines whether there are any third party jobs for a job worker to act on.
-
#put_action_revision(options = {}) ⇒ Types::PutActionRevisionOutput
Provides information to AWS CodePipeline about new revisions to a source.
.
-
#put_approval_result(options = {}) ⇒ Types::PutApprovalResultOutput
Provides the response to a manual approval request to AWS CodePipeline.
-
#put_job_failure_result(options = {}) ⇒ Struct
Represents the failure of a job as returned to the pipeline by a job worker.
-
#put_job_success_result(options = {}) ⇒ Struct
Represents the success of a job as returned to the pipeline by a job worker.
-
#put_third_party_job_failure_result(options = {}) ⇒ Struct
Represents the failure of a third party job as returned to the pipeline by a job worker.
-
#put_third_party_job_success_result(options = {}) ⇒ Struct
Represents the success of a third party job as returned to the pipeline by a job worker.
-
#put_webhook(options = {}) ⇒ Types::PutWebhookOutput
Defines a webhook and returns a unique webhook URL generated by CodePipeline.
-
#register_webhook_with_third_party(options = {}) ⇒ Struct
Configures a connection between the webhook that was created and the external tool with events to be detected.
.
-
#retry_stage_execution(options = {}) ⇒ Types::RetryStageExecutionOutput
Resumes the pipeline execution by retrying the last failed actions in a stage.
-
#start_pipeline_execution(options = {}) ⇒ Types::StartPipelineExecutionOutput
Starts the specified pipeline.
-
#stop_pipeline_execution(options = {}) ⇒ Types::StopPipelineExecutionOutput
Stops the specified pipeline execution.
-
#tag_resource(options = {}) ⇒ Struct
Adds to or modifies the tags of the given resource.
-
#untag_resource(options = {}) ⇒ Struct
Removes tags from an AWS resource.
.
-
#update_pipeline(options = {}) ⇒ Types::UpdatePipelineOutput
Updates a specified pipeline with edits or changes to its structure.
Instance Method Summary collapse
-
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
-
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters.
Methods inherited from Seahorse::Client::Base
add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options = {}) ⇒ Aws::CodePipeline::Client
Constructs an API client.
Instance Method Details
#acknowledge_job(options = {}) ⇒ Types::AcknowledgeJobOutput
Returns information about a specified job and whether that job has been received by the job worker. Used for custom actions only.
#acknowledge_third_party_job(options = {}) ⇒ Types::AcknowledgeThirdPartyJobOutput
Confirms a job worker has received the specified job. Used for partner actions only.
#create_custom_action_type(options = {}) ⇒ Types::CreateCustomActionTypeOutput
Creates a new custom action that can be used in all pipelines associated with the AWS account. Only used for custom actions.
#create_pipeline(options = {}) ⇒ Types::CreatePipelineOutput
Creates a pipeline.
In the pipeline structure, you must include either artifactStore
or artifactStores
in your pipeline, but you cannot use both. If you create a cross-region action in your pipeline, you must use artifactStores
.
#delete_custom_action_type(options = {}) ⇒ Struct
Marks a custom action as deleted. PollForJobs
for the custom action fails after the action is marked for deletion. Used for custom actions only.
To re-create a custom action after it has been deleted you must use a string in the version field that has never been used before. This string can be an incremented version number, for example. To restore a deleted custom action, use a JSON file that is identical to the deleted action, including the original string in the version field.
#delete_pipeline(options = {}) ⇒ Struct
Deletes the specified pipeline.
#delete_webhook(options = {}) ⇒ Struct
Deletes a previously created webhook by name. Deleting the webhook stops AWS CodePipeline from starting a pipeline every time an external event occurs. The API returns successfully when trying to delete a webhook that is already deleted. If a deleted webhook is re-created by calling PutWebhook with the same name, it will have a different URL.
#deregister_webhook_with_third_party(options = {}) ⇒ Struct
Removes the connection between the webhook that was created by CodePipeline and the external tool with events to be detected. Currently supported only for webhooks that target an action type of GitHub.
#disable_stage_transition(options = {}) ⇒ Struct
Prevents artifacts in a pipeline from transitioning to the next stage in the pipeline.
#enable_stage_transition(options = {}) ⇒ Struct
Enables artifacts in a pipeline to transition to a stage in a pipeline.
#get_job_details(options = {}) ⇒ Types::GetJobDetailsOutput
Returns information about a job. Used for custom actions only.
When this API is called, AWS CodePipeline returns temporary credentials for the S3 bucket used to store artifacts for the pipeline, if the action requires access to that S3 bucket for input or output artifacts. This API also returns any secret values defined for the action.
#get_pipeline(options = {}) ⇒ Types::GetPipelineOutput
Returns the metadata, structure, stages, and actions of a pipeline. Can be used to return the entire structure of a pipeline in JSON format, which can then be modified and used to update the pipeline structure with UpdatePipeline.
#get_pipeline_execution(options = {}) ⇒ Types::GetPipelineExecutionOutput
Returns information about an execution of a pipeline, including details about artifacts, the pipeline execution ID, and the name, version, and status of the pipeline.
#get_pipeline_state(options = {}) ⇒ Types::GetPipelineStateOutput
Returns information about the state of a pipeline, including the stages and actions.
Values returned in the revisionId
and revisionUrl
fields indicate the source revision information, such as the commit ID, for the current state.
#get_third_party_job_details(options = {}) ⇒ Types::GetThirdPartyJobDetailsOutput
Requests the details of a job for a third party action. Used for partner actions only.
When this API is called, AWS CodePipeline returns temporary credentials for the S3 bucket used to store artifacts for the pipeline, if the action requires access to that S3 bucket for input or output artifacts. This API also returns any secret values defined for the action.
#list_action_executions(options = {}) ⇒ Types::ListActionExecutionsOutput
Lists the action executions that have occurred in a pipeline.
#list_action_types(options = {}) ⇒ Types::ListActionTypesOutput
Gets a summary of all AWS CodePipeline action types associated with your account.
#list_pipeline_executions(options = {}) ⇒ Types::ListPipelineExecutionsOutput
Gets a summary of the most recent executions for a pipeline.
#list_pipelines(options = {}) ⇒ Types::ListPipelinesOutput
Gets a summary of all of the pipelines associated with your account.
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceOutput
Gets the set of key-value pairs (metadata) that are used to manage the resource.
#list_webhooks(options = {}) ⇒ Types::ListWebhooksOutput
Gets a listing of all the webhooks in this AWS Region for this account. The output lists all webhooks and includes the webhook URL and ARN and the configuration for each webhook.
#poll_for_jobs(options = {}) ⇒ Types::PollForJobsOutput
Returns information about any jobs for AWS CodePipeline to act on. PollForJobs
is valid only for action types with "Custom" in the owner field. If the action type contains "AWS" or "ThirdParty" in the owner field, the PollForJobs
action returns an error.
When this API is called, AWS CodePipeline returns temporary credentials for the S3 bucket used to store artifacts for the pipeline, if the action requires access to that S3 bucket for input or output artifacts. This API also returns any secret values defined for the action.
#poll_for_third_party_jobs(options = {}) ⇒ Types::PollForThirdPartyJobsOutput
Determines whether there are any third party jobs for a job worker to act on. Used for partner actions only.
When this API is called, AWS CodePipeline returns temporary credentials for the S3 bucket used to store artifacts for the pipeline, if the action requires access to that S3 bucket for input or output artifacts.
#put_action_revision(options = {}) ⇒ Types::PutActionRevisionOutput
Provides information to AWS CodePipeline about new revisions to a source.
#put_approval_result(options = {}) ⇒ Types::PutApprovalResultOutput
Provides the response to a manual approval request to AWS CodePipeline. Valid responses include Approved and Rejected.
#put_job_failure_result(options = {}) ⇒ Struct
Represents the failure of a job as returned to the pipeline by a job worker. Used for custom actions only.
#put_job_success_result(options = {}) ⇒ Struct
Represents the success of a job as returned to the pipeline by a job worker. Used for custom actions only.
#put_third_party_job_failure_result(options = {}) ⇒ Struct
Represents the failure of a third party job as returned to the pipeline by a job worker. Used for partner actions only.
#put_third_party_job_success_result(options = {}) ⇒ Struct
Represents the success of a third party job as returned to the pipeline by a job worker. Used for partner actions only.
#put_webhook(options = {}) ⇒ Types::PutWebhookOutput
Defines a webhook and returns a unique webhook URL generated by CodePipeline. This URL can be supplied to third party source hosting providers to call every time there's a code change. When CodePipeline receives a POST request on this URL, the pipeline defined in the webhook is started as long as the POST request satisfied the authentication and filtering requirements supplied when defining the webhook. RegisterWebhookWithThirdParty and DeregisterWebhookWithThirdParty APIs can be used to automatically configure supported third parties to call the generated webhook URL.
#register_webhook_with_third_party(options = {}) ⇒ Struct
Configures a connection between the webhook that was created and the external tool with events to be detected.
#retry_stage_execution(options = {}) ⇒ Types::RetryStageExecutionOutput
Resumes the pipeline execution by retrying the last failed actions in a stage. You can retry a stage immediately if any of the actions in the stage fail. When you retry, all actions that are still in progress continue working, and failed actions are triggered again.
#start_pipeline_execution(options = {}) ⇒ Types::StartPipelineExecutionOutput
Starts the specified pipeline. Specifically, it begins processing the latest commit to the source location specified as part of the pipeline.
#stop_pipeline_execution(options = {}) ⇒ Types::StopPipelineExecutionOutput
Stops the specified pipeline execution. You choose to either stop the pipeline execution by completing in-progress actions without starting subsequent actions, or by abandoning in-progress actions. While completing or abandoning in-progress actions, the pipeline execution is in a Stopping
state. After all in-progress actions are completed or abandoned, the pipeline execution is in a Stopped
state.
#tag_resource(options = {}) ⇒ Struct
Adds to or modifies the tags of the given resource. Tags are metadata that can be used to manage a resource.
#untag_resource(options = {}) ⇒ Struct
Removes tags from an AWS resource.
#update_pipeline(options = {}) ⇒ Types::UpdatePipelineOutput
Updates a specified pipeline with edits or changes to its structure. Use a JSON file with the pipeline structure and UpdatePipeline
to provide the full structure of the pipeline. Updating the pipeline increases the version number of the pipeline by 1.
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
Basic Usage
Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:
# poll for ~25 seconds
client.wait_until(...) do |w|
w.max_attempts = 5
w.delay = 5
end
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success
or :failure
from these callbacks,
it will terminate the waiter.
started_at = Time.now
client.wait_until(...) do |w|
# disable max attempts
w.max_attempts = nil
# poll for 1 hour, instead of a number of attempts
w.before_wait do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
end
Handling Errors
When a waiter is successful, it returns true
. When a waiter
fails, it raises an error. All errors raised extend from
Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:
Waiter Name | Client Method | Default Delay: | Default Max Attempts: |
---|