You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::CodeStar::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::CodeStar::Client
- Defined in:
- (unknown)
Overview
An API client for AWS CodeStar. To construct a client, you need to configure a :region
and :credentials
.
codestar = Aws::CodeStar::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::CodeStar::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::CodeStar::Client
constructor
Constructs an API client.
API Operations collapse
-
#associate_team_member(options = {}) ⇒ Types::AssociateTeamMemberResult
Adds an IAM user to the team for an AWS CodeStar project.
.
-
#create_project(options = {}) ⇒ Types::CreateProjectResult
Creates a project, including project resources.
-
#create_user_profile(options = {}) ⇒ Types::CreateUserProfileResult
Creates a profile for a user that includes user preferences, such as the display name and email address assocciated with the user, in AWS CodeStar.
-
#delete_project(options = {}) ⇒ Types::DeleteProjectResult
Deletes a project, including project resources.
-
#delete_user_profile(options = {}) ⇒ Types::DeleteUserProfileResult
Deletes a user profile in AWS CodeStar, including all personal preference data associated with that profile, such as display name and email address.
-
#describe_project(options = {}) ⇒ Types::DescribeProjectResult
Describes a project and its resources.
.
-
#describe_user_profile(options = {}) ⇒ Types::DescribeUserProfileResult
Describes a user in AWS CodeStar and the user attributes across all projects.
.
-
#disassociate_team_member(options = {}) ⇒ Struct
Removes a user from a project.
-
#list_projects(options = {}) ⇒ Types::ListProjectsResult
Lists all projects in AWS CodeStar associated with your AWS account.
.
-
#list_resources(options = {}) ⇒ Types::ListResourcesResult
Lists resources associated with a project in AWS CodeStar.
.
-
#list_tags_for_project(options = {}) ⇒ Types::ListTagsForProjectResult
Gets the tags for a project.
.
-
#list_team_members(options = {}) ⇒ Types::ListTeamMembersResult
Lists all team members associated with a project.
.
-
#list_user_profiles(options = {}) ⇒ Types::ListUserProfilesResult
Lists all the user profiles configured for your AWS account in AWS CodeStar.
.
-
#tag_project(options = {}) ⇒ Types::TagProjectResult
Adds tags to a project.
.
-
#untag_project(options = {}) ⇒ Struct
Removes tags from a project.
.
-
#update_project(options = {}) ⇒ Struct
Updates a project in AWS CodeStar.
.
-
#update_team_member(options = {}) ⇒ Types::UpdateTeamMemberResult
Updates a team member's attributes in an AWS CodeStar project.
-
#update_user_profile(options = {}) ⇒ Types::UpdateUserProfileResult
Updates a user's profile in AWS CodeStar.
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::CodeStar::Client
Constructs an API client.
Instance Method Details
#associate_team_member(options = {}) ⇒ Types::AssociateTeamMemberResult
Adds an IAM user to the team for an AWS CodeStar project.
#create_project(options = {}) ⇒ Types::CreateProjectResult
Creates a project, including project resources. This action creates a project based on a submitted project request. A set of source code files and a toolchain template file can be included with the project request. If these are not provided, an empty project is created.
#create_user_profile(options = {}) ⇒ Types::CreateUserProfileResult
Creates a profile for a user that includes user preferences, such as the display name and email address assocciated with the user, in AWS CodeStar. The user profile is not project-specific. Information in the user profile is displayed wherever the user's information appears to other users in AWS CodeStar.
#delete_project(options = {}) ⇒ Types::DeleteProjectResult
Deletes a project, including project resources. Does not delete users associated with the project, but does delete the IAM roles that allowed access to the project.
#delete_user_profile(options = {}) ⇒ Types::DeleteUserProfileResult
Deletes a user profile in AWS CodeStar, including all personal preference data associated with that profile, such as display name and email address. It does not delete the history of that user, for example the history of commits made by that user.
#describe_project(options = {}) ⇒ Types::DescribeProjectResult
Describes a project and its resources.
#describe_user_profile(options = {}) ⇒ Types::DescribeUserProfileResult
Describes a user in AWS CodeStar and the user attributes across all projects.
#disassociate_team_member(options = {}) ⇒ Struct
Removes a user from a project. Removing a user from a project also removes the IAM policies from that user that allowed access to the project and its resources. Disassociating a team member does not remove that user's profile from AWS CodeStar. It does not remove the user from IAM.
#list_projects(options = {}) ⇒ Types::ListProjectsResult
Lists all projects in AWS CodeStar associated with your AWS account.
#list_resources(options = {}) ⇒ Types::ListResourcesResult
Lists resources associated with a project in AWS CodeStar.
#list_tags_for_project(options = {}) ⇒ Types::ListTagsForProjectResult
Gets the tags for a project.
#list_team_members(options = {}) ⇒ Types::ListTeamMembersResult
Lists all team members associated with a project.
#list_user_profiles(options = {}) ⇒ Types::ListUserProfilesResult
Lists all the user profiles configured for your AWS account in AWS CodeStar.
#tag_project(options = {}) ⇒ Types::TagProjectResult
Adds tags to a project.
#untag_project(options = {}) ⇒ Struct
Removes tags from a project.
#update_project(options = {}) ⇒ Struct
Updates a project in AWS CodeStar.
#update_team_member(options = {}) ⇒ Types::UpdateTeamMemberResult
Updates a team member's attributes in an AWS CodeStar project. For example, you can change a team member's role in the project, or change whether they have remote access to project resources.
#update_user_profile(options = {}) ⇒ Types::UpdateUserProfileResult
Updates a user's profile in AWS CodeStar. The user profile is not project-specific. Information in the user profile is displayed wherever the user's information appears to other users in AWS CodeStar.
#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: |
---|