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

NameDatatypeDescription
namestringOutput only. The resource name of the log scope.For example:projects/my-project/locations/global/logScopes/my-log-scope
descriptionstringOptional. Describes this log scope.The maximum length of the description is 8000 characters.
createTimestringOutput only. The creation timestamp of the log scope.
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 50 projects and a maximum of 100 resources in total.
updateTimestringOutput only. The last update timestamp of the log scope.

Methods

NameAccessible byRequired ParamsDescription
folders_locations_log_scopes_getSELECTfoldersId, locationsId, logScopesIdGets a log scope.
folders_locations_log_scopes_listSELECTfoldersId, locationsIdLists log scopes.
organizations_locations_log_scopes_getSELECTlocationsId, logScopesId, organizationsIdGets a log scope.
organizations_locations_log_scopes_listSELECTlocationsId, organizationsIdLists log scopes.
projects_locations_log_scopes_getSELECTlocationsId, logScopesId, projectsIdGets a log scope.
projects_locations_log_scopes_listSELECTlocationsId, projectsIdLists log scopes.
folders_locations_log_scopes_createINSERTfoldersId, locationsIdCreates a log scope.
organizations_locations_log_scopes_createINSERTlocationsId, organizationsIdCreates a log scope.
projects_locations_log_scopes_createINSERTlocationsId, projectsIdCreates a log scope.
folders_locations_log_scopes_deleteDELETEfoldersId, locationsId, logScopesIdDeletes a log scope.
organizations_locations_log_scopes_deleteDELETElocationsId, logScopesId, organizationsIdDeletes a log scope.
projects_locations_log_scopes_deleteDELETElocationsId, logScopesId, projectsIdDeletes a log scope.
folders_locations_log_scopes_patchUPDATEfoldersId, locationsId, logScopesIdUpdates a log scope.
organizations_locations_log_scopes_patchUPDATElocationsId, logScopesId, organizationsIdUpdates a log scope.
projects_locations_log_scopes_patchUPDATElocationsId, logScopesId, projectsIdUpdates a log scope.

SELECT examples

Lists log scopes.

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

INSERT example

Use the following StackQL query and manifest file to create a new log_scopes resource.

/*+ create */
INSERT INTO google.logging.log_scopes (
foldersId,
locationsId,
resourceNames,
description
)
SELECT
'{{ foldersId }}',
'{{ locationsId }}',
'{{ resourceNames }}',
'{{ description }}'
;

UPDATE example

Updates a log_scopes resource.

/*+ update */
UPDATE google.logging.log_scopes
SET
resourceNames = '{{ resourceNames }}',
description = '{{ description }}'
WHERE
foldersId = '{{ foldersId }}'
AND locationsId = '{{ locationsId }}'
AND logScopesId = '{{ logScopesId }}';

DELETE example

Deletes the specified log_scopes resource.

/*+ delete */
DELETE FROM google.logging.log_scopes
WHERE foldersId = '{{ foldersId }}'
AND locationsId = '{{ locationsId }}'
AND logScopesId = '{{ logScopesId }}';