Client — AWS SDK for Ruby V3 (original) (raw)

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

474 475 476 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 474 def initialize(*args) super end

Instance Method Details

#add_tags_to_on_premises_instances(params = {}) ⇒ Struct

Adds tags to on-premises instances.

509 510 511 512 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 509 def add_tags_to_on_premises_instances(params = {}, options = {}) req = build_request(:add_tags_to_on_premises_instances, params) req.send_request(options) end

#batch_get_application_revisions(params = {}) ⇒ Types::BatchGetApplicationRevisionsOutput

Gets information about one or more application revisions. The maximum number of application revisions that can be returned is 25.

590 591 592 593 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 590 def batch_get_application_revisions(params = {}, options = {}) req = build_request(:batch_get_application_revisions, params) req.send_request(options) end

#batch_get_applications(params = {}) ⇒ Types::BatchGetApplicationsOutput

Gets information about one or more applications. The maximum number of applications that can be returned is 100.

626 627 628 629 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 626 def batch_get_applications(params = {}, options = {}) req = build_request(:batch_get_applications, params) req.send_request(options) end

#batch_get_deployment_groups(params = {}) ⇒ Types::BatchGetDeploymentGroupsOutput

Gets information about one or more deployment groups.

744 745 746 747 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 744 def batch_get_deployment_groups(params = {}, options = {}) req = build_request(:batch_get_deployment_groups, params) req.send_request(options) end

#batch_get_deployment_instances(params = {}) ⇒ Types::BatchGetDeploymentInstancesOutput

This method works, but is deprecated. Use BatchGetDeploymentTargetsinstead.

Returns an array of one or more instances associated with a deployment. This method works with EC2/On-premises and Lambda compute platforms. The newer BatchGetDeploymentTargets works with all compute platforms. The maximum number of instances that can be returned is 25.

802 803 804 805 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 802 def batch_get_deployment_instances(params = {}, options = {}) req = build_request(:batch_get_deployment_instances, params) req.send_request(options) end

#batch_get_deployment_targets(params = {}) ⇒ Types::BatchGetDeploymentTargetsOutput

Returns an array of one or more targets associated with a deployment. This method works with all compute types and should be used instead of the deprecated BatchGetDeploymentInstances. The maximum number of targets that can be returned is 25.

The type of targets returned depends on the deployment's compute platform or deployment method:

941 942 943 944 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 941 def batch_get_deployment_targets(params = {}, options = {}) req = build_request(:batch_get_deployment_targets, params) req.send_request(options) end

#batch_get_deployments(params = {}) ⇒ Types::BatchGetDeploymentsOutput

Gets information about one or more deployments. The maximum number of deployments that can be returned is 25.

1064 1065 1066 1067 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1064 def batch_get_deployments(params = {}, options = {}) req = build_request(:batch_get_deployments, params) req.send_request(options) end

#batch_get_on_premises_instances(params = {}) ⇒ Types::BatchGetOnPremisesInstancesOutput

Gets information about one or more on-premises instances. The maximum number of on-premises instances that can be returned is 25.

1103 1104 1105 1106 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1103 def batch_get_on_premises_instances(params = {}, options = {}) req = build_request(:batch_get_on_premises_instances, params) req.send_request(options) end

#continue_deployment(params = {}) ⇒ Struct

For a blue/green deployment, starts the process of rerouting traffic from instances in the original environment to instances in the replacement environment without waiting for a specified wait time to elapse. (Traffic rerouting, which is achieved by registering instances in the replacement environment with the load balancer, can start as soon as all instances have a status of Ready.)

1138 1139 1140 1141 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1138 def continue_deployment(params = {}, options = {}) req = build_request(:continue_deployment, params) req.send_request(options) end

#create_application(params = {}) ⇒ Types::CreateApplicationOutput

1183 1184 1185 1186 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1183 def create_application(params = {}, options = {}) req = build_request(:create_application, params) req.send_request(options) end

#create_deployment(params = {}) ⇒ Types::CreateDeploymentOutput

Deploys an application revision through the specified deployment group.

1369 1370 1371 1372 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1369 def create_deployment(params = {}, options = {}) req = build_request(:create_deployment, params) req.send_request(options) end

#create_deployment_config(params = {}) ⇒ Types::CreateDeploymentConfigOutput

Creates a deployment configuration.

1462 1463 1464 1465 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1462 def create_deployment_config(params = {}, options = {}) req = build_request(:create_deployment_config, params) req.send_request(options) end

#create_deployment_group(params = {}) ⇒ Types::CreateDeploymentGroupOutput

Creates a deployment group to which application revisions are deployed.

1736 1737 1738 1739 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1736 def create_deployment_group(params = {}, options = {}) req = build_request(:create_deployment_group, params) req.send_request(options) end

#delete_application(params = {}) ⇒ Struct

1759 1760 1761 1762 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1759 def delete_application(params = {}, options = {}) req = build_request(:delete_application, params) req.send_request(options) end

#delete_deployment_config(params = {}) ⇒ Struct

Deletes a deployment configuration.

A deployment configuration cannot be deleted if it is currently in use. Predefined configurations cannot be deleted.

1787 1788 1789 1790 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1787 def delete_deployment_config(params = {}, options = {}) req = build_request(:delete_deployment_config, params) req.send_request(options) end

#delete_deployment_group(params = {}) ⇒ Types::DeleteDeploymentGroupOutput

Deletes a deployment group.

1823 1824 1825 1826 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1823 def delete_deployment_group(params = {}, options = {}) req = build_request(:delete_deployment_group, params) req.send_request(options) end

#delete_git_hub_account_token(params = {}) ⇒ Types::DeleteGitHubAccountTokenOutput

Deletes a GitHub account connection.

1851 1852 1853 1854 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1851 def delete_git_hub_account_token(params = {}, options = {}) req = build_request(:delete_git_hub_account_token, params) req.send_request(options) end

#delete_resources_by_external_id(params = {}) ⇒ Struct

Deletes resources linked to an external ID. This action only applies if you have configured blue/green deployments through CloudFormation.

It is not necessary to call this action directly. CloudFormation calls it on your behalf when it needs to delete stack resources. This action is offered publicly in case you need to delete resources to comply with General Data Protection Regulation (GDPR) requirements.

1882 1883 1884 1885 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1882 def delete_resources_by_external_id(params = {}, options = {}) req = build_request(:delete_resources_by_external_id, params) req.send_request(options) end

#deregister_on_premises_instance(params = {}) ⇒ Struct

Deregisters an on-premises instance.

1904 1905 1906 1907 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1904 def deregister_on_premises_instance(params = {}, options = {}) req = build_request(:deregister_on_premises_instance, params) req.send_request(options) end

#get_application(params = {}) ⇒ Types::GetApplicationOutput

Gets information about an application.

1938 1939 1940 1941 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1938 def get_application(params = {}, options = {}) req = build_request(:get_application, params) req.send_request(options) end

#get_application_revision(params = {}) ⇒ Types::GetApplicationRevisionOutput

Gets information about an application revision.

2012 2013 2014 2015 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2012 def get_application_revision(params = {}, options = {}) req = build_request(:get_application_revision, params) req.send_request(options) end

#get_deployment(params = {}) ⇒ Types::GetDeploymentOutput

Gets information about a deployment.

The content property of the appSpecContent object in the returned revision is always null. Use GetApplicationRevision and the sha256property of the returned appSpecContent object to get the content of the deployment’s AppSpec file.

The following waiters are defined for this operation (see #wait_until for detailed usage):

2145 2146 2147 2148 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2145 def get_deployment(params = {}, options = {}) req = build_request(:get_deployment, params) req.send_request(options) end

#get_deployment_config(params = {}) ⇒ Types::GetDeploymentConfigOutput

Gets information about a deployment configuration.

2188 2189 2190 2191 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2188 def get_deployment_config(params = {}, options = {}) req = build_request(:get_deployment_config, params) req.send_request(options) end

#get_deployment_group(params = {}) ⇒ Types::GetDeploymentGroupOutput

Gets information about a deployment group.

2303 2304 2305 2306 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2303 def get_deployment_group(params = {}, options = {}) req = build_request(:get_deployment_group, params) req.send_request(options) end

#get_deployment_instance(params = {}) ⇒ Types::GetDeploymentInstanceOutput

Gets information about an instance as part of a deployment.

2348 2349 2350 2351 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2348 def get_deployment_instance(params = {}, options = {}) req = build_request(:get_deployment_instance, params) req.send_request(options) end

#get_deployment_target(params = {}) ⇒ Types::GetDeploymentTargetOutput

Returns information about a deployment target.

2452 2453 2454 2455 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2452 def get_deployment_target(params = {}, options = {}) req = build_request(:get_deployment_target, params) req.send_request(options) end

#get_on_premises_instance(params = {}) ⇒ Types::GetOnPremisesInstanceOutput

Gets information about an on-premises instance.

2488 2489 2490 2491 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2488 def get_on_premises_instance(params = {}, options = {}) req = build_request(:get_on_premises_instance, params) req.send_request(options) end

#list_application_revisions(params = {}) ⇒ Types::ListApplicationRevisionsOutput

Lists information about revisions for an application.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

2591 2592 2593 2594 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2591 def list_application_revisions(params = {}, options = {}) req = build_request(:list_application_revisions, params) req.send_request(options) end

#list_applications(params = {}) ⇒ Types::ListApplicationsOutput

Lists the applications registered with the user or Amazon Web Services account.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

2626 2627 2628 2629 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2626 def list_applications(params = {}, options = {}) req = build_request(:list_applications, params) req.send_request(options) end

#list_deployment_configs(params = {}) ⇒ Types::ListDeploymentConfigsOutput

Lists the deployment configurations with the user or Amazon Web Services account.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

2662 2663 2664 2665 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2662 def list_deployment_configs(params = {}, options = {}) req = build_request(:list_deployment_configs, params) req.send_request(options) end

#list_deployment_groups(params = {}) ⇒ Types::ListDeploymentGroupsOutput

Lists the deployment groups for an application registered with the Amazon Web Services user or Amazon Web Services account.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

2705 2706 2707 2708 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2705 def list_deployment_groups(params = {}, options = {}) req = build_request(:list_deployment_groups, params) req.send_request(options) end

#list_deployment_instances(params = {}) ⇒ Types::ListDeploymentInstancesOutput

The newer BatchGetDeploymentTargets should be used instead because it works with all compute types. ListDeploymentInstances throws an exception if it is used with a compute platform other than EC2/On-premises or Lambda.

Lists the instance for a deployment associated with the user or Amazon Web Services account.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

2777 2778 2779 2780 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2777 def list_deployment_instances(params = {}, options = {}) req = build_request(:list_deployment_instances, params) req.send_request(options) end

#list_deployment_targets(params = {}) ⇒ Types::ListDeploymentTargetsOutput

Returns an array of target IDs that are associated a deployment.

2827 2828 2829 2830 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2827 def list_deployment_targets(params = {}, options = {}) req = build_request(:list_deployment_targets, params) req.send_request(options) end

#list_deployments(params = {}) ⇒ Types::ListDeploymentsOutput

Lists the deployments in a deployment group for an application registered with the user or Amazon Web Services account.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

2913 2914 2915 2916 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2913 def list_deployments(params = {}, options = {}) req = build_request(:list_deployments, params) req.send_request(options) end

#list_git_hub_account_token_names(params = {}) ⇒ Types::ListGitHubAccountTokenNamesOutput

Lists the names of stored connections to GitHub accounts.

2945 2946 2947 2948 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2945 def list_git_hub_account_token_names(params = {}, options = {}) req = build_request(:list_git_hub_account_token_names, params) req.send_request(options) end

#list_on_premises_instances(params = {}) ⇒ Types::ListOnPremisesInstancesOutput

Gets a list of names for one or more on-premises instances.

Unless otherwise specified, both registered and deregistered on-premises instance names are listed. To list only registered or deregistered on-premises instance names, use the registration status parameter.

3004 3005 3006 3007 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3004 def list_on_premises_instances(params = {}, options = {}) req = build_request(:list_on_premises_instances, params) req.send_request(options) end

#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceOutput

Returns a list of tags for the resource identified by a specified Amazon Resource Name (ARN). Tags are used to organize and categorize your CodeDeploy resources.

3045 3046 3047 3048 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3045 def list_tags_for_resource(params = {}, options = {}) req = build_request(:list_tags_for_resource, params) req.send_request(options) end

#put_lifecycle_event_hook_execution_status(params = {}) ⇒ Types::PutLifecycleEventHookExecutionStatusOutput

Sets the result of a Lambda validation function. The function validates lifecycle hooks during a deployment that uses the Lambda or Amazon ECS compute platform. For Lambda deployments, the available lifecycle hooks are BeforeAllowTraffic and AfterAllowTraffic. For Amazon ECS deployments, the available lifecycle hooks areBeforeInstall, AfterInstall, AfterAllowTestTraffic,BeforeAllowTraffic, and AfterAllowTraffic. Lambda validation functions return Succeeded or Failed. For more information, seeAppSpec 'hooks' Section for an Lambda Deployment and AppSpec 'hooks' Section for an Amazon ECS Deployment.

3101 3102 3103 3104 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3101 def put_lifecycle_event_hook_execution_status(params = {}, options = {}) req = build_request(:put_lifecycle_event_hook_execution_status, params) req.send_request(options) end

#register_application_revision(params = {}) ⇒ Struct

Registers with CodeDeploy a revision for the specified application.

3154 3155 3156 3157 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3154 def register_application_revision(params = {}, options = {}) req = build_request(:register_application_revision, params) req.send_request(options) end

#register_on_premises_instance(params = {}) ⇒ Struct

Registers an on-premises instance.

Only one IAM ARN (an IAM session ARN or IAM user ARN) is supported in the request. You cannot use both.

3189 3190 3191 3192 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3189 def register_on_premises_instance(params = {}, options = {}) req = build_request(:register_on_premises_instance, params) req.send_request(options) end

#remove_tags_from_on_premises_instances(params = {}) ⇒ Struct

Removes one or more tags from one or more on-premises instances.

3220 3221 3222 3223 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3220 def remove_tags_from_on_premises_instances(params = {}, options = {}) req = build_request(:remove_tags_from_on_premises_instances, params) req.send_request(options) end

#skip_wait_time_for_instance_termination(params = {}) ⇒ Struct

In a blue/green deployment, overrides any specified wait time and starts terminating instances immediately after the traffic routing is complete.

3245 3246 3247 3248 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3245 def skip_wait_time_for_instance_termination(params = {}, options = {}) req = build_request(:skip_wait_time_for_instance_termination, params) req.send_request(options) end

#stop_deployment(params = {}) ⇒ Types::StopDeploymentOutput

Attempts to stop an ongoing deployment.

3281 3282 3283 3284 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3281 def stop_deployment(params = {}, options = {}) req = build_request(:stop_deployment, params) req.send_request(options) end

#tag_resource(params = {}) ⇒ Struct

Associates the list of tags in the input Tags parameter with the resource identified by the ResourceArn input parameter.

3315 3316 3317 3318 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3315 def tag_resource(params = {}, options = {}) req = build_request(:tag_resource, params) req.send_request(options) end

#untag_resource(params = {}) ⇒ Struct

Disassociates a resource from a list of tags. The resource is identified by the ResourceArn input parameter. The tags are identified by the list of keys in the TagKeys input parameter.

3346 3347 3348 3349 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3346 def untag_resource(params = {}, options = {}) req = build_request(:untag_resource, params) req.send_request(options) end

#update_application(params = {}) ⇒ Struct

Changes the name of an application.

3372 3373 3374 3375 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3372 def update_application(params = {}, options = {}) req = build_request(:update_application, params) req.send_request(options) end

#update_deployment_group(params = {}) ⇒ Types::UpdateDeploymentGroupOutput

Changes information about a deployment group.

3638 3639 3640 3641 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3638 def update_deployment_group(params = {}, options = {}) req = build_request(:update_deployment_group, params) req.send_request(options) end

#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean

Polls an API operation until a resource enters a desired state.

Basic Usage

A waiter will call an API operation until:

In between attempts, the waiter will sleep.

# polls in a loop, sleeping between attempts
client.wait_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You can pass configuration as the final arguments hash.

# poll for ~25 seconds
client.wait_until(waiter_name, params, {
  max_attempts: 5,
  delay: 5,
})

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(waiter_name, params, {

  # disable max attempts
  max_attempts: nil,

  # poll for 1 hour, instead of a number of attempts
  before_wait: -> (attempts, response) do
    throw :failure if Time.now - started_at > 3600
  end
})

Handling Errors

When a waiter is unsuccessful, it will raise an error. All of the failure errors extend fromWaiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Valid Waiters

The following table lists the valid waiter names, the operations they call, and the default :delay and :max_attempts values.

waiter_name params :delay :max_attempts
deployment_successful #get_deployment 15 120
3753 3754 3755 3756 3757 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3753 def wait_until(waiter_name, params = {}, options = {}) w = waiter(waiter_name, options) yield(w.waiter) if block_given? w.wait(params) end