Skip to main content

links

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

Overview

Namelinks
TypeResource
Idgoogle.logging.links

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the link. The name can have up to 100 characters. A valid link id (at the end of the link name) must only have alphanumeric characters and underscores within it. "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" For example:`projects/my-project/locations/global/buckets/my-bucket/links/my_link
bigqueryDatasetobjectOptional. The information of a BigQuery Dataset. When a link is created, a BigQuery dataset is created along with it, in the same project as the LogBucket it's linked to. This dataset will also have BigQuery Views corresponding to the LogViews in the bucket. (id: BigQueryDataset)
createTimestring (google-datetime)Output only. The creation timestamp of the link.
descriptionstringOptional. Describes this link.The maximum length of the description is 8000 characters.
lifecycleStatestringOutput only. The resource lifecycle state.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_buckets_links_getselectprojectsId, locationsId, bucketsId, linksIdGets a link.
organizations_locations_buckets_links_getselectorganizationsId, locationsId, bucketsId, linksIdGets a link.
folders_locations_buckets_links_getselectfoldersId, locationsId, bucketsId, linksIdGets a link.
billing_accounts_locations_buckets_links_getselectbillingAccountsId, locationsId, bucketsId, linksIdGets a link.
projects_locations_buckets_links_listselectprojectsId, locationsId, bucketsIdpageToken, pageSizeLists links.
organizations_locations_buckets_links_listselectorganizationsId, locationsId, bucketsIdpageToken, pageSizeLists links.
folders_locations_buckets_links_listselectfoldersId, locationsId, bucketsIdpageToken, pageSizeLists links.
billing_accounts_locations_buckets_links_listselectbillingAccountsId, locationsId, bucketsIdpageToken, pageSizeLists links.
locations_buckets_links_listselectparentType, parentpageToken, pageSizeLists links.
projects_locations_buckets_links_createinsertprojectsId, locationsId, bucketsIdlinkIdAsynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.
organizations_locations_buckets_links_createinsertorganizationsId, locationsId, bucketsIdlinkIdAsynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.
folders_locations_buckets_links_createinsertfoldersId, locationsId, bucketsIdlinkIdAsynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.
billing_accounts_locations_buckets_links_createinsertbillingAccountsId, locationsId, bucketsIdlinkIdAsynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.
locations_buckets_links_createinsertparentType, parentlinkIdAsynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.
projects_locations_buckets_links_deletedeleteprojectsId, locationsId, bucketsId, linksIdDeletes a link. This will also delete the corresponding BigQuery linked dataset.
organizations_locations_buckets_links_deletedeleteorganizationsId, locationsId, bucketsId, linksIdDeletes a link. This will also delete the corresponding BigQuery linked dataset.
folders_locations_buckets_links_deletedeletefoldersId, locationsId, bucketsId, linksIdDeletes a link. This will also delete the corresponding BigQuery linked dataset.
billing_accounts_locations_buckets_links_deletedeletebillingAccountsId, locationsId, bucketsId, linksIdDeletes a link. This will also delete the corresponding BigQuery linked dataset.

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
linksIdstring
locationsIdstring
organizationsIdstring
parentstring
parentTypestring
projectsIdstring
linkIdstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets a link.

SELECT
name,
bigqueryDataset,
createTime,
description,
lifecycleState
FROM google.logging.links
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND bucketsId = '{{ bucketsId }}' -- required
AND linksId = '{{ linksId }}' -- required;

INSERT examples

Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.

INSERT INTO google.logging.links (
data__description,
data__bigqueryDataset,
projectsId,
locationsId,
bucketsId,
linkId
)
SELECT
'{{ description }}',
'{{ bigqueryDataset }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ bucketsId }}',
'{{ linkId }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples

Deletes a link. This will also delete the corresponding BigQuery linked dataset.

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