Skip to main content

log_scopes

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

Overview

Namelog_scopes
TypeResource
Idgoogle.logging.log_scopes

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the log scope.Log scopes are only available in the global location. For example:projects/my-project/locations/global/logScopes/my-log-scope
createTimestring (google-datetime)Output only. The creation timestamp of the log scope.
descriptionstringOptional. Describes this log scope.The maximum length of the description is 8000 characters.
resourceNamesarrayRequired. Names of one or more parent resources: projects/[PROJECT_ID]May alternatively be one or more views: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]A log scope can include a maximum of 5 projects and a maximum of 100 resources in total.
updateTimestring (google-datetime)Output only. The last update timestamp of the log scope.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_log_scopes_getselectprojectsId, locationsId, logScopesIdGets a log scope.
organizations_locations_log_scopes_getselectorganizationsId, locationsId, logScopesIdGets a log scope.
folders_locations_log_scopes_getselectfoldersId, locationsId, logScopesIdGets a log scope.
projects_locations_log_scopes_listselectprojectsId, locationsIdpageToken, pageSizeLists log scopes.
organizations_locations_log_scopes_listselectorganizationsId, locationsIdpageToken, pageSizeLists log scopes.
folders_locations_log_scopes_listselectfoldersId, locationsIdpageToken, pageSizeLists log scopes.
projects_locations_log_scopes_createinsertprojectsId, locationsIdlogScopeIdCreates a log scope.
organizations_locations_log_scopes_createinsertorganizationsId, locationsIdlogScopeIdCreates a log scope.
folders_locations_log_scopes_createinsertfoldersId, locationsIdlogScopeIdCreates a log scope.
projects_locations_log_scopes_patchupdateprojectsId, locationsId, logScopesIdupdateMaskUpdates a log scope.
organizations_locations_log_scopes_patchupdateorganizationsId, locationsId, logScopesIdupdateMaskUpdates a log scope.
folders_locations_log_scopes_patchupdatefoldersId, locationsId, logScopesIdupdateMaskUpdates a log scope.
projects_locations_log_scopes_deletedeleteprojectsId, locationsId, logScopesIdDeletes a log scope.
organizations_locations_log_scopes_deletedeleteorganizationsId, locationsId, logScopesIdDeletes a log scope.
folders_locations_log_scopes_deletedeletefoldersId, locationsId, logScopesIdDeletes a log scope.

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
foldersIdstring
locationsIdstring
logScopesIdstring
organizationsIdstring
projectsIdstring
logScopeIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets a log scope.

SELECT
name,
createTime,
description,
resourceNames,
updateTime
FROM google.logging.log_scopes
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND logScopesId = '{{ logScopesId }}' -- required;

INSERT examples

Creates a log scope.

INSERT INTO google.logging.log_scopes (
data__resourceNames,
data__description,
projectsId,
locationsId,
logScopeId
)
SELECT
'{{ resourceNames }}',
'{{ description }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ logScopeId }}'
RETURNING
name,
createTime,
description,
resourceNames,
updateTime
;

UPDATE examples

Updates a log scope.

UPDATE google.logging.log_scopes
SET
data__resourceNames = '{{ resourceNames }}',
data__description = '{{ description }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND logScopesId = '{{ logScopesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
description,
resourceNames,
updateTime;

DELETE examples

Deletes a log scope.

DELETE FROM google.logging.log_scopes
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND logScopesId = '{{ logScopesId }}' --required;