18
18
import argparse
19
19
20
20
21
- def create_feed (project_id , feed_id , asset_names , topic ):
21
+ def create_feed (project_id , feed_id , asset_names , topic , content_type ):
22
22
# [START asset_quickstart_create_feed]
23
23
from google .cloud import asset_v1
24
24
25
25
# TODO project_id = 'Your Google Cloud Project ID'
26
26
# TODO feed_id = 'Feed ID you want to create'
27
27
# TODO asset_names = 'List of asset names the feed listen to'
28
28
# TODO topic = "Topic name of the feed"
29
+ # TODO content_type ="Content type of the feed"
29
30
30
31
client = asset_v1 .AssetServiceClient ()
31
32
parent = "projects/{}" .format (project_id )
32
33
feed = asset_v1 .Feed ()
33
34
feed .asset_names .extend (asset_names )
34
35
feed .feed_output_config .pubsub_destination .topic = topic
36
+ feed .content_type = content_type
35
37
response = client .create_feed (
36
38
request = {"parent" : parent , "feed_id" : feed_id , "feed" : feed }
37
39
)
@@ -48,5 +50,6 @@ def create_feed(project_id, feed_id, asset_names, topic):
48
50
parser .add_argument ("feed_id" , help = "Feed ID you want to create" )
49
51
parser .add_argument ("asset_names" , help = "List of asset names the feed listen to" )
50
52
parser .add_argument ("topic" , help = "Topic name of the feed" )
53
+ parser .add_argument ("content_type" , help = "Content type of the feed" )
51
54
args = parser .parse_args ()
52
- create_feed (args .project_id , args .feed_id , args .asset_names , args .topic )
55
+ create_feed (args .project_id , args .feed_id , args .asset_names , args .topic , args . content_type )
0 commit comments