buckets
Creates, updates, deletes, gets or lists a buckets
resource.
Overview
Name | buckets |
Type | Resource |
Id | google.logging.buckets |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Output only. The resource name of the bucket.For example:projects/my-project/locations/global/buckets/my-bucketFor a list of supported locations, see Supported Regions (https://cloud.google.com/logging/docs/region-support)For the location of global it is unspecified where log entries are actually stored.After a bucket has been created, the location cannot be changed. |
description | string | Optional. Describes this bucket. |
analyticsEnabled | boolean | Optional. Whether log analytics is enabled for this bucket.Once enabled, log analytics features cannot be disabled. |
cmekSettings | object | Describes the customer-managed encryption key (CMEK) settings associated with a project, folder, organization, billing account, or flexible resource.Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Log Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. |
createTime | string | Output only. The creation timestamp of the bucket. This is not set for any of the default buckets. |
indexConfigs | array | Optional. A list of indexed fields and related configuration data. |
lifecycleState | string | Output only. The bucket lifecycle state. |
locked | boolean | Optional. Whether the bucket is locked.The retention period on a locked bucket cannot be changed. Locked buckets may only be deleted if they are empty. |
restrictedFields | array | Optional. Log entry field paths that are denied access in this bucket.The following fields and their children are eligible: textPayload, jsonPayload, protoPayload, httpRequest, labels, sourceLocation.Restricting a repeated field will restrict all values. Adding a parent will block all child fields. (e.g. foo.bar will block foo.bar.baz) |
retentionDays | integer | Optional. Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used. |
updateTime | string | Output only. The last update timestamp of the bucket. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
billing_accounts_locations_buckets_get | SELECT | billingAccountsId, bucketsId, locationsId | Gets a log bucket. |
billing_accounts_locations_buckets_list | SELECT | billingAccountsId, locationsId | Lists log buckets. |
folders_locations_buckets_get | SELECT | bucketsId, foldersId, locationsId | Gets a log bucket. |
folders_locations_buckets_list | SELECT | foldersId, locationsId | Lists log buckets. |
locations_buckets_list | SELECT | parent, parentType | Lists log buckets. |
organizations_locations_buckets_get | SELECT | bucketsId, locationsId, organizationsId | Gets a log bucket. |
organizations_locations_buckets_list | SELECT | locationsId, organizationsId | Lists log buckets. |
projects_locations_buckets_get | SELECT | bucketsId, locationsId, projectsId | Gets a log bucket. |
projects_locations_buckets_list | SELECT | locationsId, projectsId | Lists log buckets. |
billing_accounts_locations_buckets_create | INSERT | billingAccountsId, locationsId | Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed. |
folders_locations_buckets_create | INSERT | foldersId, locationsId | Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed. |
locations_buckets_create | INSERT | parent, parentType | Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed. |
organizations_locations_buckets_create | INSERT | locationsId, organizationsId | Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed. |
projects_locations_buckets_create | INSERT | locationsId, projectsId | Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed. |
billing_accounts_locations_buckets_delete | DELETE | billingAccountsId, bucketsId, locationsId | Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted. |
folders_locations_buckets_delete | DELETE | bucketsId, foldersId, locationsId | Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted. |
organizations_locations_buckets_delete | DELETE | bucketsId, locationsId, organizationsId | Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted. |
projects_locations_buckets_delete | DELETE | bucketsId, locationsId, projectsId | Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted. |
billing_accounts_locations_buckets_patch | UPDATE | billingAccountsId, bucketsId, locationsId | Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed. |
folders_locations_buckets_patch | UPDATE | bucketsId, foldersId, locationsId | Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed. |
organizations_locations_buckets_patch | UPDATE | bucketsId, locationsId, organizationsId | Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed. |
projects_locations_buckets_patch | UPDATE | bucketsId, locationsId, projectsId | Updates a log bucket.If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed. |
billing_accounts_locations_buckets_undelete | EXEC | billingAccountsId, bucketsId, locationsId | Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days. |
folders_locations_buckets_undelete | EXEC | bucketsId, foldersId, locationsId | Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days. |
locations_buckets_undelete | EXEC | name | Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days. |
organizations_locations_buckets_undelete | EXEC | bucketsId, locationsId, organizationsId | Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days. |
projects_locations_buckets_undelete | EXEC | bucketsId, locationsId, projectsId | Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days. |
SELECT
examples
Lists log buckets.
SELECT
name,
description,
analyticsEnabled,
cmekSettings,
createTime,
indexConfigs,
lifecycleState,
locked,
restrictedFields,
retentionDays,
updateTime
FROM google.logging.buckets
WHERE parent = '{{ parent }}'
AND parentType = '{{ parentType }}';
INSERT
example
Use the following StackQL query and manifest file to create a new buckets
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.logging.buckets (
parent,
parentType,
description,
retentionDays,
locked,
analyticsEnabled,
restrictedFields,
indexConfigs,
cmekSettings
)
SELECT
'{{ parent }}',
'{{ parentType }}',
'{{ description }}',
'{{ retentionDays }}',
{{ locked }},
{{ analyticsEnabled }},
'{{ restrictedFields }}',
'{{ indexConfigs }}',
'{{ cmekSettings }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: description
value: string
- name: createTime
value: string
- name: updateTime
value: string
- name: retentionDays
value: integer
- name: locked
value: boolean
- name: lifecycleState
value: string
- name: analyticsEnabled
value: boolean
- name: restrictedFields
value:
- string
- name: indexConfigs
value:
- - name: fieldPath
value: string
- name: type
value: string
- name: createTime
value: string
- name: cmekSettings
value:
- name: name
value: string
- name: kmsKeyName
value: string
- name: kmsKeyVersionName
value: string
- name: serviceAccountId
value: string
UPDATE
example
Updates a buckets
resource.
/*+ update */
UPDATE google.logging.buckets
SET
description = '{{ description }}',
retentionDays = '{{ retentionDays }}',
locked = true|false,
analyticsEnabled = true|false,
restrictedFields = '{{ restrictedFields }}',
indexConfigs = '{{ indexConfigs }}',
cmekSettings = '{{ cmekSettings }}'
WHERE
bucketsId = '{{ bucketsId }}'
AND foldersId = '{{ foldersId }}'
AND locationsId = '{{ locationsId }}';
DELETE
example
Deletes the specified buckets
resource.
/*+ delete */
DELETE FROM google.logging.buckets
WHERE bucketsId = '{{ bucketsId }}'
AND foldersId = '{{ foldersId }}'
AND locationsId = '{{ locationsId }}';