Amazon Timestream Query 2018-11-01
- Client: Aws\TimestreamQuery\TimestreamQueryClient
- Service ID: timestream-query
- Version: 2018-11-01
This page describes the parameters and results for the operations of the Amazon Timestream Query (2018-11-01), and shows how to use the Aws\TimestreamQuery\TimestreamQueryClient object to call the described operations. This documentation is specific to the 2018-11-01 API version of the service.
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName')
, where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */)
.
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */)
.
- CancelQuery ( array $params = [] )
Cancels a query that has been issued.
- DescribeEndpoints ( array $params = [] )
DescribeEndpoints returns a list of available endpoints to make Timestream API calls against.
- Query ( array $params = [] )
Query is a synchronous operation that enables you to execute a query.
Paginators
Paginators handle automatically iterating over paginated API results. Paginators are associated with specific API operations, and they accept the parameters that the corresponding API operation accepts. You can get a paginator from a client class using getPaginator($paginatorName, $operationParameters). This client supports the following paginators:
Operations
CancelQuery
$result = $client->cancelQuery
([/* ... */]); $promise = $client->cancelQueryAsync
([/* ... */]);
Cancels a query that has been issued. Cancellation is guaranteed only if the query has not completed execution before the cancellation request was issued. Because cancellation is an idempotent operation, subsequent cancellation requests will return a CancellationMessage
, indicating that the query has already been canceled.
Parameter Syntax
$result = $client->cancelQuery([ 'QueryId' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'CancellationMessage' => '<string>', ]
Result Details
Members
Errors
-
You are not authorized to perform this action.
-
Timestream was unable to fully process this request because of an internal server error.
-
The request was denied due to request throttling.
-
Invalid or malformed request.
-
The requested endpoint was invalid.
DescribeEndpoints
$result = $client->describeEndpoints
([/* ... */]); $promise = $client->describeEndpointsAsync
([/* ... */]);
DescribeEndpoints returns a list of available endpoints to make Timestream API calls against. This API is available through both Write and Query.
Because Timestream’s SDKs are designed to transparently work with the service’s architecture, including the management and mapping of the service endpoints, it is not recommended that you use this API unless:
-
Your application uses a programming language that does not yet have SDK support
-
You require better control over the client-side implementation
For detailed information on how to use DescribeEndpoints, see The Endpoint Discovery Pattern and REST APIs.
Parameter Syntax
$result = $client->describeEndpoints([ ]);
Parameter Details
Members
Result Syntax
[ 'Endpoints' => [ [ 'Address' => '<string>', 'CachePeriodInMinutes' => <integer>, ], // ... ], ]
Result Details
Members
- Endpoints
-
- Required: Yes
- Type: Array of Endpoint structures
An
Endpoints
object is returned when aDescribeEndpoints
request is made.
Errors
-
Timestream was unable to fully process this request because of an internal server error.
-
Invalid or malformed request.
-
The request was denied due to request throttling.
Query
$result = $client->query
([/* ... */]); $promise = $client->queryAsync
([/* ... */]);
Query is a synchronous operation that enables you to execute a query. Query will timeout after 60 seconds. You must update the default timeout in the SDK to support a timeout of 60 seconds. The result set will be truncated to 1MB. Service quotas apply. For more information, see Quotas in the Timestream Developer Guide.
Parameter Syntax
$result = $client->query([ 'ClientToken' => '<string>', 'MaxRows' => <integer>, 'NextToken' => '<string>', 'QueryString' => '<string>', // REQUIRED ]);
Parameter Details
Members
- ClientToken
-
- Type: string
Unique, case-sensitive string of up to 64 ASCII characters that you specify when you make a Query request. Providing a
ClientToken
makes the call toQuery
idempotent, meaning that multiple identical calls have the same effect as one single call.Your query request will fail in the following cases:
-
If you submit a request with the same client token outside the 5-minute idepotency window.
-
If you submit a request with the same client token but a change in other parameters within the 5-minute idempotency window.
After 4 hours, any request with the same client token is treated as a new request.
- MaxRows
-
- Type: int
The total number of rows to return in the output. If the total number of rows available is more than the value specified, a NextToken is provided in the command's output. To resume pagination, provide the NextToken value in the starting-token argument of a subsequent command.
- NextToken
-
- Type: string
A pagination token passed to get a set of results.
- QueryString
-
- Required: Yes
- Type: string
The query to be executed by Timestream.
Result Syntax
[ 'ColumnInfo' => [ [ 'Name' => '<string>', 'Type' => [ 'ArrayColumnInfo' => [...], // RECURSIVE 'RowColumnInfo' => [...], // RECURSIVE 'ScalarType' => 'VARCHAR|BOOLEAN|BIGINT|DOUBLE|TIMESTAMP|DATE|TIME|INTERVAL_DAY_TO_SECOND|INTERVAL_YEAR_TO_MONTH|UNKNOWN|INTEGER', 'TimeSeriesMeasureValueColumnInfo' => [...], // RECURSIVE ], ], // ... ], 'NextToken' => '<string>', 'QueryId' => '<string>', 'QueryStatus' => [ 'CumulativeBytesMetered' => <integer>, 'CumulativeBytesScanned' => <integer>, 'ProgressPercentage' => <float>, ], 'Rows' => [ [ 'Data' => [ [ 'ArrayValue' => [...], // RECURSIVE 'NullValue' => true || false, 'RowValue' => [...], // RECURSIVE 'ScalarValue' => '<string>', 'TimeSeriesValue' => [ [ 'Time' => '<string>', 'Value' => [...], // RECURSIVE ], // ... ], ], // ... ], ], // ... ], ]
Result Details
Members
- ColumnInfo
-
- Required: Yes
- Type: Array of ColumnInfo structures
The column data types of the returned result set.
- NextToken
-
- Type: string
A pagination token that can be used again on a
Query
call to get the next set of results. - QueryId
-
- Required: Yes
- Type: string
A unique ID for the given query.
- QueryStatus
-
- Type: QueryStatus structure
Information about the status of the query, including progress and bytes scannned.
- Rows
-
- Required: Yes
- Type: Array of Row structures
The result set rows returned by the query.
Errors
-
You are not authorized to perform this action.
-
Unable to poll results for a cancelled query.
-
Timestream was unable to fully process this request because of an internal server error.
-
Timestream was unable to run the query successfully.
-
The request was denied due to request throttling.
-
Invalid or malformed request.
-
The requested endpoint was invalid.
Shapes
AccessDeniedException
ColumnInfo
Description
Contains the meta data for query results such as the column names, data types, and other attributes.
Members
- Name
-
- Type: string
The name of the result set column. The name of the result set is available for columns of all data types except for arrays.
- Type
-
- Required: Yes
- Type: Type structure
The data type of the result set column. The data type can be a scalar or complex. Scalar data types are integers, strings, doubles, booleans, and others. Complex data types are types such as arrays, rows, and others.
ConflictException
Datum
Description
Datum represents a single data point in a query result.
Members
- ArrayValue
-
- Type: Array of Datum structures
Indicates if the data point is an array.
- NullValue
-
- Type: boolean
Indicates if the data point is null.
- RowValue
-
- Type: Row structure
Indicates if the data point is a row.
- ScalarValue
-
- Type: string
Indicates if the data point is a scalar value such as integer, string, double, or boolean.
- TimeSeriesValue
-
- Type: Array of TimeSeriesDataPoint structures
Indicates if the data point is of timeseries data type.
Endpoint
Description
Represents an available endpoint against which to make API calls agaisnt, as well as the TTL for that endpoint.
Members
InternalServerException
Description
Timestream was unable to fully process this request because of an internal server error.
Members
InvalidEndpointException
QueryExecutionException
QueryStatus
Description
Information about the status of the query, including progress and bytes scannned.
Members
- CumulativeBytesMetered
-
- Type: long (int|float)
The amount of data scanned by the query in bytes that you will be charged for. This is a cumulative sum and represents the total amount of data that you will be charged for since the query was started. The charge is applied only once and is either applied when the query completes execution or when the query is cancelled.
- CumulativeBytesScanned
-
- Type: long (int|float)
The amount of data scanned by the query in bytes. This is a cumulative sum and represents the total amount of bytes scanned since the query was started.
- ProgressPercentage
-
- Type: double
The progress of the query, expressed as a percentage.
Row
Description
Represents a single row in the query results.
Members
- Data
-
- Required: Yes
- Type: Array of Datum structures
List of data points in a single row of the result set.
ThrottlingException
TimeSeriesDataPoint
Description
The timeseries datatype represents the values of a measure over time. A time series is an array of rows of timestamps and measure values, with rows sorted in ascending order of time. A TimeSeriesDataPoint is a single data point in the timeseries. It represents a tuple of (time, measure value) in a timeseries.
Members
- Time
-
- Required: Yes
- Type: string
The timestamp when the measure value was collected.
- Value
-
- Required: Yes
- Type: Datum structure
The measure value for the data point.
Type
Description
Contains the data type of a column in a query result set. The data type can be scalar or complex. The supported scalar data types are integers, boolean, string, double, timestamp, date, time, and intervals. The supported complex data types are arrays, rows, and timeseries.
Members
- ArrayColumnInfo
-
- Type: ColumnInfo structure
Indicates if the column is an array.
- RowColumnInfo
-
- Type: Array of ColumnInfo structures
Indicates if the column is a row.
- ScalarType
-
- Type: string
Indicates if the column is of type string, integer, boolean, double, timestamp, date, time.
- TimeSeriesMeasureValueColumnInfo
-
- Type: ColumnInfo structure
Indicates if the column is a timeseries data type.