Skip to content

Commit 251c015

Browse files
author
awstools
committed
feat(client-redshift-data): This release adds support for ListStatements API to filter statements by ClusterIdentifier, WorkgroupName, and Database.
1 parent b81cdfe commit 251c015

File tree

3 files changed

+60
-13
lines changed

3 files changed

+60
-13
lines changed

clients/client-redshift-data/src/commands/ListStatementsCommand.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ export interface ListStatementsCommandOutput extends ListStatementsResponse, __M
3030
/**
3131
* <p>List of SQL statements. By default, only finished statements are shown.
3232
* A token is returned to page through the statement list. </p>
33+
* <p>When you use identity-enhanced role sessions to list statements, you must provide either the
34+
* <code>cluster-identifier</code> or <code>workgroup-name</code> parameter. This ensures that the IdC user
35+
* can only access the Amazon Redshift IdC applications they are assigned. For more information, see
36+
* <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/trustedidentitypropagation-overview.html">
37+
* Trusted identity propagation overview</a>.</p>
3338
* <p>For more information about the Amazon Redshift Data API and CLI usage examples, see
3439
* <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html">Using the Amazon Redshift Data API</a> in the
3540
* <i>Amazon Redshift Management Guide</i>. </p>
@@ -45,6 +50,9 @@ export interface ListStatementsCommandOutput extends ListStatementsResponse, __M
4550
* StatementName: "STRING_VALUE",
4651
* Status: "STRING_VALUE",
4752
* RoleLevel: true || false,
53+
* Database: "STRING_VALUE",
54+
* ClusterIdentifier: "STRING_VALUE",
55+
* WorkgroupName: "STRING_VALUE",
4856
* };
4957
* const command = new ListStatementsCommand(input);
5058
* const response = await client.send(command);
@@ -68,8 +76,8 @@ export interface ListStatementsCommandOutput extends ListStatementsResponse, __M
6876
* // },
6977
* // ],
7078
* // IsBatchStatement: true || false,
71-
* // SessionId: "STRING_VALUE",
7279
* // ResultFormat: "STRING_VALUE",
80+
* // SessionId: "STRING_VALUE",
7381
* // },
7482
* // ],
7583
* // NextToken: "STRING_VALUE",

clients/client-redshift-data/src/models/models_0.ts

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,6 +1526,27 @@ export interface ListStatementsRequest {
15261526
* @public
15271527
*/
15281528
RoleLevel?: boolean | undefined;
1529+
1530+
/**
1531+
* <p>The name of the database when listing statements run against a <code>ClusterIdentifier</code> or <code>WorkgroupName</code>.
1532+
* </p>
1533+
* @public
1534+
*/
1535+
Database?: string | undefined;
1536+
1537+
/**
1538+
* <p>The cluster identifier. Only statements that ran on this cluster are returned.
1539+
* When providing <code>ClusterIdentifier</code>, then <code>WorkgroupName</code> can't be specified.</p>
1540+
* @public
1541+
*/
1542+
ClusterIdentifier?: string | undefined;
1543+
1544+
/**
1545+
* <p>The serverless workgroup name or Amazon Resource Name (ARN). Only statements that ran on this workgroup are returned.
1546+
* When providing <code>WorkgroupName</code>, then <code>ClusterIdentifier</code> can't be specified.</p>
1547+
* @public
1548+
*/
1549+
WorkgroupName?: string | undefined;
15291550
}
15301551

15311552
/**
@@ -1596,16 +1617,16 @@ export interface StatementData {
15961617
IsBatchStatement?: boolean | undefined;
15971618

15981619
/**
1599-
* <p>The session identifier of the query.</p>
1620+
* <p>The data format of the result of the SQL statement.</p>
16001621
* @public
16011622
*/
1602-
SessionId?: string | undefined;
1623+
ResultFormat?: ResultFormatString | undefined;
16031624

16041625
/**
1605-
* <p>The data format of the result of the SQL statement.</p>
1626+
* <p>The session identifier of the query.</p>
16061627
* @public
16071628
*/
1608-
ResultFormat?: ResultFormatString | undefined;
1629+
SessionId?: string | undefined;
16091630
}
16101631

16111632
/**

codegen/sdk-codegen/aws-models/redshift-data.json

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@
14441444
}
14451445
],
14461446
"traits": {
1447-
"smithy.api#documentation": "<p>List of SQL statements. By default, only finished statements are shown. \n A token is returned to page through the statement list. </p>\n <p>For more information about the Amazon Redshift Data API and CLI usage examples, see \n <a href=\"https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html\">Using the Amazon Redshift Data API</a> in the \n <i>Amazon Redshift Management Guide</i>. </p>",
1447+
"smithy.api#documentation": "<p>List of SQL statements. By default, only finished statements are shown. \n A token is returned to page through the statement list. </p>\n <p>When you use identity-enhanced role sessions to list statements, you must provide either the \n <code>cluster-identifier</code> or <code>workgroup-name</code> parameter. This ensures that the IdC user\n can only access the Amazon Redshift IdC applications they are assigned. For more information, see \n <a href=\"https://docs.aws.amazon.com/singlesignon/latest/userguide/trustedidentitypropagation-overview.html\">\n Trusted identity propagation overview</a>.</p>\n <p>For more information about the Amazon Redshift Data API and CLI usage examples, see \n <a href=\"https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html\">Using the Amazon Redshift Data API</a> in the \n <i>Amazon Redshift Management Guide</i>. </p>",
14481448
"smithy.api#paginated": {
14491449
"inputToken": "NextToken",
14501450
"outputToken": "NextToken",
@@ -1497,6 +1497,24 @@
14971497
"traits": {
14981498
"smithy.api#documentation": "<p>A value that filters which statements to return in the response. If true, all statements run by the caller's IAM role are returned. \n If false, only statements run by the caller's IAM role in the current IAM session are returned. The default is true. </p>"
14991499
}
1500+
},
1501+
"Database": {
1502+
"target": "com.amazonaws.redshiftdata#String",
1503+
"traits": {
1504+
"smithy.api#documentation": "<p>The name of the database when listing statements run against a <code>ClusterIdentifier</code> or <code>WorkgroupName</code>. \n </p>"
1505+
}
1506+
},
1507+
"ClusterIdentifier": {
1508+
"target": "com.amazonaws.redshiftdata#ClusterIdentifierString",
1509+
"traits": {
1510+
"smithy.api#documentation": "<p>The cluster identifier. Only statements that ran on this cluster are returned. \n When providing <code>ClusterIdentifier</code>, then <code>WorkgroupName</code> can't be specified.</p>"
1511+
}
1512+
},
1513+
"WorkgroupName": {
1514+
"target": "com.amazonaws.redshiftdata#WorkgroupNameString",
1515+
"traits": {
1516+
"smithy.api#documentation": "<p>The serverless workgroup name or Amazon Resource Name (ARN). Only statements that ran on this workgroup are returned. \n When providing <code>WorkgroupName</code>, then <code>ClusterIdentifier</code> can't be specified.</p>"
1517+
}
15001518
}
15011519
},
15021520
"traits": {
@@ -2556,17 +2574,17 @@
25562574
"smithy.api#documentation": "<p>A value that indicates whether the statement is a batch query request.</p>"
25572575
}
25582576
},
2559-
"SessionId": {
2560-
"target": "com.amazonaws.redshiftdata#UUID",
2561-
"traits": {
2562-
"smithy.api#documentation": "<p>The session identifier of the query.</p>"
2563-
}
2564-
},
25652577
"ResultFormat": {
25662578
"target": "com.amazonaws.redshiftdata#ResultFormatString",
25672579
"traits": {
25682580
"smithy.api#documentation": "<p>The data format of the result of the SQL statement.</p>"
25692581
}
2582+
},
2583+
"SessionId": {
2584+
"target": "com.amazonaws.redshiftdata#UUID",
2585+
"traits": {
2586+
"smithy.api#documentation": "<p>The session identifier of the query.</p>"
2587+
}
25702588
}
25712589
},
25722590
"traits": {
@@ -2811,7 +2829,7 @@
28112829
"min": 3,
28122830
"max": 128
28132831
},
2814-
"smithy.api#pattern": "^(([a-z0-9-]+)|(arn:(aws(-[a-z]+)*):redshift-serverless:[a-z]{2}(-gov)?-[a-z]+-\\d{1}:\\d{12}:workgroup/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))$"
2832+
"smithy.api#pattern": "^(([a-z0-9-]+)|(arn:(aws(-[a-z]+)*):redshift-serverless:[a-z]{2}(-gov|(-iso[a-z]?))?-[a-z]+-\\d{1}:\\d{12}:workgroup/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}))$"
28152833
}
28162834
},
28172835
"com.amazonaws.redshiftdata#bool": {

0 commit comments

Comments
 (0)