saved_queries
Creates, updates, deletes, gets or lists a saved_queries
resource.
Overview
Name | saved_queries |
Type | Resource |
Id | google.cloudasset.saved_queries |
Fields
Name | Datatype | Description |
---|---|---|
name | string | The resource name of the saved query. The format must be: projects/project_number/savedQueries/saved_query_id folders/folder_number/savedQueries/saved_query_id * organizations/organization_number/savedQueries/saved_query_id |
description | string | The description of this saved query. This value should be fewer than 255 characters. |
content | object | The query content. |
createTime | string | Output only. The create time of this saved query. |
creator | string | Output only. The account's email address who has created this saved query. |
labels | object | Labels applied on the resource. This value should not contain more than 10 entries. The key and value of each entry must be non-empty and fewer than 64 characters. |
lastUpdateTime | string | Output only. The last update time of this saved query. |
lastUpdater | string | Output only. The account's email address who has updated this saved query most recently. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | name | Gets details about a saved query. |
list | SELECT | parent, parentType | Lists all saved queries in a parent project/folder/organization. |
create | INSERT | parent, parentType | Creates a saved query in a parent project/folder/organization. |
delete | DELETE | name | Deletes a saved query. |
patch | UPDATE | name | Updates a saved query. |
SELECT
examples
Gets details about a saved query.
SELECT
name,
description,
content,
createTime,
creator,
labels,
lastUpdateTime,
lastUpdater
FROM google.cloudasset.saved_queries
WHERE name = '{{ name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new saved_queries
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.cloudasset.saved_queries (
parent,
parentType,
name,
description,
labels,
content
)
SELECT
'{{ parent }}',
'{{ parentType }}',
'{{ name }}',
'{{ description }}',
'{{ labels }}',
'{{ content }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: description
value: string
- name: createTime
value: string
- name: creator
value: string
- name: lastUpdateTime
value: string
- name: lastUpdater
value: string
- name: labels
value: object
- name: content
value:
- name: iamPolicyAnalysisQuery
value:
- name: scope
value: string
- name: resourceSelector
value:
- name: fullResourceName
value: string
- name: identitySelector
value:
- name: identity
value: string
- name: accessSelector
value:
- name: roles
value:
- string
- name: permissions
value:
- string
- name: options
value:
- name: expandGroups
value: boolean
- name: expandRoles
value: boolean
- name: expandResources
value: boolean
- name: outputResourceEdges
value: boolean
- name: outputGroupEdges
value: boolean
- name: analyzeServiceAccountImpersonation
value: boolean
- name: conditionContext
value:
- name: accessTime
value: string
UPDATE
example
Updates a saved_queries
resource.
/*+ update */
UPDATE google.cloudasset.saved_queries
SET
name = '{{ name }}',
description = '{{ description }}',
labels = '{{ labels }}',
content = '{{ content }}'
WHERE
name = '{{ name }}';
DELETE
example
Deletes the specified saved_queries
resource.
/*+ delete */
DELETE FROM google.cloudasset.saved_queries
WHERE name = '{{ name }}';