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 78574a5

Browse filesBrowse files
cwxie-googlebusunkim96
authored andcommitted
Asset: Update Real Time Feed Sample Code to use v1 (GoogleCloudPlatform#2623)
1 parent dcb1632 commit 78574a5
Copy full SHA for 78574a5

File tree

Expand file treeCollapse file tree

6 files changed

+13
-13
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+13
-13
lines changed

‎asset/cloud-client/quickstart_createfeed.py

Copy file name to clipboardExpand all lines: asset/cloud-client/quickstart_createfeed.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020

2121
def create_feed(project_id, feed_id, asset_names, topic):
2222
# [START asset_quickstart_create_feed]
23-
from google.cloud import asset_v1p2beta1
24-
from google.cloud.asset_v1p2beta1.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 feed_id = 'Feed ID you want to create'
2828
# TODO asset_names = 'List of asset names the feed listen to'
2929
# TODO topic = "Topic name of the feed"
3030

31-
client = asset_v1p2beta1.AssetServiceClient()
31+
client = asset_v1.AssetServiceClient()
3232
parent = "projects/{}".format(project_id)
3333
feed = asset_service_pb2.Feed()
3434
feed.asset_names.extend(asset_names)

‎asset/cloud-client/quickstart_deletefeed.py

Copy file name to clipboardExpand all lines: asset/cloud-client/quickstart_deletefeed.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020

2121
def delete_feed(feed_name):
2222
# [START asset_quickstart_delete_feed]
23-
from google.cloud import asset_v1p2beta1
23+
from google.cloud import asset_v1
2424

2525
# TODO feed_name = 'Feed name you want to delete'
2626

27-
client = asset_v1p2beta1.AssetServiceClient()
27+
client = asset_v1.AssetServiceClient()
2828
client.delete_feed(feed_name)
2929
print('deleted_feed')
3030
# [END asset_quickstart_delete_feed]

‎asset/cloud-client/quickstart_getfeed.py

Copy file name to clipboardExpand all lines: asset/cloud-client/quickstart_getfeed.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020

2121
def get_feed(feed_name):
2222
# [START asset_quickstart_get_feed]
23-
from google.cloud import asset_v1p2beta1
23+
from google.cloud import asset_v1
2424

2525
# TODO feed_name = 'Feed Name you want to get'
2626

27-
client = asset_v1p2beta1.AssetServiceClient()
27+
client = asset_v1.AssetServiceClient()
2828
response = client.get_feed(feed_name)
2929
print('gotten_feed: {}'.format(response))
3030
# [START asset_quickstart_get_feed]

‎asset/cloud-client/quickstart_listfeeds.py

Copy file name to clipboardExpand all lines: asset/cloud-client/quickstart_listfeeds.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020

2121
def list_feeds(parent_resource):
2222
# [START asset_quickstart_list_feeds]
23-
from google.cloud import asset_v1p2beta1
23+
from google.cloud import asset_v1
2424

2525
# TODO parent_resource = 'Parent resource you want to list all feeds'
2626

27-
client = asset_v1p2beta1.AssetServiceClient()
27+
client = asset_v1.AssetServiceClient()
2828
response = client.list_feeds(parent_resource)
2929
print('feeds: {}'.format(response.feeds))
3030
# [END asset_quickstart_list_feeds]

‎asset/cloud-client/quickstart_updatefeed.py

Copy file name to clipboardExpand all lines: asset/cloud-client/quickstart_updatefeed.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
def update_feed(feed_name, topic):
2222
# [START asset_quickstart_update_feed]
23-
from google.cloud import asset_v1p2beta1
24-
from google.cloud.asset_v1p2beta1.proto import asset_service_pb2
23+
from google.cloud import asset_v1
24+
from google.cloud.asset_v1.proto import asset_service_pb2
2525
from google.protobuf import field_mask_pb2
2626

2727
# TODO feed_name = 'Feed Name you want to update'
2828
# TODO topic = "Topic name you want to update with"
2929

30-
client = asset_v1p2beta1.AssetServiceClient()
30+
client = asset_v1.AssetServiceClient()
3131
feed = asset_service_pb2.Feed()
3232
feed.name = feed_name
3333
feed.feed_output_config.pubsub_destination.topic = topic

‎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,4 +1,4 @@
11
google-cloud-storage==1.19.1
2-
google-cloud-asset==0.4.1
2+
google-cloud-asset==0.6.0
33
google-cloud-resource-manager==0.29.2
44
google-cloud-pubsub==1.0.2

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.