list_statements
¶
list_statements(
*,
config_overrides: Optional[RedshiftDataClientConfig] = None,
next_token: Optional[String] = None,
max_results: Optional[ListStatementsLimit] = None,
statement_name: Optional[StatementNameString] = None,
status: Optional[StatusString] = None,
role_level: Optional[bool] = None,
database: Optional[String] = None,
cluster_identifier: Optional[ClusterIdentifierString] = None,
workgroup_name: Optional[WorkgroupNameString] = None,
) -> 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.
Parameters:
-
next_token(Optional[String], default:None) –A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.
-
max_results(Optional[ListStatementsLimit], default:None) –The maximum number of SQL statements to return in the response. If more SQL statements exist than fit in one response, then
NextTokenis returned to page through the results. -
statement_name(Optional[StatementNameString], default:None) –The name of the SQL statement specified as input to
BatchExecuteStatementorExecuteStatementto identify the query. You can list multiple statements by providing a prefix that matches the beginning of the statement name. For example, to list myStatement1, myStatement2, myStatement3, and so on, then provide the a value ofmyStatement. Data API does a case-sensitive match of SQL statement names to the prefix value you provide. -
status(Optional[StatusString], default:None) –The status of the SQL statement to list. Status values are defined as follows:
-
ABORTED - The query run was stopped by the user.
-
ALL - A status value that includes all query statuses. This value can be used to filter results.
-
FAILED - The query run failed.
-
FINISHED - The query has finished running.
-
PICKED - The query has been chosen to be run.
-
STARTED - The query run has started.
-
SUBMITTED - The query was submitted, but not yet processed.
-
-
role_level(Optional[bool], default:None) –A value that filters which statements to return in the response. If true, all statements run by the caller's IAM role are returned. If false, only statements run by the caller's IAM role in the current IAM session are returned. The default is true.
-
database(Optional[String], default:None) –The name of the database when listing statements run against a
ClusterIdentifierorWorkgroupName. -
cluster_identifier(Optional[ClusterIdentifierString], default:None) –The cluster identifier. Only statements that ran on this cluster are returned. When providing
ClusterIdentifier, thenWorkgroupNamecan't be specified. -
workgroup_name(Optional[WorkgroupNameString], default:None) –The serverless workgroup name or Amazon Resource Name (ARN). Only statements that ran on this workgroup are returned. When providing
WorkgroupName, thenClusterIdentifiercan't be specified.
Raises:
-
InternalServerException–The Amazon Redshift Data API operation failed due to invalid input.
-
ResourceNotFoundException–The Amazon Redshift Data API operation failed due to a missing resource.
-
ValidationException–The Amazon Redshift Data API operation failed due to invalid input.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_redshift_data/_services/redshift_data.py
1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 | |