Class: Aws::RedshiftDataAPIService::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::RedshiftDataAPIService::Client
- Includes:
- ClientStubs
- Defined in:
- lib/aws-sdk-redshiftdataapiservice/client.rb
Overview
An API client for RedshiftDataAPIService. To construct a client, you need to configure a ‘:region` and `:credentials`.
client = Aws::RedshiftDataAPIService::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
See #initialize for a full list of supported configuration options.
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
API Operations collapse
-
#batch_execute_statement(params = {}) ⇒ Types::BatchExecuteStatementOutput
Runs one or more SQL statements, which can be data manipulation language (DML) or data definition language (DDL).
-
#cancel_statement(params = {}) ⇒ Types::CancelStatementResponse
Cancels a running query.
-
#describe_statement(params = {}) ⇒ Types::DescribeStatementResponse
Describes the details about a specific instance when a query was run by the Amazon Redshift Data API.
-
#describe_table(params = {}) ⇒ Types::DescribeTableResponse
Describes the detailed information about a table from metadata in the cluster.
-
#execute_statement(params = {}) ⇒ Types::ExecuteStatementOutput
Runs an SQL statement, which can be data manipulation language (DML) or data definition language (DDL).
-
#get_statement_result(params = {}) ⇒ Types::GetStatementResultResponse
Fetches the temporarily cached result of an SQL statement in JSON format.
-
#get_statement_result_v2(params = {}) ⇒ Types::GetStatementResultV2Response
Fetches the temporarily cached result of an SQL statement in CSV format.
-
#list_databases(params = {}) ⇒ Types::ListDatabasesResponse
List the databases in a cluster.
-
#list_schemas(params = {}) ⇒ Types::ListSchemasResponse
Lists the schemas in a database.
-
#list_statements(params = {}) ⇒ Types::ListStatementsResponse
List of SQL statements.
-
#list_tables(params = {}) ⇒ Types::ListTablesResponse
List the tables in a database.
Class Method Summary collapse
- .errors_module ⇒ Object private
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
- #waiter_names ⇒ Object deprecated private Deprecated.
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
474 475 476 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 474 def initialize(*args) super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1767 1768 1769 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 1767 def identifier @identifier end |
Class Method Details
.errors_module ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1770 1771 1772 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 1770 def errors_module Errors end |
Instance Method Details
#batch_execute_statement(params = {}) ⇒ Types::BatchExecuteStatementOutput
Runs one or more SQL statements, which can be data manipulation language (DML) or data definition language (DDL). Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the ‘secret-arn` of a secret stored in Secrets Manager which has `username` and `password`. The specified secret contains credentials to connect to the `database` you specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (`dbClusterIdentifier`), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name.
-
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, ‘arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift-serverless:GetCredentials` operation is required.
-
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, ‘arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift:GetClusterCredentialsWithIAM` operation is required.
-
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the ‘redshift:GetClusterCredentials` operation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see [Using the Amazon Redshift Data API] in the *Amazon Redshift Management Guide*.
626 627 628 629 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 626 def batch_execute_statement(params = {}, = {}) req = build_request(:batch_execute_statement, params) req.send_request() end |
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 1740 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) tracer = config.telemetry_provider.tracer_provider.tracer( Aws::Telemetry.module_to_tracer_name('Aws::RedshiftDataAPIService') ) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, config: config, tracer: tracer ) context[:gem_name] = 'aws-sdk-redshiftdataapiservice' context[:gem_version] = '1.55.0' Seahorse::Client::Request.new(handlers, context) end |
#cancel_statement(params = {}) ⇒ Types::CancelStatementResponse
Cancels a running query. To be canceled, a query must be running.
For more information about the Amazon Redshift Data API and CLI usage examples, see [Using the Amazon Redshift Data API] in the *Amazon Redshift Management Guide*.
665 666 667 668 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 665 def cancel_statement(params = {}, = {}) req = build_request(:cancel_statement, params) req.send_request() end |
#describe_statement(params = {}) ⇒ Types::DescribeStatementResponse
Describes the details about a specific instance when a query was run by the Amazon Redshift Data API. The information includes when the query started, when it finished, the query status, the number of rows returned, and the SQL statement.
For more information about the Amazon Redshift Data API and CLI usage examples, see [Using the Amazon Redshift Data API] in the *Amazon Redshift Management Guide*.
763 764 765 766 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 763 def describe_statement(params = {}, = {}) req = build_request(:describe_statement, params) req.send_request() end |
#describe_table(params = {}) ⇒ Types::DescribeTableResponse
Describes the detailed information about a table from metadata in the cluster. The information includes its columns. A token is returned to page through the column list. Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the ‘secret-arn` of a secret stored in Secrets Manager which has `username` and `password`. The specified secret contains credentials to connect to the `database` you specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (`dbClusterIdentifier`), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name.
-
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, ‘arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift-serverless:GetCredentials` operation is required.
-
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, ‘arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift:GetClusterCredentialsWithIAM` operation is required.
-
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the ‘redshift:GetClusterCredentials` operation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see [Using the Amazon Redshift Data API] in the *Amazon Redshift Management Guide*.
[1]: docs.aws.amazon.com/redshift/latest/mgmt/data-api.html
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
907 908 909 910 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 907 def describe_table(params = {}, = {}) req = build_request(:describe_table, params) req.send_request() end |
#execute_statement(params = {}) ⇒ Types::ExecuteStatementOutput
Runs an SQL statement, which can be data manipulation language (DML) or data definition language (DDL). This statement must be a single SQL statement. Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the ‘secret-arn` of a secret stored in Secrets Manager which has `username` and `password`. The specified secret contains credentials to connect to the `database` you specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (`dbClusterIdentifier`), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name.
-
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, ‘arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift-serverless:GetCredentials` operation is required.
-
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, ‘arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift:GetClusterCredentialsWithIAM` operation is required.
-
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the ‘redshift:GetClusterCredentials` operation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see [Using the Amazon Redshift Data API] in the *Amazon Redshift Management Guide*.
1063 1064 1065 1066 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 1063 def execute_statement(params = {}, = {}) req = build_request(:execute_statement, params) req.send_request() end |
#get_statement_result(params = {}) ⇒ Types::GetStatementResultResponse
Fetches the temporarily cached result of an SQL statement in JSON format. The ‘ExecuteStatement` or `BatchExecuteStatement` operation that ran the SQL statement must have specified `ResultFormat` as `JSON` , or let the format default to JSON. A token is returned to page through the statement results.
For more information about the Amazon Redshift Data API and CLI usage examples, see [Using the Amazon Redshift Data API] in the *Amazon Redshift Management Guide*.
[1]: docs.aws.amazon.com/redshift/latest/mgmt/data-api.html
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1146 1147 1148 1149 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 1146 def get_statement_result(params = {}, = {}) req = build_request(:get_statement_result, params) req.send_request() end |
#get_statement_result_v2(params = {}) ⇒ Types::GetStatementResultV2Response
Fetches the temporarily cached result of an SQL statement in CSV format. The ‘ExecuteStatement` or `BatchExecuteStatement` operation that ran the SQL statement must have specified `ResultFormat` as `CSV`. A token is returned to page through the statement results.
For more information about the Amazon Redshift Data API and CLI usage examples, see [Using the Amazon Redshift Data API] in the *Amazon Redshift Management Guide*.
[1]: docs.aws.amazon.com/redshift/latest/mgmt/data-api.html
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1224 1225 1226 1227 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 1224 def get_statement_result_v2(params = {}, = {}) req = build_request(:get_statement_result_v2, params) req.send_request() end |
#list_databases(params = {}) ⇒ Types::ListDatabasesResponse
List the databases in a cluster. A token is returned to page through the database list. Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the ‘secret-arn` of a secret stored in Secrets Manager which has `username` and `password`. The specified secret contains credentials to connect to the `database` you specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (`dbClusterIdentifier`), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name.
-
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, ‘arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift-serverless:GetCredentials` operation is required.
-
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, ‘arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift:GetClusterCredentialsWithIAM` operation is required.
-
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the ‘redshift:GetClusterCredentials` operation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see [Using the Amazon Redshift Data API] in the *Amazon Redshift Management Guide*.
[1]: docs.aws.amazon.com/redshift/latest/mgmt/data-api.html
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1336 1337 1338 1339 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 1336 def list_databases(params = {}, = {}) req = build_request(:list_databases, params) req.send_request() end |
#list_schemas(params = {}) ⇒ Types::ListSchemasResponse
Lists the schemas in a database. A token is returned to page through the schema list. Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the ‘secret-arn` of a secret stored in Secrets Manager which has `username` and `password`. The specified secret contains credentials to connect to the `database` you specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (`dbClusterIdentifier`), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name.
-
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, ‘arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift-serverless:GetCredentials` operation is required.
-
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, ‘arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift:GetClusterCredentialsWithIAM` operation is required.
-
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the ‘redshift:GetClusterCredentials` operation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see [Using the Amazon Redshift Data API] in the *Amazon Redshift Management Guide*.
[1]: docs.aws.amazon.com/redshift/latest/mgmt/data-api.html
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1461 1462 1463 1464 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 1461 def list_schemas(params = {}, = {}) req = build_request(:list_schemas, params) req.send_request() end |
#list_statements(params = {}) ⇒ Types::ListStatementsResponse
List of SQL statements. By default, only finished statements are shown. A token is returned to page through the statement list.
When you use identity-enhanced role sessions to list statements, you must provide either the ‘cluster-identifier` or `workgroup-name` parameter. This ensures that the IdC user can only access the Amazon Redshift IdC applications they are assigned. For more information, see [ Trusted identity propagation overview].
For more information about the Amazon Redshift Data API and CLI usage examples, see [Using the Amazon Redshift Data API] in the *Amazon Redshift Management Guide*.
[1]: docs.aws.amazon.com/singlesignon/latest/userguide/trustedidentitypropagation-overview.html [2]: docs.aws.amazon.com/redshift/latest/mgmt/data-api.html
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1589 1590 1591 1592 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 1589 def list_statements(params = {}, = {}) req = build_request(:list_statements, params) req.send_request() end |
#list_tables(params = {}) ⇒ Types::ListTablesResponse
List the tables in a database. If neither ‘SchemaPattern` nor `TablePattern` are specified, then all tables in the database are returned. A token is returned to page through the table list. Depending on the authorization method, use one of the following combinations of request parameters:
-
Secrets Manager - when connecting to a cluster, provide the ‘secret-arn` of a secret stored in Secrets Manager which has `username` and `password`. The specified secret contains credentials to connect to the `database` you specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (`dbClusterIdentifier`), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name.
-
Temporary credentials - when connecting to your data warehouse, choose one of the following options:
-
When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, ‘arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift-serverless:GetCredentials` operation is required.
-
When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, ‘arn:iam::123456789012:user:foo` has the database user name `IAM:foo`. Also, permission to call the `redshift:GetClusterCredentialsWithIAM` operation is required.
-
When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the ‘redshift:GetClusterCredentials` operation is required.
-
For more information about the Amazon Redshift Data API and CLI usage examples, see [Using the Amazon Redshift Data API] in the *Amazon Redshift Management Guide*.
[1]: docs.aws.amazon.com/redshift/latest/mgmt/data-api.html
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1731 1732 1733 1734 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 1731 def list_tables(params = {}, = {}) req = build_request(:list_tables, params) req.send_request() end |
#waiter_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1760 1761 1762 |
# File 'lib/aws-sdk-redshiftdataapiservice/client.rb', line 1760 def waiter_names [] end |