You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::CodePipeline::Client OverviewAn 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.
RegionYou can configure a default region in the following locations:
ENV['AWS_REGION']
Aws.config[:region]
Go here for a list of supported regions.
CredentialsDefault credentials are loaded automatically from the following locations:
ENV['AWS_ACCESS_KEY_ID']
and ENV['AWS_SECRET_ACCESS_KEY']
Aws.config[:credentials]
~/.aws/credentials
(more information)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
:
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.
Attribute Summary collapseConstructs an API client.
Returns information about a specified job and whether that job has been received by the job worker.
Confirms a job worker has received the specified job.
Creates a new custom action that can be used in all pipelines associated with the AWS account.
Creates a pipeline.
In the pipeline structure, you must include either artifactStore
or artifactStores
in your pipeline, but you cannot use both.
Marks a custom action as deleted.
Deletes the specified pipeline.
.
Deletes a previously created webhook by name.
Removes the connection between the webhook that was created by CodePipeline and the external tool with events to be detected.
Prevents artifacts in a pipeline from transitioning to the next stage in the pipeline.
.
Enables artifacts in a pipeline to transition to a stage in a pipeline.
.
Returns information about a job.
Returns the metadata, structure, stages, and actions of a pipeline.
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.
.
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.
.
Requests the details of a job for a third party action.
Lists the action executions that have occurred in a pipeline.
.
Gets a summary of all AWS CodePipeline action types associated with your account.
.
Gets a summary of the most recent executions for a pipeline.
.
Gets a summary of all of the pipelines associated with your account.
.
Gets the set of key-value pairs (metadata) that are used to manage the resource.
.
Gets a listing of all the webhooks in this AWS Region for this account.
Returns information about any jobs for AWS CodePipeline to act on.
Determines whether there are any third party jobs for a job worker to act on.
Provides information to AWS CodePipeline about new revisions to a source.
.
Provides the response to a manual approval request to AWS CodePipeline.
Represents the failure of a job as returned to the pipeline by a job worker.
Represents the success of a job as returned to the pipeline by a job worker.
Represents the failure of a third party job as returned to the pipeline by a job worker.
Represents the success of a third party job as returned to the pipeline by a job worker.
Defines a webhook and returns a unique webhook URL generated by CodePipeline.
Configures a connection between the webhook that was created and the external tool with events to be detected.
.
Resumes the pipeline execution by retrying the last failed actions in a stage.
Starts the specified pipeline.
Stops the specified pipeline execution.
Adds to or modifies the tags of the given resource.
Removes tags from an AWS resource.
.
Updates a specified pipeline with edits or changes to its structure.
Waiters polls an API operation until a resource enters a desired state.
Returns the list of supported waiters.
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
Instance Method Details #acknowledge_job(options = {}) ⇒ Types::AcknowledgeJobOutputReturns information about a specified job and whether that job has been received by the job worker. Used for custom actions only.
#create_custom_action_type(options = {}) ⇒ Types::CreateCustomActionTypeOutputCreates 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::CreatePipelineOutputCreates 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
.
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 = {}) ⇒ StructDeletes the specified pipeline.
#delete_webhook(options = {}) ⇒ StructDeletes 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 = {}) ⇒ StructRemoves 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 = {}) ⇒ StructPrevents artifacts in a pipeline from transitioning to the next stage in the pipeline.
#enable_stage_transition(options = {}) ⇒ StructEnables artifacts in a pipeline to transition to a stage in a pipeline.
#get_job_details(options = {}) ⇒ Types::GetJobDetailsOutputReturns 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::GetPipelineOutputReturns 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::GetPipelineExecutionOutputReturns 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::GetPipelineStateOutputReturns 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.
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_types(options = {}) ⇒ Types::ListActionTypesOutputGets a summary of all AWS CodePipeline action types associated with your account.
#list_webhooks(options = {}) ⇒ Types::ListWebhooksOutputGets 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::PollForJobsOutputReturns 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::PollForThirdPartyJobsOutputDetermines 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_approval_result(options = {}) ⇒ Types::PutApprovalResultOutputProvides the response to a manual approval request to AWS CodePipeline. Valid responses include Approved and Rejected.
#put_job_failure_result(options = {}) ⇒ StructRepresents the failure of a job as returned to the pipeline by a job worker. Used for custom actions only.
#put_job_success_result(options = {}) ⇒ StructRepresents 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 = {}) ⇒ StructRepresents 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 = {}) ⇒ StructRepresents 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::PutWebhookOutputDefines 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 = {}) ⇒ StructConfigures a connection between the webhook that was created and the external tool with events to be detected.
#retry_stage_execution(options = {}) ⇒ Types::RetryStageExecutionOutputResumes 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::StartPipelineExecutionOutputStarts 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::StopPipelineExecutionOutputStops 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.
Adds to or modifies the tags of the given resource. Tags are metadata that can be used to manage a resource.
#untag_resource(options = {}) ⇒ StructRemoves tags from an AWS resource.
#update_pipeline(options = {}) ⇒ Types::UpdatePipelineOutputUpdates 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.
Waiters polls an API operation until a resource enters a desired state.
Basic UsageWaiters 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)
ConfigurationYou 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:RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4