@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api AWS RDS DataService
@version 2018-08-01
@auth AWS SigV4
@endpoints 6
@toc BatchExecute(1), BeginTransaction(1), CommitTransaction(1), ExecuteSql(1), Execute(1), RollbackTransaction(1)

@group BatchExecute
@endpoint POST /BatchExecute
@desc Runs a batch SQL statement over an array of data. You can run bulk update and insert operations for multiple records using a DML statement with different parameter sets. Bulk operations can provide a significant performance improvement over individual insert and update operations.  If a call isn't part of a transaction because it doesn't include the transactionID parameter, changes that result from the call are committed automatically. There isn't a fixed upper limit on the number of parameter sets. However, the maximum size of the HTTP request submitted through the Data API is 4 MiB. If the request exceeds this limit, the Data API returns an error and doesn't process the request. This 4-MiB limit includes the size of the HTTP headers and the JSON notation in the request. Thus, the number of parameter sets that you can include depends on a combination of factors, such as the size of the SQL statement and the size of each parameter set. The response size limit is 1 MiB. If the call returns more than 1 MiB of response data, the call is terminated.
@required {resourceArn: str, secretArn: str, sql: str}
@optional {database: str, schema: str, parameterSets: [[SqlParameter]], transactionId: str}
@returns(200) {updateResults: [UpdateResult]?}

@endgroup

@group BeginTransaction
@endpoint POST /BeginTransaction
@desc Starts a SQL transaction.  A transaction can run for a maximum of 24 hours. A transaction is terminated and rolled back automatically after 24 hours. A transaction times out if no calls use its transaction ID in three minutes. If a transaction times out before it's committed, it's rolled back automatically. DDL statements inside a transaction cause an implicit commit. We recommend that you run each DDL statement in a separate ExecuteStatement call with continueAfterTimeout enabled.
@required {resourceArn: str, secretArn: str}
@optional {database: str, schema: str}
@returns(200) {transactionId: str?}

@endgroup

@group CommitTransaction
@endpoint POST /CommitTransaction
@desc Ends a SQL transaction started with the BeginTransaction operation and commits the changes.
@required {resourceArn: str, secretArn: str, transactionId: str}
@returns(200) {transactionStatus: str?}

@endgroup

@group ExecuteSql
@endpoint POST /ExecuteSql
@desc Runs one or more SQL statements.  This operation isn't supported for Aurora PostgreSQL Serverless v2 and provisioned DB clusters, and for Aurora Serverless v1 DB clusters, the operation is deprecated. Use the BatchExecuteStatement or ExecuteStatement operation.
@required {dbClusterOrInstanceArn: str, awsSecretStoreArn: str, sqlStatements: str}
@optional {database: str, schema: str}
@returns(200) {sqlStatementResults: [SqlStatementResult]?}

@endgroup

@group Execute
@endpoint POST /Execute
@desc Runs a SQL statement against a database.  If a call isn't part of a transaction because it doesn't include the transactionID parameter, changes that result from the call are committed automatically. If the binary response data from the database is more than 1 MB, the call is terminated.
@required {resourceArn: str, secretArn: str, sql: str}
@optional {database: str, schema: str, parameters: [SqlParameter], transactionId: str, includeResultMetadata: bool, continueAfterTimeout: bool, resultSetOptions: ResultSetOptions, formatRecordsAs: str}
@returns(200) {records: [[Field]]?, columnMetadata: [ColumnMetadata]?, numberOfRecordsUpdated: int(i64)?, generatedFields: [Field]?, formattedRecords: str?}

@endgroup

@group RollbackTransaction
@endpoint POST /RollbackTransaction
@desc Performs a rollback of a transaction. Rolling back a transaction cancels its changes.
@required {resourceArn: str, secretArn: str, transactionId: str}
@returns(200) {transactionStatus: str?}

@endgroup

@end
