Skip to content

add_application_reference_data_source async

add_application_reference_data_source(
    application_name: ApplicationName,
    current_application_version_id: ApplicationVersionId,
    reference_data_source: ReferenceDataSource,
    *,
    config_overrides: Optional[AsyncKinesisAnalyticsV2ClientConfig] = None,
) -> AddApplicationReferenceDataSourceResponse

Adds a reference data source to an existing SQL-based Kinesis Data Analytics application.

Kinesis Data Analytics reads reference data (that is, an Amazon S3 object) and creates an in-application table within your application. In the request, you provide the source (S3 bucket name and object key name), name of the in-application table to create, and the necessary mapping information that describes how data in an Amazon S3 object maps to columns in the resulting in-application table.

Parameters:

  • application_name (ApplicationName) –

    The name of an existing application.

  • current_application_version_id (ApplicationVersionId) –

    The version of the application for which you are adding the reference data source. You can use the DescribeApplication operation to get the current application version. If the version specified is not the current version, the ConcurrentModificationException is returned.

  • reference_data_source (ReferenceDataSource) –

    The reference data source can be an object in your Amazon S3 bucket. Kinesis Data Analytics reads the object and copies the data into the in-application table that is created. You provide an S3 bucket, object key name, and the resulting in-application table that is created.

Raises:

Source code in docs_src/capo_kinesis_analytics_v2/_services/async_kinesis_analytics_v2.py
async def add_application_reference_data_source(
    self,
    application_name: "capo_kinesis_analytics_v2.types.application_name.ApplicationName",
    current_application_version_id: "capo_kinesis_analytics_v2.types.application_version_id.ApplicationVersionId",
    reference_data_source: "capo_kinesis_analytics_v2.types.reference_data_source.ReferenceDataSource",
    *,
    config_overrides: Optional[AsyncKinesisAnalyticsV2ClientConfig] = None,
) -> "capo_kinesis_analytics_v2.types.add_application_reference_data_source_response.AddApplicationReferenceDataSourceResponse":
    """<p>Adds a reference data source to an existing SQL-based Kinesis Data Analytics application.</p> <p>Kinesis Data Analytics reads reference data (that is, an Amazon S3 object) and creates an in-application table within your application. In the request, you provide the source (S3 bucket name and object key name), name of the in-application table to create, and the necessary mapping information that describes how data in an Amazon S3 object maps to columns in the resulting in-application table.</p>

    Args:
        application_name: <p>The name of an existing application.</p>
        current_application_version_id: <p>The version of the application for which you are adding the reference data source. You can use the <a>DescribeApplication</a> operation to get the current application version. If the version specified is not the current version, the <code>ConcurrentModificationException</code> is returned.</p>
        reference_data_source: <p>The reference data source can be an object in your Amazon S3 bucket. Kinesis Data Analytics reads the object and copies the data into the in-application table that is created. You provide an S3 bucket, object key name, and the resulting in-application table that is created. </p>

    Raises:
        capo_kinesis_analytics_v2.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Exception thrown as a result of concurrent modifications to an application. This error can be the result of attempting to modify an application without using the current application ID.</p>
        capo_kinesis_analytics_v2.errors.invalid_argument_exception.InvalidArgumentException: <p>The specified input parameter value is not valid.</p>
        capo_kinesis_analytics_v2.errors.invalid_request_exception.InvalidRequestException: <p>The request JSON is not valid for the operation.</p>
        capo_kinesis_analytics_v2.errors.resource_in_use_exception.ResourceInUseException: <p>The application is not available for this operation.</p>
        capo_kinesis_analytics_v2.errors.resource_not_found_exception.ResourceNotFoundException: <p>Specified application can't be found.</p>
        capo_kinesis_analytics_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_kinesis_analytics_v2.types.add_application_reference_data_source_request.AddApplicationReferenceDataSourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_kinesis_analytics_v2.types.add_application_reference_data_source_response.AddApplicationReferenceDataSourceResponse"
    ]:
        import capo_kinesis_analytics_v2._operations.kinesis_analytics_20180523.add_application_reference_data_source

        (
            output,
            http_response,
        ) = await capo_kinesis_analytics_v2._operations.kinesis_analytics_20180523.add_application_reference_data_source.async_add_application_reference_data_source(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AddApplicationReferenceDataSource")
    )
    input_: capo_kinesis_analytics_v2.types.add_application_reference_data_source_request.AddApplicationReferenceDataSourceRequest = {
        "application_name": application_name,
        "current_application_version_id": current_application_version_id,
        "reference_data_source": reference_data_source,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output