You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::KinesisAnalyticsV2::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::KinesisAnalyticsV2::Client
- Defined in:
- (unknown)
Overview
An API client for Amazon Kinesis Analytics. To construct a client, you need to configure a :region
and :credentials
.
kinesisanalyticsv2 = Aws::KinesisAnalyticsV2::Client.new(
region: region_name,
credentials: credentials,
# ...
)
See #initialize for a full list of supported configuration options.
Region
You can configure a default region in the following locations:
ENV['AWS_REGION']
Aws.config[:region]
Go here for a list of supported regions.
Credentials
Default credentials are loaded automatically from the following locations:
ENV['AWS_ACCESS_KEY_ID']
andENV['AWS_SECRET_ACCESS_KEY']
Aws.config[:credentials]
- The shared credentials ini file at
~/.aws/credentials
(more information) - From an instance profile when running on EC2
You can also construct a credentials object from one of the following classes:
Alternatively, you configure credentials with :access_key_id
and
:secret_access_key
:
# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))
Aws::KinesisAnalyticsV2::Client.new(
access_key_id: creds['access_key_id'],
secret_access_key: creds['secret_access_key']
)
Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
Constructor collapse
-
#initialize(options = {}) ⇒ Aws::KinesisAnalyticsV2::Client
constructor
Constructs an API client.
API Operations collapse
-
#add_application_cloud_watch_logging_option(options = {}) ⇒ Types::AddApplicationCloudWatchLoggingOptionResponse
Adds an Amazon CloudWatch log stream to monitor application configuration errors.
.
-
#add_application_input(options = {}) ⇒ Types::AddApplicationInputResponse
Adds a streaming source to your SQL-based Kinesis Data Analytics application.
-
#add_application_input_processing_configuration(options = {}) ⇒ Types::AddApplicationInputProcessingConfigurationResponse
Adds an InputProcessingConfiguration to a SQL-based Kinesis Data Analytics application.
-
#add_application_output(options = {}) ⇒ Types::AddApplicationOutputResponse
Adds an external destination to your SQL-based Kinesis Data Analytics application.
If you want Kinesis Data Analytics to deliver data from an in-application stream within your application to an external destination (such as an Kinesis data stream, a Kinesis Data Firehose delivery stream, or an AWS Lambda function), you add the relevant configuration to your application using this operation.
-
#add_application_reference_data_source(options = {}) ⇒ Types::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.
-
#add_application_vpc_configuration(options = {}) ⇒ Types::AddApplicationVpcConfigurationResponse
Adds a Virtual Private Cloud (VPC) configuration to the application.
-
#create_application(options = {}) ⇒ Types::CreateApplicationResponse
Creates a Kinesis Data Analytics application.
-
#create_application_presigned_url(options = {}) ⇒ Types::CreateApplicationPresignedUrlResponse
Creates and returns a URL that you can use to connect to an application's extension.
-
#create_application_snapshot(options = {}) ⇒ Struct
Creates a snapshot of the application's state data.
.
-
#delete_application(options = {}) ⇒ Struct
Deletes the specified application.
-
#delete_application_cloud_watch_logging_option(options = {}) ⇒ Types::DeleteApplicationCloudWatchLoggingOptionResponse
Deletes an Amazon CloudWatch log stream from an Kinesis Data Analytics application.
-
#delete_application_input_processing_configuration(options = {}) ⇒ Types::DeleteApplicationInputProcessingConfigurationResponse
Deletes an InputProcessingConfiguration from an input.
.
-
#delete_application_output(options = {}) ⇒ Types::DeleteApplicationOutputResponse
Deletes the output destination configuration from your SQL-based Kinesis Data Analytics application's configuration.
-
#delete_application_reference_data_source(options = {}) ⇒ Types::DeleteApplicationReferenceDataSourceResponse
Deletes a reference data source configuration from the specified SQL-based Kinesis Data Analytics application's configuration.
If the application is running, Kinesis Data Analytics immediately removes the in-application table that you created using the AddApplicationReferenceDataSource operation.
-
#delete_application_snapshot(options = {}) ⇒ Struct
Deletes a snapshot of application state.
.
-
#delete_application_vpc_configuration(options = {}) ⇒ Types::DeleteApplicationVpcConfigurationResponse
Removes a VPC configuration from a Kinesis Data Analytics application.
.
-
#describe_application(options = {}) ⇒ Types::DescribeApplicationResponse
Returns information about a specific Kinesis Data Analytics application.
If you want to retrieve a list of all applications in your account, use the ListApplications operation.
. -
#describe_application_snapshot(options = {}) ⇒ Types::DescribeApplicationSnapshotResponse
Returns information about a snapshot of application state data.
.
-
#discover_input_schema(options = {}) ⇒ Types::DiscoverInputSchemaResponse
Infers a schema for a SQL-based Kinesis Data Analytics application by evaluating sample records on the specified streaming source (Kinesis data stream or Kinesis Data Firehose delivery stream) or Amazon S3 object.
-
#list_application_snapshots(options = {}) ⇒ Types::ListApplicationSnapshotsResponse
Lists information about the current application snapshots.
.
-
#list_applications(options = {}) ⇒ Types::ListApplicationsResponse
Returns a list of Kinesis Data Analytics applications in your account.
-
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Retrieves the list of key-value tags assigned to the application.
-
#start_application(options = {}) ⇒ Struct
Starts the specified Kinesis Data Analytics application.
-
#stop_application(options = {}) ⇒ Struct
Stops the application from processing data.
-
#tag_resource(options = {}) ⇒ Struct
Adds one or more key-value tags to a Kinesis Data Analytics application.
-
#untag_resource(options = {}) ⇒ Struct
Removes one or more tags from a Kinesis Data Analytics application.
-
#update_application(options = {}) ⇒ Types::UpdateApplicationResponse
Updates an existing Kinesis Data Analytics application.
Instance Method Summary collapse
-
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
-
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters.
Methods inherited from Seahorse::Client::Base
add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options = {}) ⇒ Aws::KinesisAnalyticsV2::Client
Constructs an API client.
Instance Method Details
#add_application_cloud_watch_logging_option(options = {}) ⇒ Types::AddApplicationCloudWatchLoggingOptionResponse
Adds an Amazon CloudWatch log stream to monitor application configuration errors.
#add_application_input(options = {}) ⇒ Types::AddApplicationInputResponse
Adds a streaming source to your SQL-based Kinesis Data Analytics application.
You can add a streaming source when you create an application, or you can use this operation to add a streaming source after you create an application. For more information, see CreateApplication.
Any configuration update, including adding a streaming source using this operation, results in a new version of the application. You can use the DescribeApplication operation to find the current application version.
#add_application_input_processing_configuration(options = {}) ⇒ Types::AddApplicationInputProcessingConfigurationResponse
Adds an InputProcessingConfiguration to a SQL-based Kinesis Data Analytics application. An input processor pre-processes records on the input stream before the application's SQL code executes. Currently, the only input processor available is AWS Lambda.
#add_application_output(options = {}) ⇒ Types::AddApplicationOutputResponse
Adds an external destination to your SQL-based Kinesis Data Analytics application.
If you want Kinesis Data Analytics to deliver data from an in-application stream within your application to an external destination (such as an Kinesis data stream, a Kinesis Data Firehose delivery stream, or an AWS Lambda function), you add the relevant configuration to your application using this operation. You can configure one or more outputs for your application. Each output configuration maps an in-application stream and an external destination.
You can use one of the output configurations to deliver data from your in-application error stream to an external destination so that you can analyze the errors.
Any configuration update, including adding a streaming source using this operation, results in a new version of the application. You can use the DescribeApplication operation to find the current application version.
#add_application_reference_data_source(options = {}) ⇒ Types::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.
#add_application_vpc_configuration(options = {}) ⇒ Types::AddApplicationVpcConfigurationResponse
Adds a Virtual Private Cloud (VPC) configuration to the application. Applications can use VPCs to store and access resources securely.
Note the following about VPC configurations for Kinesis Data Analytics applications:
-
VPC configurations are not supported for SQL applications.
-
When a VPC is added to a Kinesis Data Analytics application, the application can no longer be accessed from the Internet directly. To enable Internet access to the application, add an Internet gateway to your VPC.
#create_application(options = {}) ⇒ Types::CreateApplicationResponse
Creates a Kinesis Data Analytics application. For information about creating a Kinesis Data Analytics application, see Creating an Application.
#create_application_presigned_url(options = {}) ⇒ Types::CreateApplicationPresignedUrlResponse
Creates and returns a URL that you can use to connect to an application's extension. Currently, the only available extension is the Apache Flink dashboard.
The IAM role or user used to call this API defines the permissions to access the extension. Once the presigned URL is created, no additional permission is required to access this URL. IAM authorization policies for this API are also enforced for every HTTP request that attempts to connect to the extension.
The URL that you get from a call to CreateApplicationPresignedUrl must be used within 3 minutes to be valid. If you first try to use the URL after the 3-minute limit expires, the service returns an HTTP 403 Forbidden error.
#create_application_snapshot(options = {}) ⇒ Struct
Creates a snapshot of the application's state data.
#delete_application(options = {}) ⇒ Struct
Deletes the specified application. Kinesis Data Analytics halts application execution and deletes the application.
#delete_application_cloud_watch_logging_option(options = {}) ⇒ Types::DeleteApplicationCloudWatchLoggingOptionResponse
Deletes an Amazon CloudWatch log stream from an Kinesis Data Analytics application.
#delete_application_input_processing_configuration(options = {}) ⇒ Types::DeleteApplicationInputProcessingConfigurationResponse
Deletes an InputProcessingConfiguration from an input.
#delete_application_output(options = {}) ⇒ Types::DeleteApplicationOutputResponse
Deletes the output destination configuration from your SQL-based Kinesis Data Analytics application's configuration. Kinesis Data Analytics will no longer write data from the corresponding in-application stream to the external output destination.
#delete_application_reference_data_source(options = {}) ⇒ Types::DeleteApplicationReferenceDataSourceResponse
Deletes a reference data source configuration from the specified SQL-based Kinesis Data Analytics application's configuration.
If the application is running, Kinesis Data Analytics immediately removes the in-application table that you created using the AddApplicationReferenceDataSource operation.
#delete_application_snapshot(options = {}) ⇒ Struct
Deletes a snapshot of application state.
#delete_application_vpc_configuration(options = {}) ⇒ Types::DeleteApplicationVpcConfigurationResponse
Removes a VPC configuration from a Kinesis Data Analytics application.
#describe_application(options = {}) ⇒ Types::DescribeApplicationResponse
Returns information about a specific Kinesis Data Analytics application.
If you want to retrieve a list of all applications in your account, use the ListApplications operation.
#describe_application_snapshot(options = {}) ⇒ Types::DescribeApplicationSnapshotResponse
Returns information about a snapshot of application state data.
#discover_input_schema(options = {}) ⇒ Types::DiscoverInputSchemaResponse
Infers a schema for a SQL-based Kinesis Data Analytics application by evaluating sample records on the specified streaming source (Kinesis data stream or Kinesis Data Firehose delivery stream) or Amazon S3 object. In the response, the operation returns the inferred schema and also the sample records that the operation used to infer the schema.
You can use the inferred schema when configuring a streaming source for your application. When you create an application using the Kinesis Data Analytics console, the console uses this operation to infer a schema and show it in the console user interface.
#list_application_snapshots(options = {}) ⇒ Types::ListApplicationSnapshotsResponse
Lists information about the current application snapshots.
#list_applications(options = {}) ⇒ Types::ListApplicationsResponse
Returns a list of Kinesis Data Analytics applications in your account. For each application, the response includes the application name, Amazon Resource Name (ARN), and status.
If you want detailed information about a specific application, use DescribeApplication.
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Retrieves the list of key-value tags assigned to the application. For more information, see Using Tagging.
#start_application(options = {}) ⇒ Struct
Starts the specified Kinesis Data Analytics application. After creating an application, you must exclusively call this operation to start your application.
#stop_application(options = {}) ⇒ Struct
Stops the application from processing data. You can stop an application only if it is in the running status, unless you set the Force
parameter to true
.
You can use the DescribeApplication operation to find the application status.
Kinesis Data Analytics takes a snapshot when the application is stopped, unless Force
is set to true
.
#tag_resource(options = {}) ⇒ Struct
Adds one or more key-value tags to a Kinesis Data Analytics application. Note that the maximum number of application tags includes system tags. The maximum number of user-defined application tags is 50. For more information, see Using Tagging.
#untag_resource(options = {}) ⇒ Struct
Removes one or more tags from a Kinesis Data Analytics application. For more information, see Using Tagging.
#update_application(options = {}) ⇒ Types::UpdateApplicationResponse
Updates an existing Kinesis Data Analytics application. Using this operation, you can update application code, input configuration, and output configuration.
Kinesis Data Analytics updates the ApplicationVersionId
each time you update your application.
You cannot update the RuntimeEnvironment
of an existing application. If you need to update an application's RuntimeEnvironment
, you must delete the application and create it again.
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
Basic Usage
Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:
# poll for ~25 seconds
client.wait_until(...) do |w|
w.max_attempts = 5
w.delay = 5
end
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success
or :failure
from these callbacks,
it will terminate the waiter.
started_at = Time.now
client.wait_until(...) do |w|
# disable max attempts
w.max_attempts = nil
# poll for 1 hour, instead of a number of attempts
w.before_wait do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
end
Handling Errors
When a waiter is successful, it returns true
. When a waiter
fails, it raises an error. All errors raised extend from
Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:
Waiter Name | Client Method | Default Delay: | Default Max Attempts: |
---|