QBusiness / Client / get_data_source

get_data_source#

QBusiness.Client.get_data_source(**kwargs)#

Gets information about an existing Amazon Q data source connector.

See also: AWS API Documentation

Request Syntax

response = client.get_data_source(
    applicationId='string',
    dataSourceId='string',
    indexId='string'
)
Parameters:
  • applicationId (string) –

    [REQUIRED]

    The identifier of the Amazon Q application.

  • dataSourceId (string) –

    [REQUIRED]

    The identifier of the data source connector.

  • indexId (string) –

    [REQUIRED]

    The identfier of the index used with the data source connector.

Return type:

dict

Returns:

Response Syntax

{
    'applicationId': 'string',
    'configuration': {...}|[...]|123|123.4|'string'|True|None,
    'createdAt': datetime(2015, 1, 1),
    'dataSourceArn': 'string',
    'dataSourceId': 'string',
    'description': 'string',
    'displayName': 'string',
    'documentEnrichmentConfiguration': {
        'inlineConfigurations': [
            {
                'condition': {
                    'key': 'string',
                    'operator': 'GREATER_THAN'|'GREATER_THAN_OR_EQUALS'|'LESS_THAN'|'LESS_THAN_OR_EQUALS'|'EQUALS'|'NOT_EQUALS'|'CONTAINS'|'NOT_CONTAINS'|'EXISTS'|'NOT_EXISTS'|'BEGINS_WITH',
                    'value': {
                        'dateValue': datetime(2015, 1, 1),
                        'longValue': 123,
                        'stringListValue': [
                            'string',
                        ],
                        'stringValue': 'string'
                    }
                },
                'documentContentOperator': 'DELETE',
                'target': {
                    'attributeValueOperator': 'DELETE',
                    'key': 'string',
                    'value': {
                        'dateValue': datetime(2015, 1, 1),
                        'longValue': 123,
                        'stringListValue': [
                            'string',
                        ],
                        'stringValue': 'string'
                    }
                }
            },
        ],
        'postExtractionHookConfiguration': {
            'invocationCondition': {
                'key': 'string',
                'operator': 'GREATER_THAN'|'GREATER_THAN_OR_EQUALS'|'LESS_THAN'|'LESS_THAN_OR_EQUALS'|'EQUALS'|'NOT_EQUALS'|'CONTAINS'|'NOT_CONTAINS'|'EXISTS'|'NOT_EXISTS'|'BEGINS_WITH',
                'value': {
                    'dateValue': datetime(2015, 1, 1),
                    'longValue': 123,
                    'stringListValue': [
                        'string',
                    ],
                    'stringValue': 'string'
                }
            },
            'lambdaArn': 'string',
            'roleArn': 'string',
            's3BucketName': 'string'
        },
        'preExtractionHookConfiguration': {
            'invocationCondition': {
                'key': 'string',
                'operator': 'GREATER_THAN'|'GREATER_THAN_OR_EQUALS'|'LESS_THAN'|'LESS_THAN_OR_EQUALS'|'EQUALS'|'NOT_EQUALS'|'CONTAINS'|'NOT_CONTAINS'|'EXISTS'|'NOT_EXISTS'|'BEGINS_WITH',
                'value': {
                    'dateValue': datetime(2015, 1, 1),
                    'longValue': 123,
                    'stringListValue': [
                        'string',
                    ],
                    'stringValue': 'string'
                }
            },
            'lambdaArn': 'string',
            'roleArn': 'string',
            's3BucketName': 'string'
        }
    },
    'error': {
        'errorCode': 'InternalError'|'InvalidRequest'|'ResourceInactive'|'ResourceNotFound',
        'errorMessage': 'string'
    },
    'indexId': 'string',
    'roleArn': 'string',
    'status': 'PENDING_CREATION'|'CREATING'|'ACTIVE'|'DELETING'|'FAILED'|'UPDATING',
    'syncSchedule': 'string',
    'type': 'string',
    'updatedAt': datetime(2015, 1, 1),
    'vpcConfiguration': {
        'securityGroupIds': [
            'string',
        ],
        'subnetIds': [
            'string',
        ]
    }
}

Response Structure

  • (dict) –

    • applicationId (string) –

      The identifier of the Amazon Q application.

    • configuration (document) –

      The details of how the data source connector is configured.

    • createdAt (datetime) –

      The Unix timestamp when the data source connector was created.

    • dataSourceArn (string) –

      The Amazon Resource Name (ARN) of the data source.

    • dataSourceId (string) –

      The identifier of the data source connector.

    • description (string) –

      The description for the data source connector.

    • displayName (string) –

      The name for the data source connector.

    • documentEnrichmentConfiguration (dict) –

      Provides the configuration information for altering document metadata and content during the document ingestion process.

      For more information, see Custom document enrichment.

      • inlineConfigurations (list) –

        Configuration information to alter document attributes or metadata fields and content when ingesting documents into Amazon Q.

        • (dict) –

          Provides the configuration information for applying basic logic to alter document metadata and content when ingesting documents into Amazon Q.

          To apply advanced logic, to go beyond what you can do with basic logic, see HookConfiguration.

          For more information, see Custom document enrichment.

          • condition (dict) –

            The condition used for the target document attribute or metadata field when ingesting documents into Amazon Q. You use this with DocumentAttributeTarget to apply the condition.

            For example, you can create the ‘Department’ target field and have it prefill department names associated with the documents based on information in the ‘Source_URI’ field. Set the condition that if the ‘Source_URI’ field contains ‘financial’ in its URI value, then prefill the target field ‘Department’ with the target value ‘Finance’ for the document.

            Amazon Q can’t create a target field if it has not already been created as an index field. After you create your index field, you can create a document metadata field using DocumentAttributeTarget. Amazon Q then will map your newly created metadata field to your index field.

            • key (string) –

              The identifier of the document attribute used for the condition.

              For example, ‘Source_URI’ could be an identifier for the attribute or metadata field that contains source URIs associated with the documents.

              Amazon Q currently doesn’t support _document_body as an attribute key used for the condition.

            • operator (string) –

              The identifier of the document attribute used for the condition.

              For example, ‘Source_URI’ could be an identifier for the attribute or metadata field that contains source URIs associated with the documents.

              Amazon Kendra currently does not support _document_body as an attribute key used for the condition.

            • value (dict) –

              The value of a document attribute. You can only provide one value for a document attribute.

              Note

              This is a Tagged Union structure. Only one of the following top level keys will be set: dateValue, longValue, stringListValue, stringValue. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

              'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
              
              • dateValue (datetime) –

                A date expressed as an ISO 8601 string.

                It’s important for the time zone to be included in the ISO 8601 date-time format. For example, 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

              • longValue (integer) –

                A long integer value.

              • stringListValue (list) –

                A list of strings.

                • (string) –

              • stringValue (string) –

                A string.

          • documentContentOperator (string) –

            TRUE to delete content if the condition used for the target attribute is met.

          • target (dict) –

            The target document attribute or metadata field you want to alter when ingesting documents into Amazon Q.

            For example, you can delete all customer identification numbers associated with the documents, stored in the document metadata field called ‘Customer_ID’ by setting the target key as ‘Customer_ID’ and the deletion flag to TRUE. This removes all customer ID values in the field ‘Customer_ID’. This would scrub personally identifiable information from each document’s metadata.

            Amazon Q can’t create a target field if it has not already been created as an index field. After you create your index field, you can create a document metadata field using DocumentAttributeTarget. Amazon Q will then map your newly created document attribute to your index field.

            You can also use this with DocumentAttributeCondition.

            • attributeValueOperator (string) –

              TRUE to delete the existing target value for your specified target attribute key. You cannot create a target value and set this to TRUE.

            • key (string) –

              The identifier of the target document attribute or metadata field. For example, ‘Department’ could be an identifier for the target attribute or metadata field that includes the department names associated with the documents.

            • value (dict) –

              The value of a document attribute. You can only provide one value for a document attribute.

              Note

              This is a Tagged Union structure. Only one of the following top level keys will be set: dateValue, longValue, stringListValue, stringValue. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

              'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
              
              • dateValue (datetime) –

                A date expressed as an ISO 8601 string.

                It’s important for the time zone to be included in the ISO 8601 date-time format. For example, 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

              • longValue (integer) –

                A long integer value.

              • stringListValue (list) –

                A list of strings.

                • (string) –

              • stringValue (string) –

                A string.

      • postExtractionHookConfiguration (dict) –

        Provides the configuration information for invoking a Lambda function in Lambda to alter document metadata and content when ingesting documents into Amazon Q.

        You can configure your Lambda function using PreExtractionHookConfiguration if you want to apply advanced alterations on the original or raw documents.

        If you want to apply advanced alterations on the Amazon Q structured documents, you must configure your Lambda function using PostExtractionHookConfiguration.

        You can only invoke one Lambda function. However, this function can invoke other functions it requires.

        For more information, see Custom document enrichment.

        • invocationCondition (dict) –

          The condition used for when a Lambda function should be invoked.

          For example, you can specify a condition that if there are empty date-time values, then Amazon Q should invoke a function that inserts the current date-time.

          • key (string) –

            The identifier of the document attribute used for the condition.

            For example, ‘Source_URI’ could be an identifier for the attribute or metadata field that contains source URIs associated with the documents.

            Amazon Q currently doesn’t support _document_body as an attribute key used for the condition.

          • operator (string) –

            The identifier of the document attribute used for the condition.

            For example, ‘Source_URI’ could be an identifier for the attribute or metadata field that contains source URIs associated with the documents.

            Amazon Kendra currently does not support _document_body as an attribute key used for the condition.

          • value (dict) –

            The value of a document attribute. You can only provide one value for a document attribute.

            Note

            This is a Tagged Union structure. Only one of the following top level keys will be set: dateValue, longValue, stringListValue, stringValue. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

            'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
            
            • dateValue (datetime) –

              A date expressed as an ISO 8601 string.

              It’s important for the time zone to be included in the ISO 8601 date-time format. For example, 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

            • longValue (integer) –

              A long integer value.

            • stringListValue (list) –

              A list of strings.

              • (string) –

            • stringValue (string) –

              A string.

        • lambdaArn (string) –

          The Amazon Resource Name (ARN) of a role with permission to run a Lambda function during ingestion. For more information, see IAM roles for Custom Document Enrichment (CDE).

        • roleArn (string) –

          The Amazon Resource Name (ARN) of a role with permission to run PreExtractionHookConfiguration and PostExtractionHookConfiguration for altering document metadata and content during the document ingestion process.

        • s3BucketName (string) –

          Stores the original, raw documents or the structured, parsed documents before and after altering them. For more information, see Data contracts for Lambda functions.

      • preExtractionHookConfiguration (dict) –

        Provides the configuration information for invoking a Lambda function in Lambda to alter document metadata and content when ingesting documents into Amazon Q.

        You can configure your Lambda function using PreExtractionHookConfiguration if you want to apply advanced alterations on the original or raw documents.

        If you want to apply advanced alterations on the Amazon Q structured documents, you must configure your Lambda function using PostExtractionHookConfiguration.

        You can only invoke one Lambda function. However, this function can invoke other functions it requires.

        For more information, see Custom document enrichment.

        • invocationCondition (dict) –

          The condition used for when a Lambda function should be invoked.

          For example, you can specify a condition that if there are empty date-time values, then Amazon Q should invoke a function that inserts the current date-time.

          • key (string) –

            The identifier of the document attribute used for the condition.

            For example, ‘Source_URI’ could be an identifier for the attribute or metadata field that contains source URIs associated with the documents.

            Amazon Q currently doesn’t support _document_body as an attribute key used for the condition.

          • operator (string) –

            The identifier of the document attribute used for the condition.

            For example, ‘Source_URI’ could be an identifier for the attribute or metadata field that contains source URIs associated with the documents.

            Amazon Kendra currently does not support _document_body as an attribute key used for the condition.

          • value (dict) –

            The value of a document attribute. You can only provide one value for a document attribute.

            Note

            This is a Tagged Union structure. Only one of the following top level keys will be set: dateValue, longValue, stringListValue, stringValue. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

            'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
            
            • dateValue (datetime) –

              A date expressed as an ISO 8601 string.

              It’s important for the time zone to be included in the ISO 8601 date-time format. For example, 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European Time.

            • longValue (integer) –

              A long integer value.

            • stringListValue (list) –

              A list of strings.

              • (string) –

            • stringValue (string) –

              A string.

        • lambdaArn (string) –

          The Amazon Resource Name (ARN) of a role with permission to run a Lambda function during ingestion. For more information, see IAM roles for Custom Document Enrichment (CDE).

        • roleArn (string) –

          The Amazon Resource Name (ARN) of a role with permission to run PreExtractionHookConfiguration and PostExtractionHookConfiguration for altering document metadata and content during the document ingestion process.

        • s3BucketName (string) –

          Stores the original, raw documents or the structured, parsed documents before and after altering them. For more information, see Data contracts for Lambda functions.

    • error (dict) –

      When the Status field value is FAILED, the ErrorMessage field contains a description of the error that caused the data source connector to fail.

      • errorCode (string) –

        The code associated with the data source sync error.

      • errorMessage (string) –

        The message explaining the data source sync error.

    • indexId (string) –

      The identifier of the index linked to the data source connector.

    • roleArn (string) –

      The Amazon Resource Name (ARN) of the role with permission to access the data source and required resources.

    • status (string) –

      The current status of the data source connector. When the Status field value is FAILED, the ErrorMessage field contains a description of the error that caused the data source connector to fail.

    • syncSchedule (string) –

      The schedule for Amazon Q to update the index.

    • type (string) –

      The type of the data source connector. For example, S3.

    • updatedAt (datetime) –

      The Unix timestamp when the data source connector was last updated.

    • vpcConfiguration (dict) –

      Configuration information for an Amazon VPC (Virtual Private Cloud) to connect to your data source.

      • securityGroupIds (list) –

        A list of identifiers of security groups within your Amazon VPC. The security groups should enable Amazon Q to connect to the data source.

        • (string) –

      • subnetIds (list) –

        A list of identifiers for subnets within your Amazon VPC. The subnets should be able to connect to each other in the VPC, and they should have outgoing access to the Internet through a NAT device.

        • (string) –

Exceptions

  • QBusiness.Client.exceptions.ResourceNotFoundException

  • QBusiness.Client.exceptions.InternalServerException

  • QBusiness.Client.exceptions.ThrottlingException

  • QBusiness.Client.exceptions.ValidationException

  • QBusiness.Client.exceptions.AccessDeniedException