You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::Kendra::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::Kendra::Client
- Defined in:
- (unknown)
Overview
An API client for AWSKendraFrontendService. To construct a client, you need to configure a :region
and :credentials
.
kendra = Aws::Kendra::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::Kendra::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::Kendra::Client
constructor
Constructs an API client.
API Operations collapse
-
#batch_delete_document(options = {}) ⇒ Types::BatchDeleteDocumentResponse
Removes one or more documents from an index.
-
#batch_put_document(options = {}) ⇒ Types::BatchPutDocumentResponse
Adds one or more documents to an index.
The
BatchPutDocument
operation enables you to ingest inline documents or a set of documents stored in an Amazon S3 bucket. -
#create_data_source(options = {}) ⇒ Types::CreateDataSourceResponse
Creates a data source that you use to with an Amazon Kendra index.
-
#create_faq(options = {}) ⇒ Types::CreateFaqResponse
Creates an new set of frequently asked question (FAQ) questions and answers.
.
-
#create_index(options = {}) ⇒ Types::CreateIndexResponse
Creates a new Amazon Kendra index.
-
#delete_data_source(options = {}) ⇒ Struct
Deletes an Amazon Kendra data source.
-
#delete_faq(options = {}) ⇒ Struct
Removes an FAQ from an index.
.
-
#delete_index(options = {}) ⇒ Struct
Deletes an existing Amazon Kendra index.
-
#describe_data_source(options = {}) ⇒ Types::DescribeDataSourceResponse
Gets information about a Amazon Kendra data source.
.
-
#describe_faq(options = {}) ⇒ Types::DescribeFaqResponse
Gets information about an FAQ list.
.
-
#describe_index(options = {}) ⇒ Types::DescribeIndexResponse
Describes an existing Amazon Kendra index
.
-
#list_data_source_sync_jobs(options = {}) ⇒ Types::ListDataSourceSyncJobsResponse
Gets statistics about synchronizing Amazon Kendra with a data source.
.
-
#list_data_sources(options = {}) ⇒ Types::ListDataSourcesResponse
Lists the data sources that you have created.
.
-
#list_faqs(options = {}) ⇒ Types::ListFaqsResponse
Gets a list of FAQ lists associated with an index.
.
-
#list_indices(options = {}) ⇒ Types::ListIndicesResponse
Lists the Amazon Kendra indexes that you have created.
.
-
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Gets a list of tags associated with a specified resource.
-
#query(options = {}) ⇒ Types::QueryResult
Searches an active index.
-
#start_data_source_sync_job(options = {}) ⇒ Types::StartDataSourceSyncJobResponse
Starts a synchronization job for a data source.
-
#stop_data_source_sync_job(options = {}) ⇒ Struct
Stops a running synchronization job.
-
#submit_feedback(options = {}) ⇒ Struct
Enables you to provide feedback to Amazon Kendra to improve the performance of the service.
-
#tag_resource(options = {}) ⇒ Struct
Adds the specified tag to the specified index, FAQ, or data source resource.
-
#untag_resource(options = {}) ⇒ Struct
Removes a tag from an index, FAQ, or a data source.
.
-
#update_data_source(options = {}) ⇒ Struct
Updates an existing Amazon Kendra data source.
.
-
#update_index(options = {}) ⇒ Struct
Updates an existing Amazon Kendra index.
.
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::Kendra::Client
Constructs an API client.
Options Hash (options):
-
:access_key_id
(String)
—
Used to set credentials statically. See Plugins::RequestSigner for more details.
-
:active_endpoint_cache
(Boolean)
—
When set to
true
, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults tofalse
. See Plugins::EndpointDiscovery for more details. -
:convert_params
(Boolean)
— default:
true
—
When
true
, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details. -
:credentials
(required, Credentials)
—
Your AWS credentials. The following locations will be searched in order for credentials:
:access_key_id
,:secret_access_key
, and:session_token
options- ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
HOME/.aws/credentials
shared credentials file- EC2 instance profile credentials See Plugins::RequestSigner for more details.
-
:disable_host_prefix_injection
(Boolean)
—
Set to true to disable SDK automatically adding host prefix to default service endpoint when available. See Plugins::EndpointPattern for more details.
-
:endpoint
(String)
—
A default endpoint is constructed from the
:region
. See Plugins::RegionalEndpoint for more details. -
:endpoint_cache_max_entries
(Integer)
—
Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000. See Plugins::EndpointDiscovery for more details.
-
:endpoint_cache_max_threads
(Integer)
—
Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. See Plugins::EndpointDiscovery for more details.
-
:endpoint_cache_poll_interval
(Integer)
—
When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec. See Plugins::EndpointDiscovery for more details.
-
:endpoint_discovery
(Boolean)
—
When set to
true
, endpoint discovery will be enabled for operations when available. Defaults tofalse
. See Plugins::EndpointDiscovery for more details. -
:http_continue_timeout
(Float)
— default:
1
—
See Seahorse::Client::Plugins::NetHttp for more details.
-
:http_idle_timeout
(Integer)
— default:
5
—
See Seahorse::Client::Plugins::NetHttp for more details.
-
:http_open_timeout
(Integer)
— default:
15
—
See Seahorse::Client::Plugins::NetHttp for more details.
-
:http_proxy
(String)
—
See Seahorse::Client::Plugins::NetHttp for more details.
-
:http_read_timeout
(Integer)
— default:
60
—
See Seahorse::Client::Plugins::NetHttp for more details.
-
:http_wire_trace
(Boolean)
— default:
false
—
See Seahorse::Client::Plugins::NetHttp for more details.
-
:log_level
(Symbol)
— default:
:info
—
The log level to send messages to the logger at. See Plugins::Logging for more details.
-
:log_formatter
(Logging::LogFormatter)
—
The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.
-
:logger
(Logger)
— default:
nil
—
The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.
-
:profile
(String)
—
Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.
-
:raise_response_errors
(Boolean)
— default:
true
—
When
true
, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details. -
:region
(required, String)
—
The AWS region to connect to. The region is used to construct the client endpoint. Defaults to
ENV['AWS_REGION']
. Also checksAMAZON_REGION
andAWS_DEFAULT_REGION
. See Plugins::RegionalEndpoint for more details. -
:retry_limit
(Integer)
— default:
3
—
The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.
-
:secret_access_key
(String)
—
Used to set credentials statically. See Plugins::RequestSigner for more details.
-
:session_token
(String)
—
Used to set credentials statically. See Plugins::RequestSigner for more details.
-
:simple_json
(Boolean)
— default:
false
—
Disables request parameter conversion, validation, and formatting. Also disable response data type conversions. This option is useful when you want to ensure the highest level of performance by avoiding overhead of walking request parameters and response data structures.
When
:simple_json
is enabled, the request parameters hash must be formatted exactly as the DynamoDB API expects. See Plugins::Protocols::JsonRpc for more details. -
:ssl_ca_bundle
(String)
—
See Seahorse::Client::Plugins::NetHttp for more details.
-
:ssl_ca_directory
(String)
—
See Seahorse::Client::Plugins::NetHttp for more details.
-
:ssl_ca_store
(String)
—
See Seahorse::Client::Plugins::NetHttp for more details.
-
:ssl_verify_peer
(Boolean)
— default:
true
—
See Seahorse::Client::Plugins::NetHttp for more details.
-
:stub_responses
(Boolean)
— default:
false
—
Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.
Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.
-
:validate_params
(Boolean)
— default:
true
—
When
true
, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.
Instance Method Details
#batch_delete_document(options = {}) ⇒ Types::BatchDeleteDocumentResponse
Removes one or more documents from an index. The documents must have been added with the BatchPutDocument operation.
The documents are deleted asynchronously. You can see the progress of the deletion by using AWS CloudWatch. Any error messages releated to the processing of the batch are sent to you CloudWatch log.
Examples:
Request syntax with placeholder values
resp = client.batch_delete_document({
index_id: "IndexId", # required
document_id_list: ["DocumentId"], # required
data_source_sync_job_metric_target: {
data_source_id: "DataSourceId", # required
data_source_sync_job_id: "DataSourceSyncJobId", # required
},
})
Response structure
resp.failed_documents #=> Array
resp.failed_documents[0].id #=> String
resp.failed_documents[0].error_code #=> String, one of "InternalError", "InvalidRequest"
resp.failed_documents[0].error_message #=> String
Options Hash (options):
-
:index_id
(required, String)
—
The identifier of the index that contains the documents to delete.
-
:document_id_list
(required, Array<String>)
—
One or more identifiers for documents to delete from the index.
-
:data_source_sync_job_metric_target
(Types::DataSourceSyncJobMetricTarget)
—
Maps a particular data source sync job to a particular data source.
Returns:
-
(Types::BatchDeleteDocumentResponse)
—
Returns a response object which responds to the following methods:
See Also:
#batch_put_document(options = {}) ⇒ Types::BatchPutDocumentResponse
Adds one or more documents to an index.
The BatchPutDocument
operation enables you to ingest inline documents or a set of documents stored in an Amazon S3 bucket. Use this operation to ingest your text and unstructured text into an index, add custom attributes to the documents, and to attach an access control list to the documents added to the index.
The documents are indexed asynchronously. You can see the progress of the batch using AWS CloudWatch. Any error messages related to processing the batch are sent to your AWS CloudWatch log.
Examples:
Request syntax with placeholder values
resp = client.batch_put_document({
index_id: "IndexId", # required
role_arn: "RoleArn",
documents: [ # required
{
id: "DocumentId", # required
title: "Title",
blob: "data",
s3_path: {
bucket: "S3BucketName", # required
key: "S3ObjectKey", # required
},
attributes: [
{
key: "DocumentAttributeKey", # required
value: { # required
string_value: "DocumentAttributeStringValue",
string_list_value: ["String"],
long_value: 1,
date_value: Time.now,
},
},
],
access_control_list: [
{
name: "PrincipalName", # required
type: "USER", # required, accepts USER, GROUP
access: "ALLOW", # required, accepts ALLOW, DENY
},
],
content_type: "PDF", # accepts PDF, HTML, MS_WORD, PLAIN_TEXT, PPT
},
],
})
Response structure
resp.failed_documents #=> Array
resp.failed_documents[0].id #=> String
resp.failed_documents[0].error_code #=> String, one of "InternalError", "InvalidRequest"
resp.failed_documents[0].error_message #=> String
Options Hash (options):
-
:index_id
(required, String)
—
The identifier of the index to add the documents to. You need to create the index first using the CreateIndex operation.
-
:role_arn
(String)
—
The Amazon Resource Name (ARN) of a role that is allowed to run the
BatchPutDocument
operation. For more information, see IAM Roles for Amazon Kendra. -
:documents
(required, Array<Types::Document>)
—
One or more documents to add to the index.
Documents have the following file size limits.
5 MB total size for inline documents
50 MB total size for files from an S3 bucket
5 MB extracted text for any file
For more information about file size and transaction per second quotas, see Quotas.
Returns:
-
(Types::BatchPutDocumentResponse)
—
Returns a response object which responds to the following methods:
See Also:
#create_data_source(options = {}) ⇒ Types::CreateDataSourceResponse
Creates a data source that you use to with an Amazon Kendra index.
You specify a name, data source connector type and description for your data source. You also specify configuration information such as document metadata (author, source URI, and so on) and user context information.
CreateDataSource
is a synchronous operation. The operation returns 200 if the data source was successfully created. Otherwise, an exception is raised.
Examples:
Request syntax with placeholder values
resp = client.create_data_source({
name: "DataSourceName", # required
index_id: "IndexId", # required
type: "S3", # required, accepts S3, SHAREPOINT, DATABASE, SALESFORCE, ONEDRIVE, SERVICENOW, CUSTOM, CONFLUENCE
configuration: {
s3_configuration: {
bucket_name: "S3BucketName", # required
inclusion_prefixes: ["DataSourceInclusionsExclusionsStringsMember"],
inclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
exclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
documents_metadata_configuration: {
s3_prefix: "S3ObjectKey",
},
access_control_list_configuration: {
key_path: "S3ObjectKey",
},
},
share_point_configuration: {
share_point_version: "SHAREPOINT_ONLINE", # required, accepts SHAREPOINT_ONLINE
urls: ["Url"], # required
secret_arn: "SecretArn", # required
crawl_attachments: false,
use_change_log: false,
inclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
exclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
vpc_configuration: {
subnet_ids: ["SubnetId"], # required
security_group_ids: ["VpcSecurityGroupId"], # required
},
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
document_title_field_name: "DataSourceFieldName",
disable_local_groups: false,
},
database_configuration: {
database_engine_type: "RDS_AURORA_MYSQL", # required, accepts RDS_AURORA_MYSQL, RDS_AURORA_POSTGRESQL, RDS_MYSQL, RDS_POSTGRESQL
connection_configuration: { # required
database_host: "DatabaseHost", # required
database_port: 1, # required
database_name: "DatabaseName", # required
table_name: "TableName", # required
secret_arn: "SecretArn", # required
},
vpc_configuration: {
subnet_ids: ["SubnetId"], # required
security_group_ids: ["VpcSecurityGroupId"], # required
},
column_configuration: { # required
document_id_column_name: "ColumnName", # required
document_data_column_name: "ColumnName", # required
document_title_column_name: "ColumnName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
change_detecting_columns: ["ColumnName"], # required
},
acl_configuration: {
allowed_groups_column_name: "ColumnName", # required
},
sql_configuration: {
query_identifiers_enclosing_option: "DOUBLE_QUOTES", # accepts DOUBLE_QUOTES, NONE
},
},
salesforce_configuration: {
server_url: "Url", # required
secret_arn: "SecretArn", # required
standard_object_configurations: [
{
name: "ACCOUNT", # required, accepts ACCOUNT, CAMPAIGN, CASE, CONTACT, CONTRACT, DOCUMENT, GROUP, IDEA, LEAD, OPPORTUNITY, PARTNER, PRICEBOOK, PRODUCT, PROFILE, SOLUTION, TASK, USER
document_data_field_name: "DataSourceFieldName", # required
document_title_field_name: "DataSourceFieldName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
},
],
knowledge_article_configuration: {
included_states: ["DRAFT"], # required, accepts DRAFT, PUBLISHED, ARCHIVED
standard_knowledge_article_type_configuration: {
document_data_field_name: "DataSourceFieldName", # required
document_title_field_name: "DataSourceFieldName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
},
custom_knowledge_article_type_configurations: [
{
name: "SalesforceCustomKnowledgeArticleTypeName", # required
document_data_field_name: "DataSourceFieldName", # required
document_title_field_name: "DataSourceFieldName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
},
],
},
chatter_feed_configuration: {
document_data_field_name: "DataSourceFieldName", # required
document_title_field_name: "DataSourceFieldName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
include_filter_types: ["ACTIVE_USER"], # accepts ACTIVE_USER, STANDARD_USER
},
crawl_attachments: false,
standard_object_attachment_configuration: {
document_title_field_name: "DataSourceFieldName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
},
include_attachment_file_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
exclude_attachment_file_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
},
one_drive_configuration: {
tenant_domain: "TenantDomain", # required
secret_arn: "SecretArn", # required
one_drive_users: { # required
one_drive_user_list: ["OneDriveUser"],
one_drive_user_s3_path: {
bucket: "S3BucketName", # required
key: "S3ObjectKey", # required
},
},
inclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
exclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
disable_local_groups: false,
},
service_now_configuration: {
host_url: "ServiceNowHostUrl", # required
secret_arn: "SecretArn", # required
service_now_build_version: "LONDON", # required, accepts LONDON, OTHERS
knowledge_article_configuration: {
crawl_attachments: false,
include_attachment_file_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
exclude_attachment_file_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
document_data_field_name: "DataSourceFieldName", # required
document_title_field_name: "DataSourceFieldName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
},
service_catalog_configuration: {
crawl_attachments: false,
include_attachment_file_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
exclude_attachment_file_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
document_data_field_name: "DataSourceFieldName", # required
document_title_field_name: "DataSourceFieldName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
},
},
confluence_configuration: {
server_url: "Url", # required
secret_arn: "SecretArn", # required
version: "CLOUD", # required, accepts CLOUD, SERVER
space_configuration: {
crawl_personal_spaces: false,
crawl_archived_spaces: false,
include_spaces: ["ConfluenceSpaceIdentifier"],
exclude_spaces: ["ConfluenceSpaceIdentifier"],
space_field_mappings: [
{
data_source_field_name: "DISPLAY_URL", # accepts DISPLAY_URL, ITEM_TYPE, SPACE_KEY, URL
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName",
},
],
},
page_configuration: {
page_field_mappings: [
{
data_source_field_name: "AUTHOR", # accepts AUTHOR, CONTENT_STATUS, CREATED_DATE, DISPLAY_URL, ITEM_TYPE, LABELS, MODIFIED_DATE, PARENT_ID, SPACE_KEY, SPACE_NAME, URL, VERSION
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName",
},
],
},
blog_configuration: {
blog_field_mappings: [
{
data_source_field_name: "AUTHOR", # accepts AUTHOR, DISPLAY_URL, ITEM_TYPE, LABELS, PUBLISH_DATE, SPACE_KEY, SPACE_NAME, URL, VERSION
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName",
},
],
},
attachment_configuration: {
crawl_attachments: false,
attachment_field_mappings: [
{
data_source_field_name: "AUTHOR", # accepts AUTHOR, CONTENT_TYPE, CREATED_DATE, DISPLAY_URL, FILE_SIZE, ITEM_TYPE, PARENT_ID, SPACE_KEY, SPACE_NAME, URL, VERSION
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName",
},
],
},
vpc_configuration: {
subnet_ids: ["SubnetId"], # required
security_group_ids: ["VpcSecurityGroupId"], # required
},
inclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
exclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
},
},
description: "Description",
schedule: "ScanSchedule",
role_arn: "RoleArn",
tags: [
{
key: "TagKey", # required
value: "TagValue", # required
},
],
client_token: "ClientTokenName",
})
Response structure
resp.id #=> String
Options Hash (options):
-
:name
(required, String)
—
A unique name for the data source. A data source name can\'t be changed without deleting and recreating the data source.
-
:index_id
(required, String)
—
The identifier of the index that should be associated with this data source.
-
:type
(required, String)
—
The type of repository that contains the data source.
-
:configuration
(Types::DataSourceConfiguration)
—
The connector configuration information that is required to access the repository.
You can\'t specify the
Configuration
parameter when theType
parameter is set toCUSTOM
. If you do, you receive aValidationException
exception.The
Configuration
parameter is required for all other data sources. -
:description
(String)
—
A description for the data source.
-
:schedule
(String)
—
Sets the frequency that Amazon Kendra will check the documents in your repository and update the index. If you don\'t set a schedule Amazon Kendra will not periodically update the index. You can call the
StartDataSourceSyncJob
operation to update the index.You can\'t specify the
Schedule
parameter when theType
parameter is set toCUSTOM
. If you do, you receive aValidationException
exception. -
:role_arn
(String)
—
The Amazon Resource Name (ARN) of a role with permission to access the data source. For more information, see IAM Roles for Amazon Kendra.
You can\'t specify the
RoleArn
parameter when theType
parameter is set toCUSTOM
. If you do, you receive aValidationException
exception.The
RoleArn
parameter is required for all other data sources. -
:tags
(Array<Types::Tag>)
—
A list of key-value pairs that identify the data source. You can use the tags to identify and organize your resources and to control access to resources.
-
:client_token
(String)
—
This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. A token that you provide to identify the request to create a data source. Multiple calls to the
CreateDataSource
operation with the same client token will create only one data source.
Returns:
See Also:
#create_faq(options = {}) ⇒ Types::CreateFaqResponse
Creates an new set of frequently asked question (FAQ) questions and answers.
Examples:
Request syntax with placeholder values
resp = client.create_faq({
index_id: "IndexId", # required
name: "FaqName", # required
description: "Description",
s3_path: { # required
bucket: "S3BucketName", # required
key: "S3ObjectKey", # required
},
role_arn: "RoleArn", # required
tags: [
{
key: "TagKey", # required
value: "TagValue", # required
},
],
file_format: "CSV", # accepts CSV, CSV_WITH_HEADER, JSON
client_token: "ClientTokenName",
})
Response structure
resp.id #=> String
Options Hash (options):
-
:index_id
(required, String)
—
The identifier of the index that contains the FAQ.
-
:name
(required, String)
—
The name that should be associated with the FAQ.
-
:description
(String)
—
A description of the FAQ.
-
:s3_path
(required, Types::S3Path)
—
The S3 location of the FAQ input data.
-
:role_arn
(required, String)
—
The Amazon Resource Name (ARN) of a role with permission to access the S3 bucket that contains the FAQs. For more information, see IAM Roles for Amazon Kendra.
-
:tags
(Array<Types::Tag>)
—
A list of key-value pairs that identify the FAQ. You can use the tags to identify and organize your resources and to control access to resources.
-
:file_format
(String)
—
The format of the input file. You can choose between a basic CSV format, a CSV format that includes customs attributes in a header, and a JSON format that includes custom attributes.
The format must match the format of the file stored in the S3 bucket identified in the
S3Path
parameter.For more information, see Adding questions and answers.
-
:client_token
(String)
—
This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. A token that you provide to identify the request to create a FAQ. Multiple calls to the
CreateFaqRequest
operation with the same client token will create only one FAQ.
Returns:
See Also:
#create_index(options = {}) ⇒ Types::CreateIndexResponse
Creates a new Amazon Kendra index. Index creation is an asynchronous operation. To determine if index creation has completed, check the Status
field returned from a call to . The Status
field is set to ACTIVE
when the index is ready to use.
Once the index is active you can index your documents using the operation or using one of the supported data sources.
Examples:
Request syntax with placeholder values
resp = client.create_index({
name: "IndexName", # required
edition: "DEVELOPER_EDITION", # accepts DEVELOPER_EDITION, ENTERPRISE_EDITION
role_arn: "RoleArn", # required
server_side_encryption_configuration: {
kms_key_id: "KmsKeyId",
},
description: "Description",
client_token: "ClientTokenName",
tags: [
{
key: "TagKey", # required
value: "TagValue", # required
},
],
user_token_configurations: [
{
jwt_token_type_configuration: {
key_location: "URL", # required, accepts URL, SECRET_MANAGER
url: "Url",
secret_manager_arn: "RoleArn",
user_name_attribute_field: "UserNameAttributeField",
group_attribute_field: "GroupAttributeField",
issuer: "Issuer",
claim_regex: "ClaimRegex",
},
json_token_type_configuration: {
user_name_attribute_field: "String", # required
group_attribute_field: "String", # required
},
},
],
user_context_policy: "ATTRIBUTE_FILTER", # accepts ATTRIBUTE_FILTER, USER_TOKEN
})
Response structure
resp.id #=> String
Options Hash (options):
-
:name
(required, String)
—
The name for the new index.
-
:edition
(String)
—
The Amazon Kendra edition to use for the index. Choose
DEVELOPER_EDITION
for indexes intended for development, testing, or proof of concept. UseENTERPRISE_EDITION
for your production databases. Once you set the edition for an index, it can\'t be changed.The
Edition
parameter is optional. If you don\'t supply a value, the default isENTERPRISE_EDITION
. -
:role_arn
(required, String)
—
An AWS Identity and Access Management (IAM) role that gives Amazon Kendra permissions to access your Amazon CloudWatch logs and metrics. This is also the role used when you use the
BatchPutDocument
operation to index documents from an Amazon S3 bucket. -
:server_side_encryption_configuration
(Types::ServerSideEncryptionConfiguration)
—
The identifier of the AWS KMS customer managed key (CMK) to use to encrypt data indexed by Amazon Kendra. Amazon Kendra doesn\'t support asymmetric CMKs.
-
:description
(String)
—
A description for the index.
-
:client_token
(String)
—
This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. A token that you provide to identify the request to create an index. Multiple calls to the
CreateIndex
operation with the same client token will create only one index. -
:tags
(Array<Types::Tag>)
—
A list of key-value pairs that identify the index. You can use the tags to identify and organize your resources and to control access to resources.
-
:user_token_configurations
(Array<Types::UserTokenConfiguration>)
—
The user token configuration.
-
:user_context_policy
(String)
—
The user context policy.
- ATTRIBUTE_FILTER
All indexed content is searchable and displayable for all users. If there is an access control list, it is ignored. You can filter on user and group attributes.
- USER_TOKEN
Enables SSO and token-based user access control. All documents with no access control and all documents accessible to the user will be searchable and displayable.
Returns:
See Also:
#delete_data_source(options = {}) ⇒ Struct
Deletes an Amazon Kendra data source. An exception is not thrown if the data source is already being deleted. While the data source is being deleted, the Status
field returned by a call to the operation is set to DELETING
. For more information, see Deleting Data Sources.
Examples:
Request syntax with placeholder values
resp = client.delete_data_source({
id: "DataSourceId", # required
index_id: "IndexId", # required
})
Options Hash (options):
-
:id
(required, String)
—
The unique identifier of the data source to delete.
-
:index_id
(required, String)
—
The unique identifier of the index associated with the data source.
Returns:
-
(Struct)
—
Returns an empty response.
See Also:
#delete_faq(options = {}) ⇒ Struct
Removes an FAQ from an index.
Examples:
Request syntax with placeholder values
resp = client.delete_faq({
id: "FaqId", # required
index_id: "IndexId", # required
})
Options Hash (options):
-
:id
(required, String)
—
The identifier of the FAQ to remove.
-
:index_id
(required, String)
—
The index to remove the FAQ from.
Returns:
-
(Struct)
—
Returns an empty response.
See Also:
#delete_index(options = {}) ⇒ Struct
Deletes an existing Amazon Kendra index. An exception is not thrown if the index is already being deleted. While the index is being deleted, the Status
field returned by a call to the DescribeIndex operation is set to DELETING
.
Examples:
Request syntax with placeholder values
resp = client.delete_index({
id: "IndexId", # required
})
Options Hash (options):
-
:id
(required, String)
—
The identifier of the index to delete.
Returns:
-
(Struct)
—
Returns an empty response.
See Also:
#describe_data_source(options = {}) ⇒ Types::DescribeDataSourceResponse
Gets information about a Amazon Kendra data source.
Examples:
Request syntax with placeholder values
resp = client.describe_data_source({
id: "DataSourceId", # required
index_id: "IndexId", # required
})
Response structure
resp.id #=> String
resp.index_id #=> String
resp.name #=> String
resp.type #=> String, one of "S3", "SHAREPOINT", "DATABASE", "SALESFORCE", "ONEDRIVE", "SERVICENOW", "CUSTOM", "CONFLUENCE"
resp.configuration.s3_configuration.bucket_name #=> String
resp.configuration.s3_configuration.inclusion_prefixes #=> Array
resp.configuration.s3_configuration.inclusion_prefixes[0] #=> String
resp.configuration.s3_configuration.inclusion_patterns #=> Array
resp.configuration.s3_configuration.inclusion_patterns[0] #=> String
resp.configuration.s3_configuration.exclusion_patterns #=> Array
resp.configuration.s3_configuration.exclusion_patterns[0] #=> String
resp.configuration.s3_configuration.documents_metadata_configuration.s3_prefix #=> String
resp.configuration.s3_configuration.access_control_list_configuration.key_path #=> String
resp.configuration.share_point_configuration.share_point_version #=> String, one of "SHAREPOINT_ONLINE"
resp.configuration.share_point_configuration.urls #=> Array
resp.configuration.share_point_configuration.urls[0] #=> String
resp.configuration.share_point_configuration.secret_arn #=> String
resp.configuration.share_point_configuration.crawl_attachments #=> true/false
resp.configuration.share_point_configuration.use_change_log #=> true/false
resp.configuration.share_point_configuration.inclusion_patterns #=> Array
resp.configuration.share_point_configuration.inclusion_patterns[0] #=> String
resp.configuration.share_point_configuration.exclusion_patterns #=> Array
resp.configuration.share_point_configuration.exclusion_patterns[0] #=> String
resp.configuration.share_point_configuration.vpc_configuration.subnet_ids #=> Array
resp.configuration.share_point_configuration.vpc_configuration.subnet_ids[0] #=> String
resp.configuration.share_point_configuration.vpc_configuration.security_group_ids #=> Array
resp.configuration.share_point_configuration.vpc_configuration.security_group_ids[0] #=> String
resp.configuration.share_point_configuration.field_mappings #=> Array
resp.configuration.share_point_configuration.field_mappings[0].data_source_field_name #=> String
resp.configuration.share_point_configuration.field_mappings[0].date_field_format #=> String
resp.configuration.share_point_configuration.field_mappings[0].index_field_name #=> String
resp.configuration.share_point_configuration.document_title_field_name #=> String
resp.configuration.share_point_configuration.disable_local_groups #=> true/false
resp.configuration.database_configuration.database_engine_type #=> String, one of "RDS_AURORA_MYSQL", "RDS_AURORA_POSTGRESQL", "RDS_MYSQL", "RDS_POSTGRESQL"
resp.configuration.database_configuration.connection_configuration.database_host #=> String
resp.configuration.database_configuration.connection_configuration.database_port #=> Integer
resp.configuration.database_configuration.connection_configuration.database_name #=> String
resp.configuration.database_configuration.connection_configuration.table_name #=> String
resp.configuration.database_configuration.connection_configuration.secret_arn #=> String
resp.configuration.database_configuration.vpc_configuration.subnet_ids #=> Array
resp.configuration.database_configuration.vpc_configuration.subnet_ids[0] #=> String
resp.configuration.database_configuration.vpc_configuration.security_group_ids #=> Array
resp.configuration.database_configuration.vpc_configuration.security_group_ids[0] #=> String
resp.configuration.database_configuration.column_configuration.document_id_column_name #=> String
resp.configuration.database_configuration.column_configuration.document_data_column_name #=> String
resp.configuration.database_configuration.column_configuration.document_title_column_name #=> String
resp.configuration.database_configuration.column_configuration.field_mappings #=> Array
resp.configuration.database_configuration.column_configuration.field_mappings[0].data_source_field_name #=> String
resp.configuration.database_configuration.column_configuration.field_mappings[0].date_field_format #=> String
resp.configuration.database_configuration.column_configuration.field_mappings[0].index_field_name #=> String
resp.configuration.database_configuration.column_configuration.change_detecting_columns #=> Array
resp.configuration.database_configuration.column_configuration.change_detecting_columns[0] #=> String
resp.configuration.database_configuration.acl_configuration.allowed_groups_column_name #=> String
resp.configuration.database_configuration.sql_configuration.query_identifiers_enclosing_option #=> String, one of "DOUBLE_QUOTES", "NONE"
resp.configuration.salesforce_configuration.server_url #=> String
resp.configuration.salesforce_configuration.secret_arn #=> String
resp.configuration.salesforce_configuration.standard_object_configurations #=> Array
resp.configuration.salesforce_configuration.standard_object_configurations[0].name #=> String, one of "ACCOUNT", "CAMPAIGN", "CASE", "CONTACT", "CONTRACT", "DOCUMENT", "GROUP", "IDEA", "LEAD", "OPPORTUNITY", "PARTNER", "PRICEBOOK", "PRODUCT", "PROFILE", "SOLUTION", "TASK", "USER"
resp.configuration.salesforce_configuration.standard_object_configurations[0].document_data_field_name #=> String
resp.configuration.salesforce_configuration.standard_object_configurations[0].document_title_field_name #=> String
resp.configuration.salesforce_configuration.standard_object_configurations[0].field_mappings #=> Array
resp.configuration.salesforce_configuration.standard_object_configurations[0].field_mappings[0].data_source_field_name #=> String
resp.configuration.salesforce_configuration.standard_object_configurations[0].field_mappings[0].date_field_format #=> String
resp.configuration.salesforce_configuration.standard_object_configurations[0].field_mappings[0].index_field_name #=> String
resp.configuration.salesforce_configuration.knowledge_article_configuration.included_states #=> Array
resp.configuration.salesforce_configuration.knowledge_article_configuration.included_states[0] #=> String, one of "DRAFT", "PUBLISHED", "ARCHIVED"
resp.configuration.salesforce_configuration.knowledge_article_configuration.standard_knowledge_article_type_configuration.document_data_field_name #=> String
resp.configuration.salesforce_configuration.knowledge_article_configuration.standard_knowledge_article_type_configuration.document_title_field_name #=> String
resp.configuration.salesforce_configuration.knowledge_article_configuration.standard_knowledge_article_type_configuration.field_mappings #=> Array
resp.configuration.salesforce_configuration.knowledge_article_configuration.standard_knowledge_article_type_configuration.field_mappings[0].data_source_field_name #=> String
resp.configuration.salesforce_configuration.knowledge_article_configuration.standard_knowledge_article_type_configuration.field_mappings[0].date_field_format #=> String
resp.configuration.salesforce_configuration.knowledge_article_configuration.standard_knowledge_article_type_configuration.field_mappings[0].index_field_name #=> String
resp.configuration.salesforce_configuration.knowledge_article_configuration.custom_knowledge_article_type_configurations #=> Array
resp.configuration.salesforce_configuration.knowledge_article_configuration.custom_knowledge_article_type_configurations[0].name #=> String
resp.configuration.salesforce_configuration.knowledge_article_configuration.custom_knowledge_article_type_configurations[0].document_data_field_name #=> String
resp.configuration.salesforce_configuration.knowledge_article_configuration.custom_knowledge_article_type_configurations[0].document_title_field_name #=> String
resp.configuration.salesforce_configuration.knowledge_article_configuration.custom_knowledge_article_type_configurations[0].field_mappings #=> Array
resp.configuration.salesforce_configuration.knowledge_article_configuration.custom_knowledge_article_type_configurations[0].field_mappings[0].data_source_field_name #=> String
resp.configuration.salesforce_configuration.knowledge_article_configuration.custom_knowledge_article_type_configurations[0].field_mappings[0].date_field_format #=> String
resp.configuration.salesforce_configuration.knowledge_article_configuration.custom_knowledge_article_type_configurations[0].field_mappings[0].index_field_name #=> String
resp.configuration.salesforce_configuration.chatter_feed_configuration.document_data_field_name #=> String
resp.configuration.salesforce_configuration.chatter_feed_configuration.document_title_field_name #=> String
resp.configuration.salesforce_configuration.chatter_feed_configuration.field_mappings #=> Array
resp.configuration.salesforce_configuration.chatter_feed_configuration.field_mappings[0].data_source_field_name #=> String
resp.configuration.salesforce_configuration.chatter_feed_configuration.field_mappings[0].date_field_format #=> String
resp.configuration.salesforce_configuration.chatter_feed_configuration.field_mappings[0].index_field_name #=> String
resp.configuration.salesforce_configuration.chatter_feed_configuration.include_filter_types #=> Array
resp.configuration.salesforce_configuration.chatter_feed_configuration.include_filter_types[0] #=> String, one of "ACTIVE_USER", "STANDARD_USER"
resp.configuration.salesforce_configuration.crawl_attachments #=> true/false
resp.configuration.salesforce_configuration.standard_object_attachment_configuration.document_title_field_name #=> String
resp.configuration.salesforce_configuration.standard_object_attachment_configuration.field_mappings #=> Array
resp.configuration.salesforce_configuration.standard_object_attachment_configuration.field_mappings[0].data_source_field_name #=> String
resp.configuration.salesforce_configuration.standard_object_attachment_configuration.field_mappings[0].date_field_format #=> String
resp.configuration.salesforce_configuration.standard_object_attachment_configuration.field_mappings[0].index_field_name #=> String
resp.configuration.salesforce_configuration.include_attachment_file_patterns #=> Array
resp.configuration.salesforce_configuration.include_attachment_file_patterns[0] #=> String
resp.configuration.salesforce_configuration.exclude_attachment_file_patterns #=> Array
resp.configuration.salesforce_configuration.exclude_attachment_file_patterns[0] #=> String
resp.configuration.one_drive_configuration.tenant_domain #=> String
resp.configuration.one_drive_configuration.secret_arn #=> String
resp.configuration.one_drive_configuration.one_drive_users.one_drive_user_list #=> Array
resp.configuration.one_drive_configuration.one_drive_users.one_drive_user_list[0] #=> String
resp.configuration.one_drive_configuration.one_drive_users.one_drive_user_s3_path.bucket #=> String
resp.configuration.one_drive_configuration.one_drive_users.one_drive_user_s3_path.key #=> String
resp.configuration.one_drive_configuration.inclusion_patterns #=> Array
resp.configuration.one_drive_configuration.inclusion_patterns[0] #=> String
resp.configuration.one_drive_configuration.exclusion_patterns #=> Array
resp.configuration.one_drive_configuration.exclusion_patterns[0] #=> String
resp.configuration.one_drive_configuration.field_mappings #=> Array
resp.configuration.one_drive_configuration.field_mappings[0].data_source_field_name #=> String
resp.configuration.one_drive_configuration.field_mappings[0].date_field_format #=> String
resp.configuration.one_drive_configuration.field_mappings[0].index_field_name #=> String
resp.configuration.one_drive_configuration.disable_local_groups #=> true/false
resp.configuration.service_now_configuration.host_url #=> String
resp.configuration.service_now_configuration.secret_arn #=> String
resp.configuration.service_now_configuration.service_now_build_version #=> String, one of "LONDON", "OTHERS"
resp.configuration.service_now_configuration.knowledge_article_configuration.crawl_attachments #=> true/false
resp.configuration.service_now_configuration.knowledge_article_configuration.include_attachment_file_patterns #=> Array
resp.configuration.service_now_configuration.knowledge_article_configuration.include_attachment_file_patterns[0] #=> String
resp.configuration.service_now_configuration.knowledge_article_configuration.exclude_attachment_file_patterns #=> Array
resp.configuration.service_now_configuration.knowledge_article_configuration.exclude_attachment_file_patterns[0] #=> String
resp.configuration.service_now_configuration.knowledge_article_configuration.document_data_field_name #=> String
resp.configuration.service_now_configuration.knowledge_article_configuration.document_title_field_name #=> String
resp.configuration.service_now_configuration.knowledge_article_configuration.field_mappings #=> Array
resp.configuration.service_now_configuration.knowledge_article_configuration.field_mappings[0].data_source_field_name #=> String
resp.configuration.service_now_configuration.knowledge_article_configuration.field_mappings[0].date_field_format #=> String
resp.configuration.service_now_configuration.knowledge_article_configuration.field_mappings[0].index_field_name #=> String
resp.configuration.service_now_configuration.service_catalog_configuration.crawl_attachments #=> true/false
resp.configuration.service_now_configuration.service_catalog_configuration.include_attachment_file_patterns #=> Array
resp.configuration.service_now_configuration.service_catalog_configuration.include_attachment_file_patterns[0] #=> String
resp.configuration.service_now_configuration.service_catalog_configuration.exclude_attachment_file_patterns #=> Array
resp.configuration.service_now_configuration.service_catalog_configuration.exclude_attachment_file_patterns[0] #=> String
resp.configuration.service_now_configuration.service_catalog_configuration.document_data_field_name #=> String
resp.configuration.service_now_configuration.service_catalog_configuration.document_title_field_name #=> String
resp.configuration.service_now_configuration.service_catalog_configuration.field_mappings #=> Array
resp.configuration.service_now_configuration.service_catalog_configuration.field_mappings[0].data_source_field_name #=> String
resp.configuration.service_now_configuration.service_catalog_configuration.field_mappings[0].date_field_format #=> String
resp.configuration.service_now_configuration.service_catalog_configuration.field_mappings[0].index_field_name #=> String
resp.configuration.confluence_configuration.server_url #=> String
resp.configuration.confluence_configuration.secret_arn #=> String
resp.configuration.confluence_configuration.version #=> String, one of "CLOUD", "SERVER"
resp.configuration.confluence_configuration.space_configuration.crawl_personal_spaces #=> true/false
resp.configuration.confluence_configuration.space_configuration.crawl_archived_spaces #=> true/false
resp.configuration.confluence_configuration.space_configuration.include_spaces #=> Array
resp.configuration.confluence_configuration.space_configuration.include_spaces[0] #=> String
resp.configuration.confluence_configuration.space_configuration.exclude_spaces #=> Array
resp.configuration.confluence_configuration.space_configuration.exclude_spaces[0] #=> String
resp.configuration.confluence_configuration.space_configuration.space_field_mappings #=> Array
resp.configuration.confluence_configuration.space_configuration.space_field_mappings[0].data_source_field_name #=> String, one of "DISPLAY_URL", "ITEM_TYPE", "SPACE_KEY", "URL"
resp.configuration.confluence_configuration.space_configuration.space_field_mappings[0].date_field_format #=> String
resp.configuration.confluence_configuration.space_configuration.space_field_mappings[0].index_field_name #=> String
resp.configuration.confluence_configuration.page_configuration.page_field_mappings #=> Array
resp.configuration.confluence_configuration.page_configuration.page_field_mappings[0].data_source_field_name #=> String, one of "AUTHOR", "CONTENT_STATUS", "CREATED_DATE", "DISPLAY_URL", "ITEM_TYPE", "LABELS", "MODIFIED_DATE", "PARENT_ID", "SPACE_KEY", "SPACE_NAME", "URL", "VERSION"
resp.configuration.confluence_configuration.page_configuration.page_field_mappings[0].date_field_format #=> String
resp.configuration.confluence_configuration.page_configuration.page_field_mappings[0].index_field_name #=> String
resp.configuration.confluence_configuration.blog_configuration.blog_field_mappings #=> Array
resp.configuration.confluence_configuration.blog_configuration.blog_field_mappings[0].data_source_field_name #=> String, one of "AUTHOR", "DISPLAY_URL", "ITEM_TYPE", "LABELS", "PUBLISH_DATE", "SPACE_KEY", "SPACE_NAME", "URL", "VERSION"
resp.configuration.confluence_configuration.blog_configuration.blog_field_mappings[0].date_field_format #=> String
resp.configuration.confluence_configuration.blog_configuration.blog_field_mappings[0].index_field_name #=> String
resp.configuration.confluence_configuration.attachment_configuration.crawl_attachments #=> true/false
resp.configuration.confluence_configuration.attachment_configuration.attachment_field_mappings #=> Array
resp.configuration.confluence_configuration.attachment_configuration.attachment_field_mappings[0].data_source_field_name #=> String, one of "AUTHOR", "CONTENT_TYPE", "CREATED_DATE", "DISPLAY_URL", "FILE_SIZE", "ITEM_TYPE", "PARENT_ID", "SPACE_KEY", "SPACE_NAME", "URL", "VERSION"
resp.configuration.confluence_configuration.attachment_configuration.attachment_field_mappings[0].date_field_format #=> String
resp.configuration.confluence_configuration.attachment_configuration.attachment_field_mappings[0].index_field_name #=> String
resp.configuration.confluence_configuration.vpc_configuration.subnet_ids #=> Array
resp.configuration.confluence_configuration.vpc_configuration.subnet_ids[0] #=> String
resp.configuration.confluence_configuration.vpc_configuration.security_group_ids #=> Array
resp.configuration.confluence_configuration.vpc_configuration.security_group_ids[0] #=> String
resp.configuration.confluence_configuration.inclusion_patterns #=> Array
resp.configuration.confluence_configuration.inclusion_patterns[0] #=> String
resp.configuration.confluence_configuration.exclusion_patterns #=> Array
resp.configuration.confluence_configuration.exclusion_patterns[0] #=> String
resp.created_at #=> Time
resp.updated_at #=> Time
resp.description #=> String
resp.status #=> String, one of "CREATING", "DELETING", "FAILED", "UPDATING", "ACTIVE"
resp.schedule #=> String
resp.role_arn #=> String
resp.error_message #=> String
Options Hash (options):
-
:id
(required, String)
—
The unique identifier of the data source to describe.
-
:index_id
(required, String)
—
The identifier of the index that contains the data source.
Returns:
-
(Types::DescribeDataSourceResponse)
—
Returns a response object which responds to the following methods:
- #id => String
- #index_id => String
- #name => String
- #type => String
- #configuration => Types::DataSourceConfiguration
- #created_at => Time
- #updated_at => Time
- #description => String
- #status => String
- #schedule => String
- #role_arn => String
- #error_message => String
See Also:
#describe_faq(options = {}) ⇒ Types::DescribeFaqResponse
Gets information about an FAQ list.
Examples:
Request syntax with placeholder values
resp = client.describe_faq({
id: "FaqId", # required
index_id: "IndexId", # required
})
Response structure
resp.id #=> String
resp.index_id #=> String
resp.name #=> String
resp.description #=> String
resp.created_at #=> Time
resp.updated_at #=> Time
resp.s3_path.bucket #=> String
resp.s3_path.key #=> String
resp.status #=> String, one of "CREATING", "UPDATING", "ACTIVE", "DELETING", "FAILED"
resp.role_arn #=> String
resp.error_message #=> String
resp.file_format #=> String, one of "CSV", "CSV_WITH_HEADER", "JSON"
Options Hash (options):
-
:id
(required, String)
—
The unique identifier of the FAQ.
-
:index_id
(required, String)
—
The identifier of the index that contains the FAQ.
Returns:
-
(Types::DescribeFaqResponse)
—
Returns a response object which responds to the following methods:
- #id => String
- #index_id => String
- #name => String
- #description => String
- #created_at => Time
- #updated_at => Time
- #s3_path => Types::S3Path
- #status => String
- #role_arn => String
- #error_message => String
- #file_format => String
See Also:
#describe_index(options = {}) ⇒ Types::DescribeIndexResponse
Describes an existing Amazon Kendra index
Examples:
Request syntax with placeholder values
resp = client.describe_index({
id: "IndexId", # required
})
Response structure
resp.name #=> String
resp.id #=> String
resp.edition #=> String, one of "DEVELOPER_EDITION", "ENTERPRISE_EDITION"
resp.role_arn #=> String
resp.server_side_encryption_configuration.kms_key_id #=> String
resp.status #=> String, one of "CREATING", "ACTIVE", "DELETING", "FAILED", "UPDATING", "SYSTEM_UPDATING"
resp.description #=> String
resp.created_at #=> Time
resp.updated_at #=> Time
resp.document_metadata_configurations #=> Array
resp.document_metadata_configurations[0].name #=> String
resp.document_metadata_configurations[0].type #=> String, one of "STRING_VALUE", "STRING_LIST_VALUE", "LONG_VALUE", "DATE_VALUE"
resp.document_metadata_configurations[0].relevance.freshness #=> true/false
resp.document_metadata_configurations[0].relevance.importance #=> Integer
resp.document_metadata_configurations[0].relevance.duration #=> String
resp.document_metadata_configurations[0].relevance.rank_order #=> String, one of "ASCENDING", "DESCENDING"
resp.document_metadata_configurations[0].relevance.value_importance_map #=> Hash
resp.document_metadata_configurations[0].relevance.value_importance_map["ValueImportanceMapKey"] #=> Integer
resp.document_metadata_configurations[0].search.facetable #=> true/false
resp.document_metadata_configurations[0].search.searchable #=> true/false
resp.document_metadata_configurations[0].search.displayable #=> true/false
resp.document_metadata_configurations[0].search.sortable #=> true/false
resp.index_statistics.faq_statistics.indexed_question_answers_count #=> Integer
resp.index_statistics.text_document_statistics.indexed_text_documents_count #=> Integer
resp.index_statistics.text_document_statistics.indexed_text_bytes #=> Integer
resp.error_message #=> String
resp.capacity_units.storage_capacity_units #=> Integer
resp.capacity_units.query_capacity_units #=> Integer
resp.user_token_configurations #=> Array
resp.user_token_configurations[0].jwt_token_type_configuration.key_location #=> String, one of "URL", "SECRET_MANAGER"
resp.user_token_configurations[0].jwt_token_type_configuration.url #=> String
resp.user_token_configurations[0].jwt_token_type_configuration.secret_manager_arn #=> String
resp.user_token_configurations[0].jwt_token_type_configuration.user_name_attribute_field #=> String
resp.user_token_configurations[0].jwt_token_type_configuration.group_attribute_field #=> String
resp.user_token_configurations[0].jwt_token_type_configuration.issuer #=> String
resp.user_token_configurations[0].jwt_token_type_configuration.claim_regex #=> String
resp.user_token_configurations[0].json_token_type_configuration.user_name_attribute_field #=> String
resp.user_token_configurations[0].json_token_type_configuration.group_attribute_field #=> String
resp.user_context_policy #=> String, one of "ATTRIBUTE_FILTER", "USER_TOKEN"
Options Hash (options):
-
:id
(required, String)
—
The name of the index to describe.
Returns:
-
(Types::DescribeIndexResponse)
—
Returns a response object which responds to the following methods:
- #name => String
- #id => String
- #edition => String
- #role_arn => String
- #server_side_encryption_configuration => Types::ServerSideEncryptionConfiguration
- #status => String
- #description => String
- #created_at => Time
- #updated_at => Time
- #document_metadata_configurations => Array<Types::DocumentMetadataConfiguration>
- #index_statistics => Types::IndexStatistics
- #error_message => String
- #capacity_units => Types::CapacityUnitsConfiguration
- #user_token_configurations => Array<Types::UserTokenConfiguration>
- #user_context_policy => String
See Also:
#list_data_source_sync_jobs(options = {}) ⇒ Types::ListDataSourceSyncJobsResponse
Gets statistics about synchronizing Amazon Kendra with a data source.
Examples:
Request syntax with placeholder values
resp = client.list_data_source_sync_jobs({
id: "DataSourceId", # required
index_id: "IndexId", # required
next_token: "NextToken",
max_results: 1,
start_time_filter: {
start_time: Time.now,
end_time: Time.now,
},
status_filter: "FAILED", # accepts FAILED, SUCCEEDED, SYNCING, INCOMPLETE, STOPPING, ABORTED, SYNCING_INDEXING
})
Response structure
resp.history #=> Array
resp.history[0].execution_id #=> String
resp.history[0].start_time #=> Time
resp.history[0].end_time #=> Time
resp.history[0].status #=> String, one of "FAILED", "SUCCEEDED", "SYNCING", "INCOMPLETE", "STOPPING", "ABORTED", "SYNCING_INDEXING"
resp.history[0].error_message #=> String
resp.history[0].error_code #=> String, one of "InternalError", "InvalidRequest"
resp.history[0].data_source_error_code #=> String
resp.history[0].metrics.documents_added #=> String
resp.history[0].metrics.documents_modified #=> String
resp.history[0].metrics.documents_deleted #=> String
resp.history[0].metrics.documents_failed #=> String
resp.history[0].metrics.documents_scanned #=> String
resp.next_token #=> String
Options Hash (options):
-
:id
(required, String)
—
The identifier of the data source.
-
:index_id
(required, String)
—
The identifier of the index that contains the data source.
-
:next_token
(String)
—
If the result of the previous request to
GetDataSourceSyncJobHistory
was truncated, include theNextToken
to fetch the next set of jobs. -
:max_results
(Integer)
—
The maximum number of synchronization jobs to return in the response. If there are fewer results in the list, this response contains only the actual results.
-
:start_time_filter
(Types::TimeRange)
—
When specified, the synchronization jobs returned in the list are limited to jobs between the specified dates.
-
:status_filter
(String)
—
When specified, only returns synchronization jobs with the
Status
field equal to the specified status.
Returns:
-
(Types::ListDataSourceSyncJobsResponse)
—
Returns a response object which responds to the following methods:
- #history => Array<Types::DataSourceSyncJob>
- #next_token => String
See Also:
#list_data_sources(options = {}) ⇒ Types::ListDataSourcesResponse
Lists the data sources that you have created.
Examples:
Request syntax with placeholder values
resp = client.list_data_sources({
index_id: "IndexId", # required
next_token: "NextToken",
max_results: 1,
})
Response structure
resp.summary_items #=> Array
resp.summary_items[0].name #=> String
resp.summary_items[0].id #=> String
resp.summary_items[0].type #=> String, one of "S3", "SHAREPOINT", "DATABASE", "SALESFORCE", "ONEDRIVE", "SERVICENOW", "CUSTOM", "CONFLUENCE"
resp.summary_items[0].created_at #=> Time
resp.summary_items[0].updated_at #=> Time
resp.summary_items[0].status #=> String, one of "CREATING", "DELETING", "FAILED", "UPDATING", "ACTIVE"
resp.next_token #=> String
Options Hash (options):
-
:index_id
(required, String)
—
The identifier of the index that contains the data source.
-
:next_token
(String)
—
If the previous response was incomplete (because there is more data to retrieve), Amazon Kendra returns a pagination token in the response. You can use this pagination token to retrieve the next set of data sources (
DataSourceSummaryItems
). -
:max_results
(Integer)
—
The maximum number of data sources to return.
Returns:
-
(Types::ListDataSourcesResponse)
—
Returns a response object which responds to the following methods:
- #summary_items => Array<Types::DataSourceSummary>
- #next_token => String
See Also:
#list_faqs(options = {}) ⇒ Types::ListFaqsResponse
Gets a list of FAQ lists associated with an index.
Examples:
Request syntax with placeholder values
resp = client.list_faqs({
index_id: "IndexId", # required
next_token: "NextToken",
max_results: 1,
})
Response structure
resp.next_token #=> String
resp.faq_summary_items #=> Array
resp.faq_summary_items[0].id #=> String
resp.faq_summary_items[0].name #=> String
resp.faq_summary_items[0].status #=> String, one of "CREATING", "UPDATING", "ACTIVE", "DELETING", "FAILED"
resp.faq_summary_items[0].created_at #=> Time
resp.faq_summary_items[0].updated_at #=> Time
resp.faq_summary_items[0].file_format #=> String, one of "CSV", "CSV_WITH_HEADER", "JSON"
Options Hash (options):
-
:index_id
(required, String)
—
The index that contains the FAQ lists.
-
:next_token
(String)
—
If the result of the previous request to
ListFaqs
was truncated, include theNextToken
to fetch the next set of FAQs. -
:max_results
(Integer)
—
The maximum number of FAQs to return in the response. If there are fewer results in the list, this response contains only the actual results.
Returns:
-
(Types::ListFaqsResponse)
—
Returns a response object which responds to the following methods:
- #next_token => String
- #faq_summary_items => Array<Types::FaqSummary>
See Also:
#list_indices(options = {}) ⇒ Types::ListIndicesResponse
Lists the Amazon Kendra indexes that you have created.
Examples:
Request syntax with placeholder values
resp = client.list_indices({
next_token: "NextToken",
max_results: 1,
})
Response structure
resp.index_configuration_summary_items #=> Array
resp.index_configuration_summary_items[0].name #=> String
resp.index_configuration_summary_items[0].id #=> String
resp.index_configuration_summary_items[0].edition #=> String, one of "DEVELOPER_EDITION", "ENTERPRISE_EDITION"
resp.index_configuration_summary_items[0].created_at #=> Time
resp.index_configuration_summary_items[0].updated_at #=> Time
resp.index_configuration_summary_items[0].status #=> String, one of "CREATING", "ACTIVE", "DELETING", "FAILED", "UPDATING", "SYSTEM_UPDATING"
resp.next_token #=> String
Options Hash (options):
-
:next_token
(String)
—
If the previous response was incomplete (because there is more data to retrieve), Amazon Kendra returns a pagination token in the response. You can use this pagination token to retrieve the next set of indexes (
DataSourceSummaryItems
). -
:max_results
(Integer)
—
The maximum number of data sources to return.
Returns:
-
(Types::ListIndicesResponse)
—
Returns a response object which responds to the following methods:
- #index_configuration_summary_items => Array<Types::IndexConfigurationSummary>
- #next_token => String
See Also:
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Gets a list of tags associated with a specified resource. Indexes, FAQs, and data sources can have tags associated with them.
Examples:
Request syntax with placeholder values
resp = client.list_tags_for_resource({
resource_arn: "AmazonResourceName", # required
})
Response structure
resp.tags #=> Array
resp.tags[0].key #=> String
resp.tags[0].value #=> String
Options Hash (options):
-
:resource_arn
(required, String)
—
The Amazon Resource Name (ARN) of the index, FAQ, or data source to get a list of tags for.
Returns:
-
(Types::ListTagsForResourceResponse)
—
Returns a response object which responds to the following methods:
- #tags => Array<Types::Tag>
See Also:
#query(options = {}) ⇒ Types::QueryResult
Searches an active index. Use this API to search your documents using query. The Query
operation enables to do faceted search and to filter results based on document attributes.
It also enables you to provide user context that Amazon Kendra uses to enforce document access control in the search results.
Amazon Kendra searches your index for text content and question and answer (FAQ) content. By default the response contains three types of results.
-
Relevant passages
-
Matching FAQs
-
Relevant documents
You can specify that the query return only one type of result using the QueryResultTypeConfig
parameter.
Each query returns the 100 most relevant results.
Examples:
Request syntax with placeholder values
resp = client.query({
index_id: "IndexId", # required
query_text: "QueryText", # required
attribute_filter: {
and_all_filters: [
{
# recursive AttributeFilter
},
],
or_all_filters: [
{
# recursive AttributeFilter
},
],
not_filter: {
# recursive AttributeFilter
},
equals_to: {
key: "DocumentAttributeKey", # required
value: { # required
string_value: "DocumentAttributeStringValue",
string_list_value: ["String"],
long_value: 1,
date_value: Time.now,
},
},
contains_all: {
key: "DocumentAttributeKey", # required
value: { # required
string_value: "DocumentAttributeStringValue",
string_list_value: ["String"],
long_value: 1,
date_value: Time.now,
},
},
contains_any: {
key: "DocumentAttributeKey", # required
value: { # required
string_value: "DocumentAttributeStringValue",
string_list_value: ["String"],
long_value: 1,
date_value: Time.now,
},
},
greater_than: {
key: "DocumentAttributeKey", # required
value: { # required
string_value: "DocumentAttributeStringValue",
string_list_value: ["String"],
long_value: 1,
date_value: Time.now,
},
},
greater_than_or_equals: {
key: "DocumentAttributeKey", # required
value: { # required
string_value: "DocumentAttributeStringValue",
string_list_value: ["String"],
long_value: 1,
date_value: Time.now,
},
},
less_than: {
key: "DocumentAttributeKey", # required
value: { # required
string_value: "DocumentAttributeStringValue",
string_list_value: ["String"],
long_value: 1,
date_value: Time.now,
},
},
less_than_or_equals: {
key: "DocumentAttributeKey", # required
value: { # required
string_value: "DocumentAttributeStringValue",
string_list_value: ["String"],
long_value: 1,
date_value: Time.now,
},
},
},
facets: [
{
document_attribute_key: "DocumentAttributeKey",
},
],
requested_document_attributes: ["DocumentAttributeKey"],
query_result_type_filter: "DOCUMENT", # accepts DOCUMENT, QUESTION_ANSWER, ANSWER
page_number: 1,
page_size: 1,
sorting_configuration: {
document_attribute_key: "DocumentAttributeKey", # required
sort_order: "DESC", # required, accepts DESC, ASC
},
user_context: {
token: "Token",
},
})
Response structure
resp.query_id #=> String
resp.result_items #=> Array
resp.result_items[0].id #=> String
resp.result_items[0].type #=> String, one of "DOCUMENT", "QUESTION_ANSWER", "ANSWER"
resp.result_items[0].additional_attributes #=> Array
resp.result_items[0].additional_attributes[0].key #=> String
resp.result_items[0].additional_attributes[0].value_type #=> String, one of "TEXT_WITH_HIGHLIGHTS_VALUE"
resp.result_items[0].additional_attributes[0].value.text_with_highlights_value.text #=> String
resp.result_items[0].additional_attributes[0].value.text_with_highlights_value.highlights #=> Array
resp.result_items[0].additional_attributes[0].value.text_with_highlights_value.highlights[0].begin_offset #=> Integer
resp.result_items[0].additional_attributes[0].value.text_with_highlights_value.highlights[0].end_offset #=> Integer
resp.result_items[0].additional_attributes[0].value.text_with_highlights_value.highlights[0].top_answer #=> true/false
resp.result_items[0].document_id #=> String
resp.result_items[0].document_title.text #=> String
resp.result_items[0].document_title.highlights #=> Array
resp.result_items[0].document_title.highlights[0].begin_offset #=> Integer
resp.result_items[0].document_title.highlights[0].end_offset #=> Integer
resp.result_items[0].document_title.highlights[0].top_answer #=> true/false
resp.result_items[0].document_excerpt.text #=> String
resp.result_items[0].document_excerpt.highlights #=> Array
resp.result_items[0].document_excerpt.highlights[0].begin_offset #=> Integer
resp.result_items[0].document_excerpt.highlights[0].end_offset #=> Integer
resp.result_items[0].document_excerpt.highlights[0].top_answer #=> true/false
resp.result_items[0].document_uri #=> String
resp.result_items[0].document_attributes #=> Array
resp.result_items[0].document_attributes[0].key #=> String
resp.result_items[0].document_attributes[0].value.string_value #=> String
resp.result_items[0].document_attributes[0].value.string_list_value #=> Array
resp.result_items[0].document_attributes[0].value.string_list_value[0] #=> String
resp.result_items[0].document_attributes[0].value.long_value #=> Integer
resp.result_items[0].document_attributes[0].value.date_value #=> Time
resp.result_items[0].score_attributes.score_confidence #=> String, one of "VERY_HIGH", "HIGH", "MEDIUM", "LOW"
resp.facet_results #=> Array
resp.facet_results[0].document_attribute_key #=> String
resp.facet_results[0].document_attribute_value_type #=> String, one of "STRING_VALUE", "STRING_LIST_VALUE", "LONG_VALUE", "DATE_VALUE"
resp.facet_results[0].document_attribute_value_count_pairs #=> Array
resp.facet_results[0].document_attribute_value_count_pairs[0].document_attribute_value.string_value #=> String
resp.facet_results[0].document_attribute_value_count_pairs[0].document_attribute_value.string_list_value #=> Array
resp.facet_results[0].document_attribute_value_count_pairs[0].document_attribute_value.string_list_value[0] #=> String
resp.facet_results[0].document_attribute_value_count_pairs[0].document_attribute_value.long_value #=> Integer
resp.facet_results[0].document_attribute_value_count_pairs[0].document_attribute_value.date_value #=> Time
resp.facet_results[0].document_attribute_value_count_pairs[0].count #=> Integer
resp.total_number_of_results #=> Integer
Options Hash (options):
-
:index_id
(required, String)
—
The unique identifier of the index to search. The identifier is returned in the response from the operation.
-
:query_text
(required, String)
—
The text to search for.
-
:attribute_filter
(Types::AttributeFilter)
—
Enables filtered searches based on document attributes. You can only provide one attribute filter; however, the
AndAllFilters
,NotFilter
, andOrAllFilters
parameters contain a list of other filters.The
AttributeFilter
parameter enables you to create a set of filtering rules that a document must satisfy to be included in the query results. -
:facets
(Array<Types::Facet>)
—
An array of documents attributes. Amazon Kendra returns a count for each attribute key specified. You can use this information to help narrow the search for your user.
-
:requested_document_attributes
(Array<String>)
—
An array of document attributes to include in the response. No other document attributes are included in the response. By default all document attributes are included in the response.
-
:query_result_type_filter
(String)
—
Sets the type of query. Only results for the specified query type are returned.
-
:page_number
(Integer)
—
Query results are returned in pages the size of the
PageSize
parameter. By default, Amazon Kendra returns the first page of results. Use this parameter to get result pages after the first one. -
:page_size
(Integer)
—
Sets the number of results that are returned in each page of results. The default page size is 10. The maximum number of results returned is 100. If you ask for more than 100 results, only 100 are returned.
-
:sorting_configuration
(Types::SortingConfiguration)
—
Provides information that determines how the results of the query are sorted. You can set the field that Amazon Kendra should sort the results on, and specify whether the results should be sorted in ascending or descending order. In the case of ties in sorting the results, the results are sorted by relevance.
If you don\'t provide sorting configuration, the results are sorted by the relevance that Amazon Kendra determines for the result.
-
:user_context
(Types::UserContext)
—
The user context token.
Returns:
-
(Types::QueryResult)
—
Returns a response object which responds to the following methods:
- #query_id => String
- #result_items => Array<Types::QueryResultItem>
- #facet_results => Array<Types::FacetResult>
- #total_number_of_results => Integer
See Also:
#start_data_source_sync_job(options = {}) ⇒ Types::StartDataSourceSyncJobResponse
Starts a synchronization job for a data source. If a synchronization job is already in progress, Amazon Kendra returns a ResourceInUseException
exception.
Examples:
Request syntax with placeholder values
resp = client.start_data_source_sync_job({
id: "DataSourceId", # required
index_id: "IndexId", # required
})
Response structure
resp.execution_id #=> String
Options Hash (options):
-
:id
(required, String)
—
The identifier of the data source to synchronize.
-
:index_id
(required, String)
—
The identifier of the index that contains the data source.
Returns:
-
(Types::StartDataSourceSyncJobResponse)
—
Returns a response object which responds to the following methods:
- #execution_id => String
See Also:
#stop_data_source_sync_job(options = {}) ⇒ Struct
Stops a running synchronization job. You can't stop a scheduled synchronization job.
Examples:
Request syntax with placeholder values
resp = client.stop_data_source_sync_job({
id: "DataSourceId", # required
index_id: "IndexId", # required
})
Options Hash (options):
-
:id
(required, String)
—
The identifier of the data source for which to stop the synchronization jobs.
-
:index_id
(required, String)
—
The identifier of the index that contains the data source.
Returns:
-
(Struct)
—
Returns an empty response.
See Also:
#submit_feedback(options = {}) ⇒ Struct
Enables you to provide feedback to Amazon Kendra to improve the performance of the service.
Examples:
Request syntax with placeholder values
resp = client.submit_feedback({
index_id: "IndexId", # required
query_id: "QueryId", # required
click_feedback_items: [
{
result_id: "ResultId", # required
click_time: Time.now, # required
},
],
relevance_feedback_items: [
{
result_id: "ResultId", # required
relevance_value: "RELEVANT", # required, accepts RELEVANT, NOT_RELEVANT
},
],
})
Options Hash (options):
-
:index_id
(required, String)
—
The identifier of the index that was queried.
-
:query_id
(required, String)
—
The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the operation.
-
:click_feedback_items
(Array<Types::ClickFeedback>)
—
Tells Amazon Kendra that a particular search result link was chosen by the user.
-
:relevance_feedback_items
(Array<Types::RelevanceFeedback>)
—
Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.
Returns:
-
(Struct)
—
Returns an empty response.
See Also:
#tag_resource(options = {}) ⇒ Struct
Adds the specified tag to the specified index, FAQ, or data source resource. If the tag already exists, the existing value is replaced with the new value.
Examples:
Request syntax with placeholder values
resp = client.tag_resource({
resource_arn: "AmazonResourceName", # required
tags: [ # required
{
key: "TagKey", # required
value: "TagValue", # required
},
],
})
Options Hash (options):
-
:resource_arn
(required, String)
—
The Amazon Resource Name (ARN) of the index, FAQ, or data source to tag.
-
:tags
(required, Array<Types::Tag>)
—
A list of tag keys to add to the index, FAQ, or data source. If a tag already exists, the existing value is replaced with the new value.
Returns:
-
(Struct)
—
Returns an empty response.
See Also:
#untag_resource(options = {}) ⇒ Struct
Removes a tag from an index, FAQ, or a data source.
Examples:
Request syntax with placeholder values
resp = client.untag_resource({
resource_arn: "AmazonResourceName", # required
tag_keys: ["TagKey"], # required
})
Options Hash (options):
-
:resource_arn
(required, String)
—
The Amazon Resource Name (ARN) of the index, FAQ, or data source to remove the tag from.
-
:tag_keys
(required, Array<String>)
—
A list of tag keys to remove from the index, FAQ, or data source. If a tag key does not exist on the resource, it is ignored.
Returns:
-
(Struct)
—
Returns an empty response.
See Also:
#update_data_source(options = {}) ⇒ Struct
Updates an existing Amazon Kendra data source.
Examples:
Request syntax with placeholder values
resp = client.update_data_source({
id: "DataSourceId", # required
name: "DataSourceName",
index_id: "IndexId", # required
configuration: {
s3_configuration: {
bucket_name: "S3BucketName", # required
inclusion_prefixes: ["DataSourceInclusionsExclusionsStringsMember"],
inclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
exclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
documents_metadata_configuration: {
s3_prefix: "S3ObjectKey",
},
access_control_list_configuration: {
key_path: "S3ObjectKey",
},
},
share_point_configuration: {
share_point_version: "SHAREPOINT_ONLINE", # required, accepts SHAREPOINT_ONLINE
urls: ["Url"], # required
secret_arn: "SecretArn", # required
crawl_attachments: false,
use_change_log: false,
inclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
exclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
vpc_configuration: {
subnet_ids: ["SubnetId"], # required
security_group_ids: ["VpcSecurityGroupId"], # required
},
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
document_title_field_name: "DataSourceFieldName",
disable_local_groups: false,
},
database_configuration: {
database_engine_type: "RDS_AURORA_MYSQL", # required, accepts RDS_AURORA_MYSQL, RDS_AURORA_POSTGRESQL, RDS_MYSQL, RDS_POSTGRESQL
connection_configuration: { # required
database_host: "DatabaseHost", # required
database_port: 1, # required
database_name: "DatabaseName", # required
table_name: "TableName", # required
secret_arn: "SecretArn", # required
},
vpc_configuration: {
subnet_ids: ["SubnetId"], # required
security_group_ids: ["VpcSecurityGroupId"], # required
},
column_configuration: { # required
document_id_column_name: "ColumnName", # required
document_data_column_name: "ColumnName", # required
document_title_column_name: "ColumnName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
change_detecting_columns: ["ColumnName"], # required
},
acl_configuration: {
allowed_groups_column_name: "ColumnName", # required
},
sql_configuration: {
query_identifiers_enclosing_option: "DOUBLE_QUOTES", # accepts DOUBLE_QUOTES, NONE
},
},
salesforce_configuration: {
server_url: "Url", # required
secret_arn: "SecretArn", # required
standard_object_configurations: [
{
name: "ACCOUNT", # required, accepts ACCOUNT, CAMPAIGN, CASE, CONTACT, CONTRACT, DOCUMENT, GROUP, IDEA, LEAD, OPPORTUNITY, PARTNER, PRICEBOOK, PRODUCT, PROFILE, SOLUTION, TASK, USER
document_data_field_name: "DataSourceFieldName", # required
document_title_field_name: "DataSourceFieldName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
},
],
knowledge_article_configuration: {
included_states: ["DRAFT"], # required, accepts DRAFT, PUBLISHED, ARCHIVED
standard_knowledge_article_type_configuration: {
document_data_field_name: "DataSourceFieldName", # required
document_title_field_name: "DataSourceFieldName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
},
custom_knowledge_article_type_configurations: [
{
name: "SalesforceCustomKnowledgeArticleTypeName", # required
document_data_field_name: "DataSourceFieldName", # required
document_title_field_name: "DataSourceFieldName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
},
],
},
chatter_feed_configuration: {
document_data_field_name: "DataSourceFieldName", # required
document_title_field_name: "DataSourceFieldName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
include_filter_types: ["ACTIVE_USER"], # accepts ACTIVE_USER, STANDARD_USER
},
crawl_attachments: false,
standard_object_attachment_configuration: {
document_title_field_name: "DataSourceFieldName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
},
include_attachment_file_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
exclude_attachment_file_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
},
one_drive_configuration: {
tenant_domain: "TenantDomain", # required
secret_arn: "SecretArn", # required
one_drive_users: { # required
one_drive_user_list: ["OneDriveUser"],
one_drive_user_s3_path: {
bucket: "S3BucketName", # required
key: "S3ObjectKey", # required
},
},
inclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
exclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
disable_local_groups: false,
},
service_now_configuration: {
host_url: "ServiceNowHostUrl", # required
secret_arn: "SecretArn", # required
service_now_build_version: "LONDON", # required, accepts LONDON, OTHERS
knowledge_article_configuration: {
crawl_attachments: false,
include_attachment_file_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
exclude_attachment_file_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
document_data_field_name: "DataSourceFieldName", # required
document_title_field_name: "DataSourceFieldName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
},
service_catalog_configuration: {
crawl_attachments: false,
include_attachment_file_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
exclude_attachment_file_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
document_data_field_name: "DataSourceFieldName", # required
document_title_field_name: "DataSourceFieldName",
field_mappings: [
{
data_source_field_name: "DataSourceFieldName", # required
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName", # required
},
],
},
},
confluence_configuration: {
server_url: "Url", # required
secret_arn: "SecretArn", # required
version: "CLOUD", # required, accepts CLOUD, SERVER
space_configuration: {
crawl_personal_spaces: false,
crawl_archived_spaces: false,
include_spaces: ["ConfluenceSpaceIdentifier"],
exclude_spaces: ["ConfluenceSpaceIdentifier"],
space_field_mappings: [
{
data_source_field_name: "DISPLAY_URL", # accepts DISPLAY_URL, ITEM_TYPE, SPACE_KEY, URL
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName",
},
],
},
page_configuration: {
page_field_mappings: [
{
data_source_field_name: "AUTHOR", # accepts AUTHOR, CONTENT_STATUS, CREATED_DATE, DISPLAY_URL, ITEM_TYPE, LABELS, MODIFIED_DATE, PARENT_ID, SPACE_KEY, SPACE_NAME, URL, VERSION
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName",
},
],
},
blog_configuration: {
blog_field_mappings: [
{
data_source_field_name: "AUTHOR", # accepts AUTHOR, DISPLAY_URL, ITEM_TYPE, LABELS, PUBLISH_DATE, SPACE_KEY, SPACE_NAME, URL, VERSION
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName",
},
],
},
attachment_configuration: {
crawl_attachments: false,
attachment_field_mappings: [
{
data_source_field_name: "AUTHOR", # accepts AUTHOR, CONTENT_TYPE, CREATED_DATE, DISPLAY_URL, FILE_SIZE, ITEM_TYPE, PARENT_ID, SPACE_KEY, SPACE_NAME, URL, VERSION
date_field_format: "DataSourceDateFieldFormat",
index_field_name: "IndexFieldName",
},
],
},
vpc_configuration: {
subnet_ids: ["SubnetId"], # required
security_group_ids: ["VpcSecurityGroupId"], # required
},
inclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
exclusion_patterns: ["DataSourceInclusionsExclusionsStringsMember"],
},
},
description: "Description",
schedule: "ScanSchedule",
role_arn: "RoleArn",
})
Options Hash (options):
-
:id
(required, String)
—
The unique identifier of the data source to update.
-
:name
(String)
—
The name of the data source to update. The name of the data source can\'t be updated. To rename a data source you must delete the data source and re-create it.
-
:index_id
(required, String)
—
The identifier of the index that contains the data source to update.
-
:configuration
(Types::DataSourceConfiguration)
—
Configuration information for a Amazon Kendra data source.
-
:description
(String)
—
The new description for the data source.
-
:schedule
(String)
—
The new update schedule for the data source.
-
:role_arn
(String)
—
The Amazon Resource Name (ARN) of the new role to use when the data source is accessing resources on your behalf.
Returns:
-
(Struct)
—
Returns an empty response.
See Also:
#update_index(options = {}) ⇒ Struct
Updates an existing Amazon Kendra index.
Examples:
Request syntax with placeholder values
resp = client.update_index({
id: "IndexId", # required
name: "IndexName",
role_arn: "RoleArn",
description: "Description",
document_metadata_configuration_updates: [
{
name: "DocumentMetadataConfigurationName", # required
type: "STRING_VALUE", # required, accepts STRING_VALUE, STRING_LIST_VALUE, LONG_VALUE, DATE_VALUE
relevance: {
freshness: false,
importance: 1,
duration: "Duration",
rank_order: "ASCENDING", # accepts ASCENDING, DESCENDING
value_importance_map: {
"ValueImportanceMapKey" => 1,
},
},
search: {
facetable: false,
searchable: false,
displayable: false,
sortable: false,
},
},
],
capacity_units: {
storage_capacity_units: 1, # required
query_capacity_units: 1, # required
},
user_token_configurations: [
{
jwt_token_type_configuration: {
key_location: "URL", # required, accepts URL, SECRET_MANAGER
url: "Url",
secret_manager_arn: "RoleArn",
user_name_attribute_field: "UserNameAttributeField",
group_attribute_field: "GroupAttributeField",
issuer: "Issuer",
claim_regex: "ClaimRegex",
},
json_token_type_configuration: {
user_name_attribute_field: "String", # required
group_attribute_field: "String", # required
},
},
],
user_context_policy: "ATTRIBUTE_FILTER", # accepts ATTRIBUTE_FILTER, USER_TOKEN
})
Options Hash (options):
-
:id
(required, String)
—
The identifier of the index to update.
-
:name
(String)
—
The name of the index to update.
-
:role_arn
(String)
—
A new IAM role that gives Amazon Kendra permission to access your Amazon CloudWatch logs.
-
:description
(String)
—
A new description for the index.
-
:document_metadata_configuration_updates
(Array<Types::DocumentMetadataConfiguration>)
—
The document metadata to update.
-
:capacity_units
(Types::CapacityUnitsConfiguration)
—
Sets the number of addtional storage and query capacity units that should be used by the index. You can change the capacity of the index up to 5 times per day.
If you are using extra storage units, you can\'t reduce the storage capacity below that required to meet the storage needs for your index.
-
:user_token_configurations
(Array<Types::UserTokenConfiguration>)
—
The user token configuration.
-
:user_context_policy
(String)
—
The user user token context policy.
Returns:
-
(Struct)
—
Returns an empty response.
See Also:
#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
Parameters:
-
waiter_name
(Symbol)
—
The name of the waiter. See #waiter_names for a full list of supported waiters.
-
params
(Hash)
(defaults to: {})
—
Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.
Yield Parameters:
-
waiter
(Waiters::Waiter)
—
Yields a Waiter object that can be configured prior to waiting.
Returns:
-
(Boolean)
—
Returns
true
if the waiter was successful.
Raises:
-
(Errors::FailureStateError)
—
Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.
-
(Errors::TooManyAttemptsError)
—
Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.
-
(Errors::UnexpectedError)
—
Raised when an error is encounted while polling for a resource that is not expected.
-
(Errors::NoSuchWaiterError)
—
Raised when you request to wait for an unknown state.
#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: |
---|
Returns:
-
(Array<Symbol>)
—
the list of supported waiters.