This documentation is for version 1 of the Amazon Kinesis Data Analytics API, which only supports SQL applications. Version 2 of the API supports SQL and Java applications. For more information about version 2, see Amazon Kinesis Data Analytics API V2 Documentation.
Adds a reference data source to an existing application.
Amazon Kinesis 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 Amazon S3 object maps to columns in the resulting in-application table.
For conceptual information, see Configuring Application Input. For the limits on data sources you can add to your application, see Limits.
This operation requires permissions to perform the kinesisanalytics:AddApplicationOutput action.
Parameters:
-
application_name
(ApplicationName)
–
Name of an existing application.
-
current_application_version_id
(ApplicationVersionId)
–
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. Amazon Kinesis 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. You must also provide an IAM role with the necessary permissions that Amazon Kinesis Analytics can assume to read the object from your S3 bucket on your behalf.
Raises:
Source code in docs_src/capo_kinesis_analytics/_services/kinesis_analytics.py
| def add_application_reference_data_source(
self,
application_name: "capo_kinesis_analytics.types.application_name.ApplicationName",
current_application_version_id: "capo_kinesis_analytics.types.application_version_id.ApplicationVersionId",
reference_data_source: "capo_kinesis_analytics.types.reference_data_source.ReferenceDataSource",
*,
config_overrides: Optional[KinesisAnalyticsClientConfig] = None,
) -> "capo_kinesis_analytics.types.add_application_reference_data_source_response.AddApplicationReferenceDataSourceResponse":
"""<note> <p>This documentation is for version 1 of the Amazon Kinesis Data Analytics API, which only supports SQL applications. Version 2 of the API supports SQL and Java applications. For more information about version 2, see <a href="/kinesisanalytics/latest/apiv2/Welcome.html">Amazon Kinesis Data Analytics API V2 Documentation</a>.</p> </note> <p>Adds a reference data source to an existing application.</p> <p>Amazon Kinesis 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 Amazon S3 object maps to columns in the resulting in-application table.</p> <p> For conceptual information, see <a href="https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-input.html">Configuring Application Input</a>. For the limits on data sources you can add to your application, see <a href="https://docs.aws.amazon.com/kinesisanalytics/latest/dev/limits.html">Limits</a>. </p> <p> This operation requires permissions to perform the <code>kinesisanalytics:AddApplicationOutput</code> action. </p>
Args:
application_name: <p>Name of an existing application.</p>
current_application_version_id: <p>Version of the application for which you are adding the reference data source. You can use the <a href="https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html">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. Amazon Kinesis 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. You must also provide an IAM role with the necessary permissions that Amazon Kinesis Analytics can assume to read the object from your S3 bucket on your behalf.</p>
Raises:
capo_kinesis_analytics.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Exception thrown as a result of concurrent modification to an application. For example, two individuals attempting to edit the same application at the same time.</p>
capo_kinesis_analytics.errors.invalid_argument_exception.InvalidArgumentException: <p>Specified input parameter value is invalid.</p>
capo_kinesis_analytics.errors.resource_in_use_exception.ResourceInUseException: <p>Application is not available for this operation.</p>
capo_kinesis_analytics.errors.resource_not_found_exception.ResourceNotFoundException: <p>Specified application can't be found.</p>
capo_kinesis_analytics.errors.unsupported_operation_exception.UnsupportedOperationException: <p>The request was rejected because a specified parameter is not supported or a specified resource is not valid for this operation. </p>
capo_kinesis_analytics.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_kinesis_analytics.types.add_application_reference_data_source_request.AddApplicationReferenceDataSourceRequest]",
) -> OperationResponse[
"capo_kinesis_analytics.types.add_application_reference_data_source_response.AddApplicationReferenceDataSourceResponse"
]:
import capo_kinesis_analytics._operations.kinesis_analytics_20150814.add_application_reference_data_source
output, http_response = (
capo_kinesis_analytics._operations.kinesis_analytics_20150814.add_application_reference_data_source.add_application_reference_data_source(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AddApplicationReferenceDataSource")
)
input_: capo_kinesis_analytics.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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|