/AWS1/IF_QQB=>CREATEDATASOURCE()¶
About CreateDataSource¶
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.
Method Signature¶
METHODS /AWS1/IF_QQB~CREATEDATASOURCE
IMPORTING
!IV_APPLICATIONID TYPE /AWS1/QQBAPPLICATIONID OPTIONAL
!IV_INDEXID TYPE /AWS1/QQBINDEXID OPTIONAL
!IV_DISPLAYNAME TYPE /AWS1/QQBDATASOURCENAME OPTIONAL
!IO_CONFIGURATION TYPE REF TO /AWS1/CL_RT_DOCUMENT OPTIONAL
!IO_VPCCONFIGURATION TYPE REF TO /AWS1/CL_QQBDATASOURCEVPCCONF OPTIONAL
!IV_DESCRIPTION TYPE /AWS1/QQBDESCRIPTION OPTIONAL
!IT_TAGS TYPE /AWS1/CL_QQBTAG=>TT_TAGS OPTIONAL
!IV_SYNCSCHEDULE TYPE /AWS1/QQBSYNCSCHEDULE OPTIONAL
!IV_ROLEARN TYPE /AWS1/QQBROLEARN OPTIONAL
!IV_CLIENTTOKEN TYPE /AWS1/QQBCLIENTTOKEN OPTIONAL
!IO_DOCUMENTENRICHMENTCONF TYPE REF TO /AWS1/CL_QQBDOCENRICHMENTCONF OPTIONAL
!IO_MEDIAEXTRACTIONCONF TYPE REF TO /AWS1/CL_QQBMEDIAEXTRACTCONF OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_qqbcreatedatasrcrsp
RAISING
/AWS1/CX_QQBACCESSDENIEDEX
/AWS1/CX_QQBCONFLICTEXCEPTION
/AWS1/CX_QQBINTERNALSERVEREX
/AWS1/CX_QQBRESOURCENOTFOUNDEX
/AWS1/CX_QQBSERVICEQUOTAEXCDEX
/AWS1/CX_QQBTHROTTLINGEX
/AWS1/CX_QQBVALIDATIONEX
/AWS1/CX_QQBCLIENTEXC
/AWS1/CX_QQBSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_applicationid TYPE /AWS1/QQBAPPLICATIONID /AWS1/QQBAPPLICATIONID¶
The identifier of the Amazon Q Business application the data source will be attached to.
iv_indexid TYPE /AWS1/QQBINDEXID /AWS1/QQBINDEXID¶
The identifier of the index that you want to use with the data source connector.
iv_displayname TYPE /AWS1/QQBDATASOURCENAME /AWS1/QQBDATASOURCENAME¶
A name for the data source connector.
io_configuration TYPE REF TO /AWS1/CL_RT_DOCUMENT /AWS1/CL_RT_DOCUMENT¶
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.
Optional arguments:¶
io_vpcconfiguration TYPE REF TO /AWS1/CL_QQBDATASOURCEVPCCONF /AWS1/CL_QQBDATASOURCEVPCCONF¶
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.
iv_description TYPE /AWS1/QQBDESCRIPTION /AWS1/QQBDESCRIPTION¶
A description for the data source connector.
it_tags TYPE /AWS1/CL_QQBTAG=>TT_TAGS TT_TAGS¶
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: _ . : / = + - @.
iv_syncschedule TYPE /AWS1/QQBSYNCSCHEDULE /AWS1/QQBSYNCSCHEDULE¶
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.
iv_rolearn TYPE /AWS1/QQBROLEARN /AWS1/QQBROLEARN¶
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.
iv_clienttoken TYPE /AWS1/QQBCLIENTTOKEN /AWS1/QQBCLIENTTOKEN¶
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.
io_documentenrichmentconf TYPE REF TO /AWS1/CL_QQBDOCENRICHMENTCONF /AWS1/CL_QQBDOCENRICHMENTCONF¶
documentEnrichmentConfiguration
io_mediaextractionconf TYPE REF TO /AWS1/CL_QQBMEDIAEXTRACTCONF /AWS1/CL_QQBMEDIAEXTRACTCONF¶
The configuration for extracting information from media in documents during ingestion.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_qqbcreatedatasrcrsp /AWS1/CL_QQBCREATEDATASRCRSP¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->createdatasource(
io_configuration = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
io_documentenrichmentconf = new /aws1/cl_qqbdocenrichmentconf(
io_postextractionhookconf = new /aws1/cl_qqbhookconfiguration(
io_invocationcondition = new /aws1/cl_qqbdocumentattrcond(
io_value = new /aws1/cl_qqbdocumentattrvalue(
it_stringlistvalue = VALUE /aws1/cl_qqbdocattrstrlstval_w=>tt_documentattrstringlistvalue(
( new /aws1/cl_qqbdocattrstrlstval_w( |string| ) )
)
iv_datevalue = '20150101000000.0000000'
iv_longvalue = 123
iv_stringvalue = |string|
)
iv_key = |string|
iv_operator = |string|
)
iv_lambdaarn = |string|
iv_rolearn = |string|
iv_s3bucketname = |string|
)
io_preextractionhookconf = new /aws1/cl_qqbhookconfiguration(
io_invocationcondition = new /aws1/cl_qqbdocumentattrcond(
io_value = new /aws1/cl_qqbdocumentattrvalue(
it_stringlistvalue = VALUE /aws1/cl_qqbdocattrstrlstval_w=>tt_documentattrstringlistvalue(
( new /aws1/cl_qqbdocattrstrlstval_w( |string| ) )
)
iv_datevalue = '20150101000000.0000000'
iv_longvalue = 123
iv_stringvalue = |string|
)
iv_key = |string|
iv_operator = |string|
)
iv_lambdaarn = |string|
iv_rolearn = |string|
iv_s3bucketname = |string|
)
it_inlineconfigurations = VALUE /aws1/cl_qqbinlinedocenrichm00=>tt_inlinedocenrichmentconfs(
(
new /aws1/cl_qqbinlinedocenrichm00(
io_condition = new /aws1/cl_qqbdocumentattrcond(
io_value = new /aws1/cl_qqbdocumentattrvalue(
it_stringlistvalue = VALUE /aws1/cl_qqbdocattrstrlstval_w=>tt_documentattrstringlistvalue(
( new /aws1/cl_qqbdocattrstrlstval_w( |string| ) )
)
iv_datevalue = '20150101000000.0000000'
iv_longvalue = 123
iv_stringvalue = |string|
)
iv_key = |string|
iv_operator = |string|
)
io_target = new /aws1/cl_qqbdocumentattrtarget(
io_value = new /aws1/cl_qqbdocumentattrvalue(
it_stringlistvalue = VALUE /aws1/cl_qqbdocattrstrlstval_w=>tt_documentattrstringlistvalue(
( new /aws1/cl_qqbdocattrstrlstval_w( |string| ) )
)
iv_datevalue = '20150101000000.0000000'
iv_longvalue = 123
iv_stringvalue = |string|
)
iv_attributevalueoperator = |string|
iv_key = |string|
)
iv_documentcontentoperator = |string|
)
)
)
)
io_mediaextractionconf = new /aws1/cl_qqbmediaextractconf(
io_audioextractionconf = new /aws1/cl_qqbaudioextractconf( |string| )
io_imageextractionconf = new /aws1/cl_qqbimageextractconf( |string| )
io_videoextractionconf = new /aws1/cl_qqbvideoextractconf( |string| )
)
io_vpcconfiguration = new /aws1/cl_qqbdatasourcevpcconf(
it_securitygroupids = VALUE /aws1/cl_qqbsecuritygroupids_w=>tt_securitygroupids(
( new /aws1/cl_qqbsecuritygroupids_w( |string| ) )
)
it_subnetids = VALUE /aws1/cl_qqbsubnetids_w=>tt_subnetids(
( new /aws1/cl_qqbsubnetids_w( |string| ) )
)
)
it_tags = VALUE /aws1/cl_qqbtag=>tt_tags(
(
new /aws1/cl_qqbtag(
iv_key = |string|
iv_value = |string|
)
)
)
iv_applicationid = |string|
iv_clienttoken = |string|
iv_description = |string|
iv_displayname = |string|
iv_indexid = |string|
iv_rolearn = |string|
iv_syncschedule = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_datasourceid = lo_result->get_datasourceid( ).
lv_datasourcearn = lo_result->get_datasourcearn( ).
ENDIF.