Class: Aws::Athena::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::Athena::Client
- Includes:
- ClientStubs
- Defined in:
- gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb
Overview
An API client for Athena. To construct a client, you need to configure a :region
and :credentials
.
client = Aws::Athena::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the developer guide.
See #initialize for a full list of supported configuration options.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
API Operations collapse
-
#batch_get_named_query(params = {}) ⇒ Types::BatchGetNamedQueryOutput
Returns the details of a single named query or a list of up to 50 queries, which you provide as an array of query ID strings.
-
#batch_get_query_execution(params = {}) ⇒ Types::BatchGetQueryExecutionOutput
Returns the details of a single query execution or a list of up to 50 query executions, which you provide as an array of query execution ID strings.
-
#create_data_catalog(params = {}) ⇒ Struct
Creates (registers) a data catalog with the specified name and properties.
-
#create_named_query(params = {}) ⇒ Types::CreateNamedQueryOutput
Creates a named query in the specified workgroup.
-
#create_work_group(params = {}) ⇒ Struct
Creates a workgroup with the specified name.
-
#delete_data_catalog(params = {}) ⇒ Struct
Deletes a data catalog.
-
#delete_named_query(params = {}) ⇒ Struct
Deletes the named query if you have access to the workgroup in which the query was saved.
-
#delete_work_group(params = {}) ⇒ Struct
Deletes the workgroup with the specified name.
-
#get_data_catalog(params = {}) ⇒ Types::GetDataCatalogOutput
Returns the specified data catalog.
-
#get_database(params = {}) ⇒ Types::GetDatabaseOutput
Returns a database object for the specfied database and data catalog.
-
#get_named_query(params = {}) ⇒ Types::GetNamedQueryOutput
Returns information about a single query.
-
#get_query_execution(params = {}) ⇒ Types::GetQueryExecutionOutput
Returns information about a single execution of a query if you have access to the workgroup in which the query ran.
-
#get_query_results(params = {}) ⇒ Types::GetQueryResultsOutput
Streams the results of a single query execution specified by
QueryExecutionId
from the Athena query results location in Amazon S3. -
#get_table_metadata(params = {}) ⇒ Types::GetTableMetadataOutput
Returns table metadata for the specified catalog, database, and table.
-
#get_work_group(params = {}) ⇒ Types::GetWorkGroupOutput
Returns information about the workgroup with the specified name.
-
#list_data_catalogs(params = {}) ⇒ Types::ListDataCatalogsOutput
Lists the data catalogs in the current AWS account.
-
#list_databases(params = {}) ⇒ Types::ListDatabasesOutput
Lists the databases in the specified data catalog.
-
#list_named_queries(params = {}) ⇒ Types::ListNamedQueriesOutput
Provides a list of available query IDs only for queries saved in the specified workgroup.
-
#list_query_executions(params = {}) ⇒ Types::ListQueryExecutionsOutput
Provides a list of available query execution IDs for the queries in the specified workgroup.
-
#list_table_metadata(params = {}) ⇒ Types::ListTableMetadataOutput
Lists the metadata for the tables in the specified data catalog database.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceOutput
Lists the tags associated with an Athena workgroup or data catalog resource.
-
#list_work_groups(params = {}) ⇒ Types::ListWorkGroupsOutput
Lists available workgroups for the account.
-
#start_query_execution(params = {}) ⇒ Types::StartQueryExecutionOutput
Runs the SQL query statements contained in the
Query
. -
#stop_query_execution(params = {}) ⇒ Struct
Stops a query execution.
-
#tag_resource(params = {}) ⇒ Struct
Adds one or more tags to an Athena resource.
-
#untag_resource(params = {}) ⇒ Struct
Removes one or more tags from a data catalog or workgroup resource.
-
#update_data_catalog(params = {}) ⇒ Struct
Updates the data catalog that has the specified name.
-
#update_work_group(params = {}) ⇒ Struct
Updates the workgroup with the specified name.
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
Methods included from ClientStubs
#api_requests, #stub_data, #stub_responses
Methods inherited from Seahorse::Client::Base
add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
334 335 336 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 334 def initialize(*args) super end |
Instance Method Details
#batch_get_named_query(params = {}) ⇒ Types::BatchGetNamedQueryOutput
Returns the details of a single named query or a list of up to 50 queries, which you provide as an array of query ID strings. Requires you to have access to the workgroup in which the queries were saved. Use ListNamedQueriesInput to get the list of named query IDs in the specified workgroup. If information could not be retrieved for a submitted query ID, information about the query ID submitted is listed under UnprocessedNamedQueryId. Named queries differ from executed queries. Use BatchGetQueryExecutionInput to get details about each unique query execution, and ListQueryExecutionsInput to get a list of query execution IDs.
383 384 385 386 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 383 def batch_get_named_query(params = {}, = {}) req = build_request(:batch_get_named_query, params) req.send_request() end |
#batch_get_query_execution(params = {}) ⇒ Types::BatchGetQueryExecutionOutput
Returns the details of a single query execution or a list of up to 50 query executions, which you provide as an array of query execution ID strings. Requires you to have access to the workgroup in which the queries ran. To get a list of query execution IDs, use ListQueryExecutionsInput$WorkGroup. Query executions differ from named (saved) queries. Use BatchGetNamedQueryInput to get details about named queries.
442 443 444 445 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 442 def batch_get_query_execution(params = {}, = {}) req = build_request(:batch_get_query_execution, params) req.send_request() end |
#create_data_catalog(params = {}) ⇒ Struct
Creates (registers) a data catalog with the specified name and properties. Catalogs created are visible to all users of the same AWS account.
519 520 521 522 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 519 def create_data_catalog(params = {}, = {}) req = build_request(:create_data_catalog, params) req.send_request() end |
#create_named_query(params = {}) ⇒ Types::CreateNamedQueryOutput
Creates a named query in the specified workgroup. Requires that you have access to the workgroup.
For code samples using the AWS SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.
587 588 589 590 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 587 def create_named_query(params = {}, = {}) req = build_request(:create_named_query, params) req.send_request() end |
#create_work_group(params = {}) ⇒ Struct
Creates a workgroup with the specified name.
647 648 649 650 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 647 def create_work_group(params = {}, = {}) req = build_request(:create_work_group, params) req.send_request() end |
#delete_data_catalog(params = {}) ⇒ Struct
Deletes a data catalog.
669 670 671 672 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 669 def delete_data_catalog(params = {}, = {}) req = build_request(:delete_data_catalog, params) req.send_request() end |
#delete_named_query(params = {}) ⇒ Struct
Deletes the named query if you have access to the workgroup in which the query was saved.
For code samples using the AWS SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.
702 703 704 705 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 702 def delete_named_query(params = {}, = {}) req = build_request(:delete_named_query, params) req.send_request() end |
#delete_work_group(params = {}) ⇒ Struct
Deletes the workgroup with the specified name. The primary workgroup cannot be deleted.
730 731 732 733 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 730 def delete_work_group(params = {}, = {}) req = build_request(:delete_work_group, params) req.send_request() end |
#get_data_catalog(params = {}) ⇒ Types::GetDataCatalogOutput
Returns the specified data catalog.
762 763 764 765 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 762 def get_data_catalog(params = {}, = {}) req = build_request(:get_data_catalog, params) req.send_request() end |
#get_database(params = {}) ⇒ Types::GetDatabaseOutput
Returns a database object for the specfied database and data catalog.
797 798 799 800 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 797 def get_database(params = {}, = {}) req = build_request(:get_database, params) req.send_request() end |
#get_named_query(params = {}) ⇒ Types::GetNamedQueryOutput
Returns information about a single query. Requires that you have access to the workgroup in which the query was saved.
831 832 833 834 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 831 def get_named_query(params = {}, = {}) req = build_request(:get_named_query, params) req.send_request() end |
#get_query_execution(params = {}) ⇒ Types::GetQueryExecutionOutput
Returns information about a single execution of a query if you have access to the workgroup in which the query ran. Each time a query executes, information about the query execution is saved with a unique ID.
881 882 883 884 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 881 def get_query_execution(params = {}, = {}) req = build_request(:get_query_execution, params) req.send_request() end |
#get_query_results(params = {}) ⇒ Types::GetQueryResultsOutput
Streams the results of a single query execution specified by
QueryExecutionId
from the Athena query results location in Amazon
S3. For more information, see Query Results in the Amazon Athena
User Guide. This request does not execute the query but returns
results. Use StartQueryExecution to run a query.
To stream query results successfully, the IAM principal with
permission to call GetQueryResults
also must have permissions to the
Amazon S3 GetObject
action for the Athena query results location.
IAM principals with permission to the Amazon S3 GetObject
action for
the query results location are able to retrieve query results from
Amazon S3 even if permission to the GetQueryResults
action is
denied. To restrict user or role access, ensure that Amazon S3
permissions to the Athena query location are denied.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
957 958 959 960 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 957 def get_query_results(params = {}, = {}) req = build_request(:get_query_results, params) req.send_request() end |
#get_table_metadata(params = {}) ⇒ Types::GetTableMetadataOutput
Returns table metadata for the specified catalog, database, and table.
1007 1008 1009 1010 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1007 def (params = {}, = {}) req = build_request(:get_table_metadata, params) req.send_request() end |
#get_work_group(params = {}) ⇒ Types::GetWorkGroupOutput
Returns information about the workgroup with the specified name.
1045 1046 1047 1048 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1045 def get_work_group(params = {}, = {}) req = build_request(:get_work_group, params) req.send_request() end |
#list_data_catalogs(params = {}) ⇒ Types::ListDataCatalogsOutput
Lists the data catalogs in the current AWS account.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1086 1087 1088 1089 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1086 def list_data_catalogs(params = {}, = {}) req = build_request(:list_data_catalogs, params) req.send_request() end |
#list_databases(params = {}) ⇒ Types::ListDatabasesOutput
Lists the databases in the specified data catalog.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1133 1134 1135 1136 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1133 def list_databases(params = {}, = {}) req = build_request(:list_databases, params) req.send_request() end |
#list_named_queries(params = {}) ⇒ Types::ListNamedQueriesOutput
Provides a list of available query IDs only for queries saved in the specified workgroup. Requires that you have access to the specified workgroup. If a workgroup is not specified, lists the saved queries for the primary workgroup.
For code samples using the AWS SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1189 1190 1191 1192 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1189 def list_named_queries(params = {}, = {}) req = build_request(:list_named_queries, params) req.send_request() end |
#list_query_executions(params = {}) ⇒ Types::ListQueryExecutionsOutput
Provides a list of available query execution IDs for the queries in the specified workgroup. If a workgroup is not specified, returns a list of query execution IDs for the primary workgroup. Requires you to have access to the workgroup in which the queries ran.
For code samples using the AWS SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1245 1246 1247 1248 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1245 def list_query_executions(params = {}, = {}) req = build_request(:list_query_executions, params) req.send_request() end |
#list_table_metadata(params = {}) ⇒ Types::ListTableMetadataOutput
Lists the metadata for the tables in the specified data catalog database.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1313 1314 1315 1316 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1313 def (params = {}, = {}) req = build_request(:list_table_metadata, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceOutput
Lists the tags associated with an Athena workgroup or data catalog resource.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1359 1360 1361 1362 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1359 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#list_work_groups(params = {}) ⇒ Types::ListWorkGroupsOutput
Lists available workgroups for the account.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1402 1403 1404 1405 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1402 def list_work_groups(params = {}, = {}) req = build_request(:list_work_groups, params) req.send_request() end |
#start_query_execution(params = {}) ⇒ Types::StartQueryExecutionOutput
Runs the SQL query statements contained in the Query
. Requires you
to have access to the workgroup in which the query ran. Running
queries against an external catalog requires GetDataCatalog permission
to the catalog. For code samples using the AWS SDK for Java, see
Examples and Code Samples in the Amazon Athena User Guide.
1481 1482 1483 1484 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1481 def start_query_execution(params = {}, = {}) req = build_request(:start_query_execution, params) req.send_request() end |
#stop_query_execution(params = {}) ⇒ Struct
Stops a query execution. Requires you to have access to the workgroup in which the query ran.
For code samples using the AWS SDK for Java, see Examples and Code Samples in the Amazon Athena User Guide.
1514 1515 1516 1517 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1514 def stop_query_execution(params = {}, = {}) req = build_request(:stop_query_execution, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Adds one or more tags to an Athena resource. A tag is a label that you assign to a resource. In Athena, a resource can be a workgroup or data catalog. Each tag consists of a key and an optional value, both of which you define. For example, you can use tags to categorize Athena workgroups or data catalogs by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter workgroups or data catalogs in your account. For best practices, see Tagging Best Practices. Tag keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / @. Tag keys and values are case-sensitive. Tag keys must be unique per resource. If you specify more than one tag, separate them by commas.
1563 1564 1565 1566 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1563 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes one or more tags from a data catalog or workgroup resource.
1590 1591 1592 1593 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1590 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_data_catalog(params = {}) ⇒ Struct
Updates the data catalog that has the specified name.
1656 1657 1658 1659 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1656 def update_data_catalog(params = {}, = {}) req = build_request(:update_data_catalog, params) req.send_request() end |
#update_work_group(params = {}) ⇒ Struct
Updates the workgroup with the specified name. The workgroup's name cannot be changed.
1707 1708 1709 1710 |
# File 'gems/aws-sdk-athena/lib/aws-sdk-athena/client.rb', line 1707 def update_work_group(params = {}, = {}) req = build_request(:update_work_group, params) req.send_request() end |