Skip to main content

views

Creates, updates, deletes, gets or lists a views resource.

Overview

Nameviews
TypeResource
Idgoogle.logging.views

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the view.For example:projects/my-project/locations/global/buckets/my-bucket/views/my-view
createTimestring (google-datetime)Output only. The creation timestamp of the view.
descriptionstringOptional. Describes this view.
filterstringOptional. Filter that restricts which log entries in a bucket are visible in this view.Filters must be logical conjunctions that use the AND operator, and they can use any of the following qualifiers: SOURCE(), which specifies a project, folder, organization, or billing account of origin. resource.type, which specifies the resource type. LOG_ID(), which identifies the log.They can also use the negations of these qualifiers with the NOT operator.For example:SOURCE("projects/myproject") AND resource.type = "gce_instance" AND NOT LOG_ID("stdout")
updateTimestring (google-datetime)Output only. The last update timestamp of the view.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_buckets_views_getselectprojectsId, locationsId, bucketsId, viewsIdGets a view on a log bucket.
organizations_locations_buckets_views_getselectorganizationsId, locationsId, bucketsId, viewsIdGets a view on a log bucket.
folders_locations_buckets_views_getselectfoldersId, locationsId, bucketsId, viewsIdGets a view on a log bucket.
billing_accounts_locations_buckets_views_getselectbillingAccountsId, locationsId, bucketsId, viewsIdGets a view on a log bucket.
projects_locations_buckets_views_listselectprojectsId, locationsId, bucketsIdpageToken, pageSizeLists views on a log bucket.
organizations_locations_buckets_views_listselectorganizationsId, locationsId, bucketsIdpageToken, pageSizeLists views on a log bucket.
folders_locations_buckets_views_listselectfoldersId, locationsId, bucketsIdpageToken, pageSizeLists views on a log bucket.
billing_accounts_locations_buckets_views_listselectbillingAccountsId, locationsId, bucketsIdpageToken, pageSizeLists views on a log bucket.
locations_buckets_views_listselectparentType, parentpageToken, pageSizeLists views on a log bucket.
projects_locations_buckets_views_createinsertprojectsId, locationsId, bucketsIdviewIdCreates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.
organizations_locations_buckets_views_createinsertorganizationsId, locationsId, bucketsIdviewIdCreates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.
folders_locations_buckets_views_createinsertfoldersId, locationsId, bucketsIdviewIdCreates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.
billing_accounts_locations_buckets_views_createinsertbillingAccountsId, locationsId, bucketsIdviewIdCreates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.
locations_buckets_views_createinsertparentType, parentviewIdCreates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.
projects_locations_buckets_views_patchupdateprojectsId, locationsId, bucketsId, viewsIdupdateMaskUpdates a view on a log bucket. This method replaces the value of the filter field from the existing view with the corresponding value from the new view. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.
organizations_locations_buckets_views_patchupdateorganizationsId, locationsId, bucketsId, viewsIdupdateMaskUpdates a view on a log bucket. This method replaces the value of the filter field from the existing view with the corresponding value from the new view. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.
folders_locations_buckets_views_patchupdatefoldersId, locationsId, bucketsId, viewsIdupdateMaskUpdates a view on a log bucket. This method replaces the value of the filter field from the existing view with the corresponding value from the new view. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.
billing_accounts_locations_buckets_views_patchupdatebillingAccountsId, locationsId, bucketsId, viewsIdupdateMaskUpdates a view on a log bucket. This method replaces the value of the filter field from the existing view with the corresponding value from the new view. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.
projects_locations_buckets_views_deletedeleteprojectsId, locationsId, bucketsId, viewsIdDeletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.
organizations_locations_buckets_views_deletedeleteorganizationsId, locationsId, bucketsId, viewsIdDeletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.
folders_locations_buckets_views_deletedeletefoldersId, locationsId, bucketsId, viewsIdDeletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.
billing_accounts_locations_buckets_views_deletedeletebillingAccountsId, locationsId, bucketsId, viewsIdDeletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.

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.

NameDatatypeDescription
billingAccountsIdstring
bucketsIdstring
foldersIdstring
locationsIdstring
organizationsIdstring
parentstring
parentTypestring
projectsIdstring
viewsIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)
viewIdstring

SELECT examples

Gets a view on a log bucket.

SELECT
name,
createTime,
description,
filter,
updateTime
FROM google.logging.views
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND bucketsId = '{{ bucketsId }}' -- required
AND viewsId = '{{ viewsId }}' -- required;

INSERT examples

Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.

INSERT INTO google.logging.views (
data__description,
data__filter,
projectsId,
locationsId,
bucketsId,
viewId
)
SELECT
'{{ description }}',
'{{ filter }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ bucketsId }}',
'{{ viewId }}'
RETURNING
name,
createTime,
description,
filter,
updateTime
;

UPDATE examples

Updates a view on a log bucket. This method replaces the value of the filter field from the existing view with the corresponding value from the new view. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.

UPDATE google.logging.views
SET
data__description = '{{ description }}',
data__filter = '{{ filter }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND bucketsId = '{{ bucketsId }}' --required
AND viewsId = '{{ viewsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
description,
filter,
updateTime;

DELETE examples

Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.

DELETE FROM google.logging.views
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND bucketsId = '{{ bucketsId }}' --required
AND viewsId = '{{ viewsId }}' --required;