Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eef7f5b

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

File tree

Expand file treeCollapse file tree

3 files changed

+8
-9
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+8
-9
lines changed

‎asset/cloud-client/quickstart_batchgetassetshistory.py

Copy file name to clipboardExpand all lines: asset/cloud-client/quickstart_batchgetassetshistory.py
+4-5Lines 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 = 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

Copy file name to clipboardExpand all lines: asset/cloud-client/quickstart_exportassets.py
+3-3Lines 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

Copy file name to clipboard
+1-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.