You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::CloudSearch::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::CloudSearch::Client
- Defined in:
- (unknown)
Overview
An API client for Amazon CloudSearch. To construct a client, you need to configure a :region
and :credentials
.
cloudsearch = Aws::CloudSearch::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::CloudSearch::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::CloudSearch::Client
constructor
Constructs an API client.
API Operations collapse
-
#build_suggesters(options = {}) ⇒ Types::BuildSuggestersResponse
Indexes the search suggestions.
-
#create_domain(options = {}) ⇒ Types::CreateDomainResponse
Creates a new search domain.
-
#define_analysis_scheme(options = {}) ⇒ Types::DefineAnalysisSchemeResponse
Configures an analysis scheme that can be applied to a
text
ortext-array
field to define language-specific text processing options. -
#define_expression(options = {}) ⇒ Types::DefineExpressionResponse
Configures an
Expression
for the search domain. -
#define_index_field(options = {}) ⇒ Types::DefineIndexFieldResponse
Configures an
IndexField
for the search domain. -
#define_suggester(options = {}) ⇒ Types::DefineSuggesterResponse
Configures a suggester for a domain.
-
#delete_analysis_scheme(options = {}) ⇒ Types::DeleteAnalysisSchemeResponse
Deletes an analysis scheme.
-
#delete_domain(options = {}) ⇒ Types::DeleteDomainResponse
Permanently deletes a search domain and all of its data.
-
#delete_expression(options = {}) ⇒ Types::DeleteExpressionResponse
Removes an
Expression
from the search domain. -
#delete_index_field(options = {}) ⇒ Types::DeleteIndexFieldResponse
Removes an
IndexField
from the search domain. -
#delete_suggester(options = {}) ⇒ Types::DeleteSuggesterResponse
Deletes a suggester.
-
#describe_analysis_schemes(options = {}) ⇒ Types::DescribeAnalysisSchemesResponse
Gets the analysis schemes configured for a domain.
-
#describe_availability_options(options = {}) ⇒ Types::DescribeAvailabilityOptionsResponse
Gets the availability options configured for a domain.
-
#describe_domain_endpoint_options(options = {}) ⇒ Types::DescribeDomainEndpointOptionsResponse
Returns the domain's endpoint options, specifically whether all requests to the domain must arrive over HTTPS.
-
#describe_domains(options = {}) ⇒ Types::DescribeDomainsResponse
Gets information about the search domains owned by this account.
-
#describe_expressions(options = {}) ⇒ Types::DescribeExpressionsResponse
Gets the expressions configured for the search domain.
-
#describe_index_fields(options = {}) ⇒ Types::DescribeIndexFieldsResponse
Gets information about the index fields configured for the search domain.
-
#describe_scaling_parameters(options = {}) ⇒ Types::DescribeScalingParametersResponse
Gets the scaling parameters configured for a domain.
-
#describe_service_access_policies(options = {}) ⇒ Types::DescribeServiceAccessPoliciesResponse
Gets information about the access policies that control access to the domain's document and search endpoints.
-
#describe_suggesters(options = {}) ⇒ Types::DescribeSuggestersResponse
Gets the suggesters configured for a domain.
-
#index_documents(options = {}) ⇒ Types::IndexDocumentsResponse
Tells the search domain to start indexing its documents using the latest indexing options.
-
#list_domain_names(options = {}) ⇒ Types::ListDomainNamesResponse
Lists all search domains owned by an account.
.
-
#update_availability_options(options = {}) ⇒ Types::UpdateAvailabilityOptionsResponse
Configures the availability options for a domain.
-
#update_domain_endpoint_options(options = {}) ⇒ Types::UpdateDomainEndpointOptionsResponse
Updates the domain's endpoint options, specifically whether all requests to the domain must arrive over HTTPS.
-
#update_scaling_parameters(options = {}) ⇒ Types::UpdateScalingParametersResponse
Configures scaling parameters for a domain.
-
#update_service_access_policies(options = {}) ⇒ Types::UpdateServiceAccessPoliciesResponse
Configures the access rules that control access to the domain's document and search endpoints.
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::CloudSearch::Client
Constructs an API client.
Instance Method Details
#build_suggesters(options = {}) ⇒ Types::BuildSuggestersResponse
Indexes the search suggestions. For more information, see Configuring Suggesters in the Amazon CloudSearch Developer Guide.
#create_domain(options = {}) ⇒ Types::CreateDomainResponse
Creates a new search domain. For more information, see Creating a Search Domain in the Amazon CloudSearch Developer Guide.
#define_analysis_scheme(options = {}) ⇒ Types::DefineAnalysisSchemeResponse
Configures an analysis scheme that can be applied to a text
or text-array
field to define language-specific text processing options. For more information, see Configuring Analysis Schemes in the Amazon CloudSearch Developer Guide.
#define_expression(options = {}) ⇒ Types::DefineExpressionResponse
Configures an Expression
for the search domain. Used to create new expressions and modify existing ones. If the expression exists, the new configuration replaces the old one. For more information, see Configuring Expressions in the Amazon CloudSearch Developer Guide.
#define_index_field(options = {}) ⇒ Types::DefineIndexFieldResponse
Configures an IndexField
for the search domain. Used to create new fields and modify existing ones. You must specify the name of the domain you are configuring and an index field configuration. The index field configuration specifies a unique name, the index field type, and the options you want to configure for the field. The options you can specify depend on the IndexFieldType
. If the field exists, the new configuration replaces the old one. For more information, see Configuring Index Fields in the Amazon CloudSearch Developer Guide.
#define_suggester(options = {}) ⇒ Types::DefineSuggesterResponse
Configures a suggester for a domain. A suggester enables you to display possible matches before users finish typing their queries. When you configure a suggester, you must specify the name of the text field you want to search for possible matches and a unique name for the suggester. For more information, see Getting Search Suggestions in the Amazon CloudSearch Developer Guide.
#delete_analysis_scheme(options = {}) ⇒ Types::DeleteAnalysisSchemeResponse
Deletes an analysis scheme. For more information, see Configuring Analysis Schemes in the Amazon CloudSearch Developer Guide.
#delete_domain(options = {}) ⇒ Types::DeleteDomainResponse
Permanently deletes a search domain and all of its data. Once a domain has been deleted, it cannot be recovered. For more information, see Deleting a Search Domain in the Amazon CloudSearch Developer Guide.
#delete_expression(options = {}) ⇒ Types::DeleteExpressionResponse
Removes an Expression
from the search domain. For more information, see Configuring Expressions in the Amazon CloudSearch Developer Guide.
#delete_index_field(options = {}) ⇒ Types::DeleteIndexFieldResponse
Removes an IndexField
from the search domain. For more information, see Configuring Index Fields in the Amazon CloudSearch Developer Guide.
#delete_suggester(options = {}) ⇒ Types::DeleteSuggesterResponse
Deletes a suggester. For more information, see Getting Search Suggestions in the Amazon CloudSearch Developer Guide.
#describe_analysis_schemes(options = {}) ⇒ Types::DescribeAnalysisSchemesResponse
Gets the analysis schemes configured for a domain. An analysis scheme defines language-specific text processing options for a text
field. Can be limited to specific analysis schemes by name. By default, shows all analysis schemes and includes any pending changes to the configuration. Set the Deployed
option to true
to show the active configuration and exclude pending changes. For more information, see Configuring Analysis Schemes in the Amazon CloudSearch Developer Guide.
#describe_availability_options(options = {}) ⇒ Types::DescribeAvailabilityOptionsResponse
Gets the availability options configured for a domain. By default, shows the configuration with any pending changes. Set the Deployed
option to true
to show the active configuration and exclude pending changes. For more information, see Configuring Availability Options in the Amazon CloudSearch Developer Guide.
#describe_domain_endpoint_options(options = {}) ⇒ Types::DescribeDomainEndpointOptionsResponse
Returns the domain's endpoint options, specifically whether all requests to the domain must arrive over HTTPS. For more information, see Configuring Domain Endpoint Options in the Amazon CloudSearch Developer Guide.
#describe_domains(options = {}) ⇒ Types::DescribeDomainsResponse
Gets information about the search domains owned by this account. Can be limited to specific domains. Shows all domains by default. To get the number of searchable documents in a domain, use the console or submit a matchall
request to your domain's search endpoint: q=matchall&q.parser=structured&size=0
. For more information, see Getting Information about a Search Domain in the Amazon CloudSearch Developer Guide.
#describe_expressions(options = {}) ⇒ Types::DescribeExpressionsResponse
Gets the expressions configured for the search domain. Can be limited to specific expressions by name. By default, shows all expressions and includes any pending changes to the configuration. Set the Deployed
option to true
to show the active configuration and exclude pending changes. For more information, see Configuring Expressions in the Amazon CloudSearch Developer Guide.
#describe_index_fields(options = {}) ⇒ Types::DescribeIndexFieldsResponse
Gets information about the index fields configured for the search domain. Can be limited to specific fields by name. By default, shows all fields and includes any pending changes to the configuration. Set the Deployed
option to true
to show the active configuration and exclude pending changes. For more information, see Getting Domain Information in the Amazon CloudSearch Developer Guide.
#describe_scaling_parameters(options = {}) ⇒ Types::DescribeScalingParametersResponse
Gets the scaling parameters configured for a domain. A domain's scaling parameters specify the desired search instance type and replication count. For more information, see Configuring Scaling Options in the Amazon CloudSearch Developer Guide.
#describe_service_access_policies(options = {}) ⇒ Types::DescribeServiceAccessPoliciesResponse
Gets information about the access policies that control access to the domain's document and search endpoints. By default, shows the configuration with any pending changes. Set the Deployed
option to true
to show the active configuration and exclude pending changes. For more information, see Configuring Access for a Search Domain in the Amazon CloudSearch Developer Guide.
#describe_suggesters(options = {}) ⇒ Types::DescribeSuggestersResponse
Gets the suggesters configured for a domain. A suggester enables you to display possible matches before users finish typing their queries. Can be limited to specific suggesters by name. By default, shows all suggesters and includes any pending changes to the configuration. Set the Deployed
option to true
to show the active configuration and exclude pending changes. For more information, see Getting Search Suggestions in the Amazon CloudSearch Developer Guide.
#index_documents(options = {}) ⇒ Types::IndexDocumentsResponse
Tells the search domain to start indexing its documents using the latest indexing options. This operation must be invoked to activate options whose OptionStatus is RequiresIndexDocuments
.
#list_domain_names(options = {}) ⇒ Types::ListDomainNamesResponse
Lists all search domains owned by an account.
#update_availability_options(options = {}) ⇒ Types::UpdateAvailabilityOptionsResponse
Configures the availability options for a domain. Enabling the Multi-AZ option expands an Amazon CloudSearch domain to an additional Availability Zone in the same Region to increase fault tolerance in the event of a service disruption. Changes to the Multi-AZ option can take about half an hour to become active. For more information, see Configuring Availability Options in the Amazon CloudSearch Developer Guide.
#update_domain_endpoint_options(options = {}) ⇒ Types::UpdateDomainEndpointOptionsResponse
Updates the domain's endpoint options, specifically whether all requests to the domain must arrive over HTTPS. For more information, see Configuring Domain Endpoint Options in the Amazon CloudSearch Developer Guide.
#update_scaling_parameters(options = {}) ⇒ Types::UpdateScalingParametersResponse
Configures scaling parameters for a domain. A domain's scaling parameters specify the desired search instance type and replication count. Amazon CloudSearch will still automatically scale your domain based on the volume of data and traffic, but not below the desired instance type and replication count. If the Multi-AZ option is enabled, these values control the resources used per Availability Zone. For more information, see Configuring Scaling Options in the Amazon CloudSearch Developer Guide.
#update_service_access_policies(options = {}) ⇒ Types::UpdateServiceAccessPoliciesResponse
Configures the access rules that control access to the domain's document and search endpoints. For more information, see Configuring Access for an Amazon CloudSearch Domain.
#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: |
---|