kx_dataviews
Creates, updates, deletes, gets or lists a kx_dataviews resource.
Overview
| Name | kx_dataviews |
| Type | Resource |
| Id | aws.finspace.kx_dataviews |
Fields
The following fields are returned by SELECT queries:
- get_kx_dataview
- list_kx_dataviews
| Name | Datatype | Description |
|---|---|---|
active_versions | array | The current active changeset versions of the database on the given dataview. |
auto_update | boolean | The option to specify whether you want to apply all the future additions and corrections automatically to the dataview when new changesets are ingested. The default value is false. |
availability_zone_id | string | The identifier of the availability zones. (pattern: <code>^[a-zA-Z0-9-]+$</code>) |
az_mode | string | The number of availability zones you want to assign per volume. Currently, FinSpace only supports SINGLE for volumes. This places dataview in a single AZ. (SINGLE, MULTI) |
changeset_id | string | A unique identifier of the changeset that you want to use to ingest data. (pattern: <code>^[a-zA-Z0-9]+$</code>) |
created_timestamp | string (date-time) | The timestamp at which the dataview was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. |
database_name | string | The name of the database where you created the dataview. (pattern: <code>^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$</code>) |
dataview_name | string | A unique identifier for the dataview. (pattern: <code>^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$</code>) |
description | string | A description of the dataview. (pattern: <code>^[a-zA-Z0-9. ]{1,1000}$</code>) |
environment_id | string | A unique identifier for the kdb environment, from where you want to retrieve the dataview details. (pattern: <code>.\S.</code>) |
last_modified_timestamp | string (date-time) | The last time that the dataview was updated in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000. |
read_write | boolean | Returns True if the dataview is created as writeable and False otherwise. |
segment_configurations | array | The configuration that contains the database path of the data that you want to place on each selected volume. Each segment must have a unique database path for each volume. If you do not explicitly specify any database path for a volume, they are accessible from the cluster through the default S3/object store segment. |
status | string | The status of dataview creation. CREATING – The dataview creation is in progress. UPDATING – The dataview is in the process of being updated. ACTIVE – The dataview is active. (CREATING, ACTIVE, UPDATING, FAILED, DELETING) |
status_reason | string | The error message when a failed state occurs. (pattern: <code>^[a-zA-Z0-9_-.\s]+$</code>) |
| Name | Datatype | Description |
|---|---|---|
kx_dataviews | array | The list of kdb dataviews that are currently active for the given database. |
next_token | string | A token that indicates where a results page should begin. (pattern: <code>.*</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_kx_dataview | select | environment_id, database_name, dataview_name, region | Retrieves details of the dataview. | |
list_kx_dataviews | select | environment_id, database_name, region | nextToken, maxResults | Returns a list of all the dataviews in the database. |
create_kx_dataview | insert | environment_id, database_name, region, dataviewName, azMode, clientToken | Creates a snapshot of kdb database with tiered storage capabilities and a pre-warmed cache, ready for mounting on kdb clusters. Dataviews are only available for clusters running on a scaling group. They are not supported on dedicated clusters. | |
update_kx_dataview | update | environment_id, database_name, dataview_name, region, clientToken | Updates the specified dataview. The dataviews get automatically updated when any new changesets are ingested. Each update of the dataview creates a new version, including changeset details and cache configurations | |
delete_kx_dataview | delete | environment_id, database_name, dataview_name, clientToken, region | Deletes the specified dataview. Before deleting a dataview, make sure that it is not in use by any cluster. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
clientToken | string | A token that ensures idempotency. This token expires in 10 minutes. |
database_name | string | The name of the database whose dataview you want to delete. |
dataview_name | string | The name of the dataview that you want to delete. |
environment_id | string | A unique identifier for the kdb environment, from where you want to delete the dataview. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The maximum number of results to return in this request. |
nextToken | string | A token that indicates where a results page should begin. |
SELECT examples
- get_kx_dataview
- list_kx_dataviews
Retrieves details of the dataview.
SELECT
active_versions,
auto_update,
availability_zone_id,
az_mode,
changeset_id,
created_timestamp,
database_name,
dataview_name,
description,
environment_id,
last_modified_timestamp,
read_write,
segment_configurations,
status,
status_reason
FROM aws.finspace.kx_dataviews
WHERE environment_id = '{{ environment_id }}' -- required
AND database_name = '{{ database_name }}' -- required
AND dataview_name = '{{ dataview_name }}' -- required
AND region = '{{ region }}' -- required
;
Returns a list of all the dataviews in the database.
SELECT
kx_dataviews,
next_token
FROM aws.finspace.kx_dataviews
WHERE environment_id = '{{ environment_id }}' -- required
AND database_name = '{{ database_name }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_kx_dataview
- Manifest
Creates a snapshot of kdb database with tiered storage capabilities and a pre-warmed cache, ready for mounting on kdb clusters. Dataviews are only available for clusters running on a scaling group. They are not supported on dedicated clusters.
INSERT INTO aws.finspace.kx_dataviews (
dataviewName,
azMode,
availabilityZoneId,
changesetId,
segmentConfigurations,
autoUpdate,
readWrite,
description,
tags,
clientToken,
environment_id,
database_name,
region
)
SELECT
'{{ dataviewName }}' /* required */,
'{{ azMode }}' /* required */,
'{{ availabilityZoneId }}',
'{{ changesetId }}',
'{{ segmentConfigurations }}',
{{ autoUpdate }},
{{ readWrite }},
'{{ description }}',
'{{ tags }}',
'{{ clientToken }}' /* required */,
'{{ environment_id }}',
'{{ database_name }}',
'{{ region }}'
RETURNING
auto_update,
availability_zone_id,
az_mode,
changeset_id,
created_timestamp,
database_name,
dataview_name,
description,
environment_id,
last_modified_timestamp,
read_write,
segment_configurations,
status
;
# Description fields are for documentation purposes
- name: kx_dataviews
props:
- name: environment_id
value: "{{ environment_id }}"
description: Required parameter for the kx_dataviews resource.
- name: database_name
value: "{{ database_name }}"
description: Required parameter for the kx_dataviews resource.
- name: region
value: "{{ region }}"
description: Required parameter for the kx_dataviews resource.
- name: dataviewName
value: "{{ dataviewName }}"
- name: azMode
value: "{{ azMode }}"
valid_values: ['SINGLE', 'MULTI']
- name: availabilityZoneId
value: "{{ availabilityZoneId }}"
- name: changesetId
value: "{{ changesetId }}"
- name: segmentConfigurations
value:
- dbPaths: "{{ dbPaths }}"
volumeName: "{{ volumeName }}"
onDemand: {{ onDemand }}
- name: autoUpdate
value: {{ autoUpdate }}
- name: readWrite
value: {{ readWrite }}
- name: description
value: "{{ description }}"
- name: tags
value: "{{ tags }}"
- name: clientToken
value: "{{ clientToken }}"
UPDATE examples
- update_kx_dataview
Updates the specified dataview. The dataviews get automatically updated when any new changesets are ingested. Each update of the dataview creates a new version, including changeset details and cache configurations
UPDATE aws.finspace.kx_dataviews
SET
description = '{{ description }}',
changesetId = '{{ changesetId }}',
segmentConfigurations = '{{ segmentConfigurations }}',
clientToken = '{{ clientToken }}'
WHERE
environment_id = '{{ environment_id }}' --required
AND database_name = '{{ database_name }}' --required
AND dataview_name = '{{ dataview_name }}' --required
AND region = '{{ region }}' --required
AND clientToken = '{{ clientToken }}' --required
RETURNING
active_versions,
auto_update,
availability_zone_id,
az_mode,
changeset_id,
created_timestamp,
database_name,
dataview_name,
description,
environment_id,
last_modified_timestamp,
read_write,
segment_configurations,
status;
DELETE examples
- delete_kx_dataview
Deletes the specified dataview. Before deleting a dataview, make sure that it is not in use by any cluster.
DELETE FROM aws.finspace.kx_dataviews
WHERE environment_id = '{{ environment_id }}' --required
AND database_name = '{{ database_name }}' --required
AND dataview_name = '{{ dataview_name }}' --required
AND clientToken = '{{ clientToken }}' --required
AND region = '{{ region }}' --required
;