table
Creates, updates, deletes, gets or lists a table resource.
Overview
| Name | table |
| Type | Resource |
| Id | azure.data_tables.table |
Fields
The following fields are returned by SELECT queries:
- get_access_policy
| Name | Datatype | Description |
|---|---|---|
identifiers | array | An array of signed identifiers. Required. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_access_policy | select | table_name, account | timeout | Retrieves details about any stored access policies specified on the table that may be used with Shared Access Signatures. |
create | insert | account | $format, Prefer | Creates a new table under the given account. |
delete | delete | table_name, account | Deletes an existing table. | |
set_access_policy | exec | table_name, account, identifiers | timeout | Sets stored access policies for the table that may be used with Shared Access Signatures. |
query | exec | account | $format, $top, $select, $filter, NextTableName | Queries tables under the given account. |
query_entities | exec | table_name, account | $format, $top, $select, $filter, timeout, NextPartitionKey, NextRowKey | Queries entities under the given table. |
query_entity_with_partition_and_row_key | exec | table_name, partition_key, row_key, account | timeout, $format, $select, $filter | Retrieve a single entity. |
update_entity | exec | table_name, partition_key, row_key, account | timeout | Update entity in a table. |
merge_entity | exec | table_name, partition_key, row_key, account | timeout | Merge entity in a table. |
delete_entity | exec | table_name, partition_key, row_key, account | timeout | Deletes the specified entity in a table. |
insert_entity | exec | table_name, account | timeout, $format, Prefer | Insert entity in a table. |
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 |
|---|---|---|
account | string | Cosmos DB Table API account name. (default: ) |
partition_key | string | The partition key of the entity. Required. |
row_key | string | The row key of the entity. Required. |
table_name | string | The name of the table. Required. |
$filter | string | OData filter expression. Default value is None. |
$format | string | Specifies the metadata format for the response. Known values are: "application/json;odata=nometadata", "application/json;odata=minimalmetadata", and "application/json;odata=fullmetadata". Default value is None. |
$select | string | Select expression using OData notation. Limits the columns on each record to just those requested. Default value is None. |
$top | integer | Specifies the maximum number of records to return. Default value is None. |
NextPartitionKey | string | An entity partition key query continuation token from a previous call. Default value is None. |
NextRowKey | string | An entity row key query continuation token from a previous call. Default value is None. |
NextTableName | string | |
Prefer | string | Specifies whether the response should include the inserted entity in the payload. Possible values are return-no-content and return-content. Known values are: "return-no-content" and "return-content". Default value is None. |
timeout | integer | The timeout parameter is expressed in seconds. Default value is None. |
SELECT examples
- get_access_policy
Retrieves details about any stored access policies specified on the table that may be used with Shared Access Signatures.
SELECT
identifiers
FROM azure.data_tables.table
WHERE table_name = '{{ table_name }}' -- required
AND account = '{{ account }}' -- required
AND timeout = '{{ timeout }}'
;
INSERT examples
- create
- Manifest
Creates a new table under the given account.
INSERT INTO azure.data_tables.table (
TableName,
odata,
account,
$format,
Prefer
)
SELECT
'{{ TableName }}',
'{{ odata }}',
'{{ account }}',
'{{ $format }}',
'{{ Prefer }}'
RETURNING
TableName,
odata
;
# Description fields are for documentation purposes
- name: table
props:
- name: account
value: "{{ account }}"
description: Required parameter for the table resource.
- name: TableName
value: "{{ TableName }}"
description: |
The name of the table.
- name: odata
value:
type: "{{ type }}"
id: "{{ id }}"
editLink: "{{ editLink }}"
- name: $format
value: "{{ $format }}"
description: Specifies the metadata format for the response. Known values are: "application/json;odata=nometadata", "application/json;odata=minimalmetadata", and "application/json;odata=fullmetadata". Default value is None.
description: Specifies the metadata format for the response. Known values are: "application/json;odata=nometadata", "application/json;odata=minimalmetadata", and "application/json;odata=fullmetadata". Default value is None.
- name: Prefer
value: "{{ Prefer }}"
description: Specifies whether the response should include the created table in the payload. Possible values are return-no-content and return-content. Known values are: "return-no-content" and "return-content". Default value is None.
description: Specifies whether the response should include the created table in the payload. Possible values are return-no-content and return-content. Known values are: "return-no-content" and "return-content". Default value is None.
DELETE examples
- delete
Deletes an existing table.
DELETE FROM azure.data_tables.table
WHERE table_name = '{{ table_name }}' --required
AND account = '{{ account }}' --required
;
Lifecycle Methods
- set_access_policy
- query
- query_entities
- query_entity_with_partition_and_row_key
- update_entity
- merge_entity
- delete_entity
- insert_entity
Sets stored access policies for the table that may be used with Shared Access Signatures.
EXEC azure.data_tables.table.set_access_policy
@table_name='{{ table_name }}' --required,
@account='{{ account }}' --required,
@timeout='{{ timeout }}'
@@json=
'{
"identifiers": "{{ identifiers }}"
}'
;
Queries tables under the given account.
EXEC azure.data_tables.table.query
@account='{{ account }}' --required,
@$format='{{ $format }}',
@$top='{{ $top }}',
@$select='{{ $select }}',
@$filter='{{ $filter }}',
@NextTableName='{{ NextTableName }}'
;
Queries entities under the given table.
EXEC azure.data_tables.table.query_entities
@table_name='{{ table_name }}' --required,
@account='{{ account }}' --required,
@$format='{{ $format }}',
@$top='{{ $top }}',
@$select='{{ $select }}',
@$filter='{{ $filter }}',
@timeout='{{ timeout }}',
@NextPartitionKey='{{ NextPartitionKey }}',
@NextRowKey='{{ NextRowKey }}'
;
Retrieve a single entity.
EXEC azure.data_tables.table.query_entity_with_partition_and_row_key
@table_name='{{ table_name }}' --required,
@partition_key='{{ partition_key }}' --required,
@row_key='{{ row_key }}' --required,
@account='{{ account }}' --required,
@timeout='{{ timeout }}',
@$format='{{ $format }}',
@$select='{{ $select }}',
@$filter='{{ $filter }}'
;
Update entity in a table.
EXEC azure.data_tables.table.update_entity
@table_name='{{ table_name }}' --required,
@partition_key='{{ partition_key }}' --required,
@row_key='{{ row_key }}' --required,
@account='{{ account }}' --required,
@timeout='{{ timeout }}'
;
Merge entity in a table.
EXEC azure.data_tables.table.merge_entity
@table_name='{{ table_name }}' --required,
@partition_key='{{ partition_key }}' --required,
@row_key='{{ row_key }}' --required,
@account='{{ account }}' --required,
@timeout='{{ timeout }}'
;
Deletes the specified entity in a table.
EXEC azure.data_tables.table.delete_entity
@table_name='{{ table_name }}' --required,
@partition_key='{{ partition_key }}' --required,
@row_key='{{ row_key }}' --required,
@account='{{ account }}' --required,
@timeout='{{ timeout }}'
;
Insert entity in a table.
EXEC azure.data_tables.table.insert_entity
@table_name='{{ table_name }}' --required,
@account='{{ account }}' --required,
@timeout='{{ timeout }}',
@$format='{{ $format }}',
@Prefer='{{ Prefer }}'
;