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

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

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

Instance Method Details

#add_tags_to_on_premises_instances(params = {}) ⇒ Struct

Adds tags to on-premises instances.

508 509 510 511 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 508 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.

589 590 591 592 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 589 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.

625 626 627 628 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 625 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.

743 744 745 746 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 743 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.

801 802 803 804 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 801 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:

940 941 942 943 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 940 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.

1063 1064 1065 1066 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1063 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.

1102 1103 1104 1105 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1102 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.)

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

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

1182 1183 1184 1185 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1182 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.

1368 1369 1370 1371 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1368 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.

1461 1462 1463 1464 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1461 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.

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

#delete_application(params = {}) ⇒ Struct

1758 1759 1760 1761 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1758 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.

1786 1787 1788 1789 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1786 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.

1822 1823 1824 1825 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1822 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.

1850 1851 1852 1853 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1850 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.

1881 1882 1883 1884 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1881 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.

1903 1904 1905 1906 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1903 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.

1937 1938 1939 1940 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 1937 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.

2011 2012 2013 2014 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2011 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):

2144 2145 2146 2147 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2144 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.

2187 2188 2189 2190 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2187 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.

2302 2303 2304 2305 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2302 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.

2347 2348 2349 2350 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2347 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.

2451 2452 2453 2454 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2451 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.

2487 2488 2489 2490 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2487 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.

2590 2591 2592 2593 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2590 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.

2625 2626 2627 2628 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2625 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.

2661 2662 2663 2664 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2661 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.

2704 2705 2706 2707 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2704 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.

2776 2777 2778 2779 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2776 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.

2826 2827 2828 2829 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2826 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.

2912 2913 2914 2915 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2912 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.

2944 2945 2946 2947 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 2944 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.

3003 3004 3005 3006 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3003 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.

3044 3045 3046 3047 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3044 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.

3100 3101 3102 3103 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3100 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.

3153 3154 3155 3156 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3153 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.

3188 3189 3190 3191 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3188 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.

3219 3220 3221 3222 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3219 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.

3244 3245 3246 3247 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3244 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.

3280 3281 3282 3283 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3280 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.

3314 3315 3316 3317 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3314 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.

3345 3346 3347 3348 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3345 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.

3371 3372 3373 3374 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3371 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.

3637 3638 3639 3640 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3637 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
3752 3753 3754 3755 3756 # File 'gems/aws-sdk-codedeploy/lib/aws-sdk-codedeploy/client.rb', line 3752 def wait_until(waiter_name, params = {}, options = {}) w = waiter(waiter_name, options) yield(w.waiter) if block_given? w.wait(params) end