query_templates
Creates, updates, deletes, gets or lists a query_templates
resource.
Overview
Name | query_templates |
Type | Resource |
Id | google.analyticshub.query_templates |
Fields
The following fields are returned by SELECT
queries:
- projects_locations_data_exchanges_query_templates_get
- projects_locations_data_exchanges_query_templates_list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. The resource name of the QueryTemplate. e.g. projects/myproject/locations/us/dataExchanges/123/queryTemplates/456 |
createTime | string (google-datetime) | Output only. Timestamp when the QueryTemplate was created. |
description | string | Optional. Short description of the QueryTemplate. The description must not contain Unicode non-characters and C0 and C1 control codes except tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default value is an empty string. Max length: 2000 bytes. |
displayName | string | Required. Human-readable display name of the QueryTemplate. The display name must contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces. Default value is an empty string. Max length: 63 bytes. |
documentation | string | Optional. Documentation describing the QueryTemplate. |
primaryContact | string | Optional. Email or URL of the primary point of contact of the QueryTemplate. Max Length: 1000 bytes. |
proposer | string | Optional. Will be deprecated. Email or URL of the primary point of contact of the QueryTemplate. Max Length: 1000 bytes. |
routine | object | Optional. The routine associated with the QueryTemplate. (id: Routine) |
state | string | Output only. The QueryTemplate lifecycle state. |
updateTime | string (google-datetime) | Output only. Timestamp when the QueryTemplate was last modified. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. The resource name of the QueryTemplate. e.g. projects/myproject/locations/us/dataExchanges/123/queryTemplates/456 |
createTime | string (google-datetime) | Output only. Timestamp when the QueryTemplate was created. |
description | string | Optional. Short description of the QueryTemplate. The description must not contain Unicode non-characters and C0 and C1 control codes except tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default value is an empty string. Max length: 2000 bytes. |
displayName | string | Required. Human-readable display name of the QueryTemplate. The display name must contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces. Default value is an empty string. Max length: 63 bytes. |
documentation | string | Optional. Documentation describing the QueryTemplate. |
primaryContact | string | Optional. Email or URL of the primary point of contact of the QueryTemplate. Max Length: 1000 bytes. |
proposer | string | Optional. Will be deprecated. Email or URL of the primary point of contact of the QueryTemplate. Max Length: 1000 bytes. |
routine | object | Optional. The routine associated with the QueryTemplate. (id: Routine) |
state | string | Output only. The QueryTemplate lifecycle state. |
updateTime | string (google-datetime) | Output only. Timestamp when the QueryTemplate was last modified. |
Methods
The following methods are available for this resource:
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 |
---|---|---|
dataExchangesId | string | |
locationsId | string | |
projectsId | string | |
queryTemplatesId | string | |
pageSize | integer (int32) | |
pageToken | string | |
queryTemplateId | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- projects_locations_data_exchanges_query_templates_get
- projects_locations_data_exchanges_query_templates_list
Gets a QueryTemplate
SELECT
name,
createTime,
description,
displayName,
documentation,
primaryContact,
proposer,
routine,
state,
updateTime
FROM google.analyticshub.query_templates
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND dataExchangesId = '{{ dataExchangesId }}' -- required
AND queryTemplatesId = '{{ queryTemplatesId }}' -- required;
Lists all QueryTemplates in a given project and location.
SELECT
name,
createTime,
description,
displayName,
documentation,
primaryContact,
proposer,
routine,
state,
updateTime
FROM google.analyticshub.query_templates
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND dataExchangesId = '{{ dataExchangesId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- projects_locations_data_exchanges_query_templates_create
- Manifest
Creates a new QueryTemplate
INSERT INTO google.analyticshub.query_templates (
data__displayName,
data__description,
data__proposer,
data__primaryContact,
data__documentation,
data__routine,
projectsId,
locationsId,
dataExchangesId,
queryTemplateId
)
SELECT
'{{ displayName }}',
'{{ description }}',
'{{ proposer }}',
'{{ primaryContact }}',
'{{ documentation }}',
'{{ routine }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ dataExchangesId }}',
'{{ queryTemplateId }}'
RETURNING
name,
createTime,
description,
displayName,
documentation,
primaryContact,
proposer,
routine,
state,
updateTime
;
# Description fields are for documentation purposes
- name: query_templates
props:
- name: projectsId
value: string
description: Required parameter for the query_templates resource.
- name: locationsId
value: string
description: Required parameter for the query_templates resource.
- name: dataExchangesId
value: string
description: Required parameter for the query_templates resource.
- name: displayName
value: string
description: >
Required. Human-readable display name of the QueryTemplate. The display name must contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces. Default value is an empty string. Max length: 63 bytes.
- name: description
value: string
description: >
Optional. Short description of the QueryTemplate. The description must not contain Unicode non-characters and C0 and C1 control codes except tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default value is an empty string. Max length: 2000 bytes.
- name: proposer
value: string
description: >
Optional. Will be deprecated. Email or URL of the primary point of contact of the QueryTemplate. Max Length: 1000 bytes.
- name: primaryContact
value: string
description: >
Optional. Email or URL of the primary point of contact of the QueryTemplate. Max Length: 1000 bytes.
- name: documentation
value: string
description: >
Optional. Documentation describing the QueryTemplate.
- name: routine
value: object
description: >
Optional. The routine associated with the QueryTemplate.
- name: queryTemplateId
value: string
UPDATE
examples
- projects_locations_data_exchanges_query_templates_patch
Updates an existing QueryTemplate
UPDATE google.analyticshub.query_templates
SET
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__proposer = '{{ proposer }}',
data__primaryContact = '{{ primaryContact }}',
data__documentation = '{{ documentation }}',
data__routine = '{{ routine }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND dataExchangesId = '{{ dataExchangesId }}' --required
AND queryTemplatesId = '{{ queryTemplatesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
description,
displayName,
documentation,
primaryContact,
proposer,
routine,
state,
updateTime;
DELETE
examples
- projects_locations_data_exchanges_query_templates_delete
Deletes a query template.
DELETE FROM google.analyticshub.query_templates
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND dataExchangesId = '{{ dataExchangesId }}' --required
AND queryTemplatesId = '{{ queryTemplatesId }}' --required;
Lifecycle Methods
- projects_locations_data_exchanges_query_templates_submit
- projects_locations_data_exchanges_query_templates_approve
Submits a query template for approval.
EXEC google.analyticshub.query_templates.projects_locations_data_exchanges_query_templates_submit
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@dataExchangesId='{{ dataExchangesId }}' --required,
@queryTemplatesId='{{ queryTemplatesId }}' --required;
Approves a query template.
EXEC google.analyticshub.query_templates.projects_locations_data_exchanges_query_templates_approve
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@dataExchangesId='{{ dataExchangesId }}' --required,
@queryTemplatesId='{{ queryTemplatesId }}' --required;