8000 [CloudAsset] Update client library version to v1. (#2076) · niralkk/python-docs-samples@eef7f5b · GitHub
[go: up one dir, main page]

Skip to content

Commit eef7f5b

Browse files
peter-zheng-gandrewsg
authored andcommitted
[CloudAsset] Update client library version to v1. (GoogleCloudPlatform#2076)
1 parent 3f5ad26 commit eef7f5b

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

asset/cloud-client/quickstart_batchgetassetshistory.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,18 @@
2020

2121
def batch_get_assets_history(project_id, asset_names):
2222
# [START asset_quickstart_batch_get_assets_history]
23-
from google.cloud import asset_v1beta1
24-
from google.cloud.asset_v1beta1.proto import assets_pb2
25-
from google.cloud.asset_v1beta1 import enums
23+
from google.cloud import asset_v1
24+
from google.cloud.asset_v1.proto import assets_pb2
25+
from google.cloud.asset_v1 import enums
2626

2727
# TODO project_id = 'Your Google Cloud Project ID'
2828
# TODO asset_names = 'Your asset names list, e.g.:
2929
# ["//storage.googleapis.com/[BUCKET_NAME]",]'
3030

31-
client = asset_v1beta1.AssetServiceClient()
31+
client = 8000 asset_v1.AssetServiceClient()
3232
parent = client.project_path(project_id)
3333
content_type = enums.ContentType.RESOURCE
3434
read_time_window = assets_pb2.TimeWindow()
35-
read_time_window.start_time.GetCurrentTime()
3635
response = client.batch_get_assets_history(
3736
parent, content_type, read_time_window, asset_names)
3837
print('assets: {}'.format(response.assets))

asset/cloud-client/quickstart_exportassets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020

2121
def export_assets(project_id, dump_file_path):
2222
# [START asset_quickstart_export_assets]
23-
from google.cloud import asset_v1beta1
24-
from google.cloud.asset_v1beta1.proto import asset_service_pb2
23+
from google.cloud import asset_v1
24+
from google.cloud.asset_v1.proto import asset_service_pb2
2525

2626
# TODO project_id = 'Your Google Cloud Project ID'
2727
# TODO dump_file_path = 'Your asset dump file path'
2828

29-
client = asset_v1beta1.AssetServiceClient()
29+
client = asset_v1.AssetServiceClient()
3030
parent = client.project_path(project_id)
3131
output_config = asset_service_pb2.OutputConfig()
3232
output_config.gcs_destination.uri = dump_file_path

asset/cloud-client/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
google-cloud-storage==1.13.2
2-
google-cloud-asset==0.1.2
2+
google-cloud-asset==0.2.0

0 commit comments

Comments
 (0)
0