Skip to content

Commit 39ab60b

Browse files
committed
Merge remote-tracking branch 'migration/main' into python-logging-migration
2 parents bc50019 + 94c0a04 commit 39ab60b

File tree

103 files changed

+13058
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+13058
-0
lines changed

logging/samples/AUTHORING_GUIDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md

logging/samples/CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/CONTRIBUTING.md
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CopyLogEntries
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-logging
24+
25+
26+
# [START logging_v2_generated_ConfigServiceV2_CopyLogEntries_async]
27+
# This snippet has been automatically generated and should be regarded as a
28+
# code template only.
29+
# It will require modifications to work:
30+
# - It may require correct/in-range values for request initialization.
31+
# - It may require specifying regional endpoints when creating the service
32+
# client as shown in:
33+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
34+
from google.cloud import logging_v2
35+
36+
37+
async def sample_copy_log_entries():
38+
# Create a client
39+
client = logging_v2.services.config_service_v2.ConfigServiceV2AsyncClient()
40+
41+
# Initialize request argument(s)
42+
request = logging_v2.types.CopyLogEntriesRequest(
43+
name="name_value",
44+
destination="destination_value",
45+
)
46+
47+
# Make the request
48+
operation = client.copy_log_entries(request=request)
49+
50+
print("Waiting for operation to complete...")
51+
52+
response = (await operation).result()
53+
54+
# Handle the response
55+
print(response)
56+
57+
# [END logging_v2_generated_ConfigServiceV2_CopyLogEntries_async]
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CopyLogEntries
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-logging
24+
25+
26+
# [START logging_v2_generated_ConfigServiceV2_CopyLogEntries_sync]
27+
# This snippet has been automatically generated and should be regarded as a
28+
# code template only.
29+
# It will require modifications to work:
30+
# - It may require correct/in-range values for request initialization.
31+
# - It may require specifying regional endpoints when creating the service
32+
# client as shown in:
33+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
34+
from google.cloud import logging_v2
35+
36+
37+
def sample_copy_log_entries():
38+
# Create a client
39+
client = logging_v2.services.config_service_v2.ConfigServiceV2Client()
40+
41+
# Initialize request argument(s)
42+
request = logging_v2.types.CopyLogEntriesRequest(
43+
name="name_value",
44+
destination="destination_value",
45+
)
46+
47+
# Make the request
48+
operation = client.copy_log_entries(request=request)
49+
50+
print("Waiting for operation to complete...")
51+
52+
response = operation.result()
53+
54+
# Handle the response
55+
print(response)
56+
57+
# [END logging_v2_generated_ConfigServiceV2_CopyLogEntries_sync]
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreateBucket
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-logging
24+
25+
26+
# [START logging_v2_generated_ConfigServiceV2_CreateBucket_async]
27+
# This snippet has been automatically generated and should be regarded as a
28+
# code template only.
29+
# It will require modifications to work:
30+
# - It may require correct/in-range values for request initialization.
31+
# - It may require specifying regional endpoints when creating the service
32+
# client as shown in:
33+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
34+
from google.cloud import logging_v2
35+
36+
37+
async def sample_create_bucket():
38+
# Create a client
39+
client = logging_v2.services.config_service_v2.ConfigServiceV2AsyncClient()
40+
41+
# Initialize request argument(s)
42+
request = logging_v2.types.CreateBucketRequest(
43+
parent="parent_value",
44+
bucket_id="bucket_id_value",
45+
)
46+
47+
# Make the request
48+
response = await client.create_bucket(request=request)
49+
50+
# Handle the response
51+
print(response)
52+
53+
# [END logging_v2_generated_ConfigServiceV2_CreateBucket_async]
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreateBucketAsync
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-logging
24+
25+
26+
# [START logging_v2_generated_ConfigServiceV2_CreateBucketAsync_async]
27+
# This snippet has been automatically generated and should be regarded as a
28+
# code template only.
29+
# It will require modifications to work:
30+
# - It may require correct/in-range values for request initialization.
31+
# - It may require specifying regional endpoints when creating the service
32+
# client as shown in:
33+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
34+
from google.cloud import logging_v2
35+
36+
37+
async def sample_create_bucket_async():
38+
# Create a client
39+
client = logging_v2.services.config_service_v2.ConfigServiceV2AsyncClient()
40+
41+
# Initialize request argument(s)
42+
request = logging_v2.types.CreateBucketRequest(
43+
parent="parent_value",
44+
bucket_id="bucket_id_value",
45+
)
46+
47+
# Make the request
48+
operation = client.create_bucket_async(request=request)
49+
50+
print("Waiting for operation to complete...")
51+
52+
response = (await operation).result()
53+
54+
# Handle the response
55+
print(response)
56+
57+
# [END logging_v2_generated_ConfigServiceV2_CreateBucketAsync_async]
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreateBucketAsync
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-logging
24+
25+
26+
# [START logging_v2_generated_ConfigServiceV2_CreateBucketAsync_sync]
27+
# This snippet has been automatically generated and should be regarded as a
28+
# code template only.
29+
# It will require modifications to work:
30+
# - It may require correct/in-range values for request initialization.
31+
# - It may require specifying regional endpoints when creating the service
32+
# client as shown in:
33+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
34+
from google.cloud import logging_v2
35+
36+
37+
def sample_create_bucket_async():
38+
# Create a client
39+
client = logging_v2.services.config_service_v2.ConfigServiceV2Client()
40+
41+
# Initialize request argument(s)
42+
request = logging_v2.types.CreateBucketRequest(
43+
parent="parent_value",
44+
bucket_id="bucket_id_value",
45+
)
46+
47+
# Make the request
48+
operation = client.create_bucket_async(request=request)
49+
50+
print("Waiting for operation to complete...")
51+
52+
response = operation.result()
53+
54+
# Handle the response
55+
print(response)
56+
57+
# [END logging_v2_generated_ConfigServiceV2_CreateBucketAsync_sync]
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for CreateBucket
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-cloud-logging
24+
25+
26+
# [START logging_v2_generated_ConfigServiceV2_CreateBucket_sync]
27+
# This snippet has been automatically generated and should be regarded as a
28+
# code template only.
29+
# It will require modifications to work:
30+
# - It may require correct/in-range values for request initialization.
31+
# - It may require specifying regional endpoints when creating the service
32+
# client as shown in:
33+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
34+
from google.cloud import logging_v2
35+
36+
37+
def sample_create_bucket():
38+
# Create a client
39+
client = logging_v2.services.config_service_v2.ConfigServiceV2Client()
40+
41+
# Initialize request argument(s)
42+
request = logging_v2.types.CreateBucketRequest(
43+
parent="parent_value",
44+
bucket_id="bucket_id_value",
45+
)
46+
47+
# Make the request
48+
response = client.create_bucket(request=request)
49+
50+
# Handle the response
51+
print(response)
52+
53+
# [END logging_v2_generated_ConfigServiceV2_CreateBucket_sync]

0 commit comments

Comments
 (0)