@@ -66,6 +66,49 @@ service AssetService {
6666 get : "/v1/{parent=*/*}:batchGetAssetsHistory"
6767 };
6868 }
69+
70+ // Creates a feed in a parent project/folder/organization to listen to its
71+ // asset updates.
72+ rpc CreateFeed (CreateFeedRequest ) returns (Feed ) {
73+ option (google.api.http ) = {
74+ post : "/v1/{parent=*/*}/feeds"
75+ body : "*"
76+ };
77+ option (google.api.method_signature ) = "parent" ;
78+ }
79+
80+ // Gets details about an asset feed.
81+ rpc GetFeed (GetFeedRequest ) returns (Feed ) {
82+ option (google.api.http ) = {
83+ get : "/v1/{name=*/*/feeds/*}"
84+ };
85+ option (google.api.method_signature ) = "name" ;
86+ }
87+
88+ // Lists all asset feeds in a parent project/folder/organization.
89+ rpc ListFeeds (ListFeedsRequest ) returns (ListFeedsResponse ) {
90+ option (google.api.http ) = {
91+ get : "/v1/{parent=*/*}/feeds"
92+ };
93+ option (google.api.method_signature ) = "parent" ;
94+ }
95+
96+ // Updates an asset feed configuration.
97+ rpc UpdateFeed (UpdateFeedRequest ) returns (Feed ) {
98+ option (google.api.http ) = {
99+ patch : "/v1/{feed.name=*/*/feeds/*}"
100+ body : "*"
101+ };
102+ option (google.api.method_signature ) = "feed" ;
103+ }
104+
105+ // Deletes an asset feed.
106+ rpc DeleteFeed (DeleteFeedRequest ) returns (google.protobuf.Empty ) {
107+ option (google.api.http ) = {
108+ delete : "/v1/{name=*/*/feeds/*}"
109+ };
110+ option (google.api.method_signature ) = "name" ;
111+ }
69112}
70113
71114// Export asset request.
@@ -158,6 +201,82 @@ message BatchGetAssetsHistoryResponse {
158201 repeated TemporalAsset assets = 1 ;
159202}
160203
204+ // Create asset feed request.
205+ message CreateFeedRequest {
206+ // Required. The name of the project/folder/organization where this feed
207+ // should be created in. It can only be an organization number (such as
208+ // "organizations/123"), a folder number (such as "folders/123"), a project ID
209+ // (such as "projects/my-project-id")", or a project number (such as
210+ // "projects/12345").
211+ string parent = 1 [(google.api.field_behavior ) = REQUIRED ];
212+
213+ // Required. This is the client-assigned asset feed identifier and it needs to
214+ // be unique under a specific parent project/folder/organization.
215+ string feed_id = 2 [(google.api.field_behavior ) = REQUIRED ];
216+
217+ // Required. The feed details. The field `name` must be empty and it will be generated
218+ // in the format of:
219+ // projects/project_number/feeds/feed_id
220+ // folders/folder_number/feeds/feed_id
221+ // organizations/organization_number/feeds/feed_id
222+ Feed feed = 3 [(google.api.field_behavior ) = REQUIRED ];
223+ }
224+
225+ // Get asset feed request.
226+ message GetFeedRequest {
227+ // Required. The name of the Feed and it must be in the format of:
228+ // projects/project_number/feeds/feed_id
229+ // folders/folder_number/feeds/feed_id
230+ // organizations/organization_number/feeds/feed_id
231+ string name = 1 [
232+ (google.api.field_behavior ) = REQUIRED ,
233+ (google.api.resource_reference ) = {
234+ type : "cloudasset.googleapis.com/Feed"
235+ }
236+ ];
237+ }
238+
239+ // List asset feeds request.
240+ message ListFeedsRequest {
241+ // Required. The parent project/folder/organization whose feeds are to be
242+ // listed. It can only be using project/folder/organization number (such as
243+ // "folders/12345")", or a project ID (such as "projects/my-project-id").
244+ string parent = 1 [(google.api.field_behavior ) = REQUIRED ];
245+ }
246+
247+ message ListFeedsResponse {
248+ // A list of feeds.
249+ repeated Feed feeds = 1 ;
250+ }
251+
252+ // Update asset feed request.
253+ message UpdateFeedRequest {
254+ // Required. The new values of feed details. It must match an existing feed and the
255+ // field `name` must be in the format of:
256+ // projects/project_number/feeds/feed_id or
257+ // folders/folder_number/feeds/feed_id or
258+ // organizations/organization_number/feeds/feed_id.
259+ Feed feed = 1 [(google.api.field_behavior ) = REQUIRED ];
260+
261+ // Required. Only updates the `feed` fields indicated by this mask.
262+ // The field mask must not be empty, and it must not contain fields that
263+ // are immutable or only set by the server.
264+ google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior ) = REQUIRED ];
265+ }
266+
267+ message DeleteFeedRequest {
268+ // Required. The name of the feed and it must be in the format of:
269+ // projects/project_number/feeds/feed_id
270+ // folders/folder_number/feeds/feed_id
271+ // organizations/organization_number/feeds/feed_id
272+ string name = 1 [
273+ (google.api.field_behavior ) = REQUIRED ,
274+ (google.api.resource_reference ) = {
275+ type : "cloudasset.googleapis.com/Feed"
276+ }
277+ ];
278+ }
279+
161280// Output configuration for export assets destination.
162281message OutputConfig {
163282 // Asset export destination.
@@ -217,6 +336,13 @@ message BigQueryDestination {
217336 bool force = 3 ;
218337}
219338
339+ // A Cloud Pubsub destination.
340+ message PubsubDestination {
341+ // The name of the Cloud Pub/Sub topic to publish to.
342+ // For example: `projects/PROJECT_ID/topics/TOPIC_ID`.
343+ string topic = 1 ;
344+ }
345+
220346// Asset content type.
221347enum ContentType {
222348 // Unspecified content type.
@@ -234,3 +360,63 @@ enum ContentType {
234360 // The Cloud Access context mananger Policy set on an asset.
235361 ACCESS_POLICY = 5 ;
236362}
363+
364+ // Output configuration for asset feed destination.
365+ message FeedOutputConfig {
366+ // Asset feed destination.
367+ oneof destination {
368+ // Destination on Cloud Pubsub.
369+ PubsubDestination pubsub_destination = 1 ;
370+ }
371+ }
372+
373+ // An asset feed used to export asset updates to a destinations.
374+ // An asset feed filter controls what updates are exported.
375+ // The asset feed must be created within a project, organization, or
376+ // folder. Supported destinations are:
377+ // Cloud Pub/Sub topics.
378+ message Feed {
379+ option (google.api.resource ) = {
380+ type : "cloudasset.googleapis.com/Feed"
381+ pattern : "projects/{project}/feeds/{feed}"
382+ pattern : "folders/{folder}/feeds/{feed}"
383+ pattern : "organizations/{organization}/feeds/{feed}"
384+ history : ORIGINALLY_SINGLE_PATTERN
385+ };
386+
387+ // Required. The format will be
388+ // projects/{project_number}/feeds/{client-assigned_feed_identifier} or
389+ // folders/{folder_number}/feeds/{client-assigned_feed_identifier} or
390+ // organizations/{organization_number}/feeds/{client-assigned_feed_identifier}
391+ //
392+ // The client-assigned feed identifier must be unique within the parent
393+ // project/folder/organization.
394+ string name = 1 [(google.api.field_behavior ) = REQUIRED ];
395+
396+ // A list of the full names of the assets to receive updates. You must specify
397+ // either or both of asset_names and asset_types. Only asset updates matching
398+ // specified asset_names and asset_types are exported to the feed. For
399+ // example:
400+ // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
401+ // See [Resource
402+ // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
403+ // for more info.
404+ repeated string asset_names = 2 ;
405+
406+ // A list of types of the assets to receive updates. You must specify either
407+ // or both of asset_names and asset_types. Only asset updates matching
408+ // specified asset_names and asset_types are exported to the feed.
409+ // For example:
410+ // "compute.googleapis.com/Disk" See [Introduction to Cloud Asset
411+ // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview)
412+ // for all supported asset types.
413+ repeated string asset_types = 3 ;
414+
415+ // Asset content type. If not specified, no content but the asset name and
416+ // type will be returned.
417+ ContentType content_type = 4 ;
418+
419+ // Required. Feed output configuration defining where the asset updates are
420+ // published to.
421+ FeedOutputConfig feed_output_config = 5 [(google.api.field_behavior ) = REQUIRED ];
422+ }
0 commit comments