queries
Creates, updates, deletes, gets or lists a queries
resource.
Overview
Name | queries |
Type | Resource |
Id | google.apigee.queries |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Asynchronous Query Name. |
created | string | Creation time of the query. |
envgroupHostname | string | Hostname is available only when query is executed at host level. |
error | string | Error is set when query fails. |
executionTime | string | ExecutionTime is available only after the query is completed. |
queryParams | object | |
reportDefinitionId | string | Asynchronous Report ID. |
result | object | |
resultFileSize | string | ResultFileSize is available only after the query is completed. |
resultRows | string | ResultRows is available only after the query is completed. |
self | string | Self link of the query. Example: /organizations/myorg/environments/myenv/queries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd or following format if query is running at host level: /organizations/myorg/hostQueries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd |
state | string | Query state could be "enqueued", "running", "completed", "failed". |
updated | string | Last updated timestamp for the query. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
organizations_environments_queries_get | SELECT | environmentsId, organizationsId, queriesId | Get query status If the query is still in progress, the state is set to "running" After the query has completed successfully, state is set to "completed" |
organizations_environments_queries_list | SELECT | environmentsId, organizationsId | Return a list of Asynchronous Queries |
organizations_environments_queries_create | INSERT | environmentsId, organizationsId | Submit a query to be processed in the background. If the submission of the query succeeds, the API returns a 201 status and an ID that refer to the query. In addition to the HTTP status 201, the state of "enqueued" means that the request succeeded. |
SELECT
examples
Return a list of Asynchronous Queries
SELECT
name,
created,
envgroupHostname,
error,
executionTime,
queryParams,
reportDefinitionId,
result,
resultFileSize,
resultRows,
self,
state,
updated
FROM google.apigee.queries
WHERE environmentsId = '{{ environmentsId }}'
AND organizationsId = '{{ organizationsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new queries
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.apigee.queries (
environmentsId,
organizationsId,
name,
metrics,
filter,
envgroupHostname,
timeRange,
limit,
csvDelimiter,
reportDefinitionId,
dimensions,
outputFormat,
groupByTimeUnit
)
SELECT
'{{ environmentsId }}',
'{{ organizationsId }}',
'{{ name }}',
'{{ metrics }}',
'{{ filter }}',
'{{ envgroupHostname }}',
'{{ timeRange }}',
'{{ limit }}',
'{{ csvDelimiter }}',
'{{ reportDefinitionId }}',
'{{ dimensions }}',
'{{ outputFormat }}',
'{{ groupByTimeUnit }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: metrics
value:
- - name: function
value: string
- name: name
value: string
- name: value
value: string
- name: operator
value: string
- name: alias
value: string
- name: filter
value: string
- name: envgroupHostname
value: string
- name: timeRange
value: any
- name: limit
value: integer
- name: csvDelimiter
value: string
- name: reportDefinitionId
value: string
- name: dimensions
value:
- string
- name: outputFormat
value: string
- name: groupByTimeUnit
value: string