create_data_source
¶
create_data_source(
application_id: ApplicationId,
index_id: IndexId,
display_name: DataSourceName,
configuration: DataSourceConfiguration,
*,
config_overrides: Optional[QBusinessClientConfig] = None,
vpc_configuration: Optional[DataSourceVpcConfiguration] = None,
description: Optional[Description] = None,
tags: Optional[Tags] = None,
sync_schedule: Optional[SyncSchedule] = None,
role_arn: Optional[RoleArn] = None,
client_token: Optional[ClientToken] = None,
document_enrichment_configuration: Optional[DocumentEnrichmentConfiguration] = None,
media_extraction_configuration: Optional[MediaExtractionConfiguration] = None,
) -> CreateDataSourceResponse
Creates a data source connector for an Amazon Q Business application.
CreateDataSource is a synchronous operation. The operation returns 200 if the data source was successfully created. Otherwise, an exception is raised.
Parameters:
-
application_id(ApplicationId) –The identifier of the Amazon Q Business application the data source will be attached to.
-
index_id(IndexId) –The identifier of the index that you want to use with the data source connector.
-
display_name(DataSourceName) –A name for the data source connector.
-
configuration(DataSourceConfiguration) –Configuration information to connect your data source repository to Amazon Q Business. Use this parameter to provide a JSON schema with configuration information specific to your data source connector.
Each data source has a JSON schema provided by Amazon Q Business that you must use. For example, the Amazon S3 and Web Crawler connectors require the following JSON schemas:
You can find configuration templates for your specific data source using the following steps:
-
Navigate to the Supported connectors page in the Amazon Q Business User Guide, and select the data source of your choice.
-
Then, from your specific data source connector page, select Using the API. You will find the JSON schema for your data source, including parameter descriptions, in this section.
-
-
vpc_configuration(Optional[DataSourceVpcConfiguration], default:None) –Configuration information for an Amazon VPC (Virtual Private Cloud) to connect to your data source. For more information, see Using Amazon VPC with Amazon Q Business connectors.
-
description(Optional[Description], default:None) –A description for the data source connector.
-
tags(Optional[Tags], default:None) –A list of key-value pairs that identify or categorize the data source connector. You can also use tags to help control access to the data source connector. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
-
sync_schedule(Optional[SyncSchedule], default:None) –Sets the frequency for Amazon Q Business to check the documents in your data source repository and update your index. If you don't set a schedule, Amazon Q Business won't periodically update the index.
Specify a
cron-format schedule string or an empty string to indicate that the index is updated on demand. You can't specify theScheduleparameter when theTypeparameter is set toCUSTOM. If you do, you receive aValidationExceptionexception. -
role_arn(Optional[RoleArn], default:None) –The Amazon Resource Name (ARN) of an IAM role with permission to access the data source and required resources. This field is required for all connector types except custom connectors, where it is optional.
-
client_token(Optional[ClientToken], default:None) –A token you provide to identify a request to create a data source connector. Multiple calls to the
CreateDataSourceAPI with the same client token will create only one data source connector. -
media_extraction_configuration(Optional[MediaExtractionConfiguration], default:None) –The configuration for extracting information from media in documents during ingestion.
Raises:
-
AccessDeniedException–You don't have access to perform this action. Make sure you have the required permission policies and user accounts and try again.
-
ConflictException–You are trying to perform an action that conflicts with the current status of your resource. Fix any inconsistencies with your resources and try again.
-
InternalServerException–An issue occurred with the internal server used for your Amazon Q Business service. Wait some minutes and try again, or contact Support for help.
-
ResourceNotFoundException–The application or plugin resource you want to use doesn’t exist. Make sure you have provided the correct resource and try again.
-
ServiceQuotaExceededException–You have exceeded the set limits for your Amazon Q Business service.
-
ThrottlingException–The request was denied due to throttling. Reduce the number of requests and try again.
-
ValidationException–The input doesn't meet the constraints set by the Amazon Q Business service. Provide the correct input and try again.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_qbusiness/_services/q_business.py
4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 | |