diff --git a/protos/sift/annotation_logs/v1/annotation_logs.proto b/protos/sift/annotation_logs/v1/annotation_logs.proto index 7df1308a..01c1d759 100644 --- a/protos/sift/annotation_logs/v1/annotation_logs.proto +++ b/protos/sift/annotation_logs/v1/annotation_logs.proto @@ -91,7 +91,7 @@ message ListAnnotationLogsRequest { // Available fields to filter by are `annotation_log_id`, `annotation_id`, `created_by_user_id`, // `created_date`, `modified_date`, and `kind`. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). - // For more information about the fields used for filtering, please refer to [this definition](/api/grpc/protocol_buffers/annotation_logs#annotationlogsearchresult). Optional. + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/annotation_logs#annotationlogsearchresult). Optional. string filter = 4 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/protos/sift/annotations/v1/annotations.proto b/protos/sift/annotations/v1/annotations.proto index f70641af..ca657c7f 100644 --- a/protos/sift/annotations/v1/annotations.proto +++ b/protos/sift/annotations/v1/annotations.proto @@ -219,15 +219,15 @@ message ListAnnotationsRequest { // A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. // Available fields to filter by are `annotation_id`, `start_time`, `end_time`, // `created_date`, `modified_date`, `run_id`, `name`, `description`, `state`, `created_by_user_id`, `created_by_rule_condition_version_id`, - // `annotation_type`, `tag_name`, and `assignee`. + // `annotation_type`, `tag_name`, `report_id`, `asset_id`, `asset_name`, and `assignee`. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). - // For more information about the fields used for filtering, please refer to [this definition](/api/grpc/protocol_buffers/annotations#annotation). Optional. + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/annotations#annotation). Optional. string filter = 3 [(google.api.field_behavior) = OPTIONAL]; // This field is only required if your user belongs to multiple organizations. string organization_id = 4 [(google.api.field_behavior) = OPTIONAL]; - // How to order the retrieved annotations. Formatted as a comma-separated string i.e. "[ desc],...". + // How to order the retrieved annotations. Formatted as a comma-separated string i.e. "FIELD_NAME[ desc],...". // Available fields to order_by are `created_date`, `modified_date`, `start_time`, and `end_time`. // If left empty, items are ordered by `created_date` in ascending order (oldest-first). // For more information about the format of this field, read [this](https://google.aip.dev/132#ordering) diff --git a/protos/sift/assets/v1/assets.proto b/protos/sift/assets/v1/assets.proto index bdb82804..3249ebab 100644 --- a/protos/sift/assets/v1/assets.proto +++ b/protos/sift/assets/v1/assets.proto @@ -92,10 +92,10 @@ message ListAssetsRequest { // Available fields to filter by are `asset_id`, `created_by_user_id`, `modified_by_user_id`, // `created_date`, `modified_date`, and `name`. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). - // For more information about the fields used for filtering, please refer to [this definition](/api/grpc/protocol_buffers/assets#asset). Optional. + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/assets#asset). Optional. string filter = 3 [(google.api.field_behavior) = OPTIONAL]; - // How to order the retrieved assets. Formatted as a comma-separated string i.e. "[ desc],...". + // How to order the retrieved assets. Formatted as a comma-separated string i.e. "FIELD_NAME[ desc],...". // Available fields to order_by are `created_date` and `modified_date`. // If left empty, items are ordered by `created_date` in ascending order (oldest-first). // For more information about the format of this field, read [this](https://google.aip.dev/132#ordering) diff --git a/protos/sift/calculated_channels/v2/calculated_channels.proto b/protos/sift/calculated_channels/v2/calculated_channels.proto new file mode 100644 index 00000000..1cf71cec --- /dev/null +++ b/protos/sift/calculated_channels/v2/calculated_channels.proto @@ -0,0 +1,240 @@ +syntax = "proto3"; + +package sift.calculated_channels.v2; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "sift/calculated_channels/v1/calculated_channels.proto"; + + + +service CalculatedChannelService { + // Retrieve the latest version of a calculated channel + rpc GetCalculatedChannel(GetCalculatedChannelRequest) returns (GetCalculatedChannelResponse) { + option (google.api.http) = { + get: "/api/v2/calculated-channels/{calculated_channel_id}" + additional_bindings {get: "/v2/organizations/{organization_id}/calculated-channels/{client_key}"} + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "GetCalculatedChannel", + description: "Retrieve the latest version of a calculated channel." + }; + } + + // Create a calculated channel. + rpc CreateCalculatedChannel(CreateCalculatedChannelRequest) returns (CreateCalculatedChannelResponse) { + option (google.api.http) = { + post: "/api/v2/calculated-channels" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "CreateCalculatedChannel", + description: "Create a calculated channel." + }; + } + + // Retrieve the latest versions of calculated channels based on an optional filter. + rpc ListCalculatedChannels(ListCalculatedChannelsRequest) returns (ListCalculatedChannelsResponse) { + option (google.api.http) = {get: "/api/v2/calculated-channels"}; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "ListCalculatedChannels", + description: "Retrieve the latest versions of calculated channels based on an optional filter." + }; + } + + // Update and create a new version of a calculated channel. + rpc UpdateCalculatedChannel(UpdateCalculatedChannelRequest) returns (UpdateCalculatedChannelResponse) { + option (google.api.http) = { + patch: "/api/v2/calculated-channels" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "UpdateCalculatedChannel", + description: "Update and create a new version of a calculated channel." + }; + } + + // List versions of a particular calculated channel with an optional filter. + rpc ListCalculatedChannelVersions(ListCalculatedChannelVersionsRequest) returns (ListCalculatedChannelVersionsResponse) { + option (google.api.http) = { + get: "/api/v2/calculated-channels/{calculated_channel_id}/versions" + additional_bindings {get: "/v2/organizations/{organization_id}/calculated-channels/{client_key}/versions"} + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "ListCalculatedChannelVersions", + description: "List versions of a particular calculated channel with an optional filter." + }; + } +} + +message CalculatedChannel { + string calculated_channel_id = 1 [(google.api.field_behavior) = REQUIRED]; + string organization_id = 2 [(google.api.field_behavior) = REQUIRED]; + optional string client_key = 3 [(google.api.field_behavior) = OPTIONAL]; + optional google.protobuf.Timestamp archived_date = 4 [(google.api.field_behavior) = OPTIONAL]; + + string version_id = 5 [(google.api.field_behavior) = REQUIRED]; + uint32 version = 6 [(google.api.field_behavior) = REQUIRED]; + string name = 7 [(google.api.field_behavior) = REQUIRED]; + string description = 8 [(google.api.field_behavior) = REQUIRED]; + string change_message = 9 [(google.api.field_behavior) = REQUIRED]; + string user_notes = 10 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Timestamp created_date = 11 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Timestamp modified_date = 12 [(google.api.field_behavior) = REQUIRED]; + CalculatedChannelAssetConfiguration asset_configuration = 13 [(google.api.field_behavior) = REQUIRED]; + CalculatedChannelQueryConfiguration query_configuration = 14 [(google.api.field_behavior) = REQUIRED]; +} + +message CalculatedChannelAssetConfiguration { + message AssetSelection { + repeated string asset_ids = 1; + repeated string tag_ids = 2; + } + oneof asset_scope { + bool all_assets = 1; + AssetSelection selection = 2; + } +} + +message CalculatedChannelQueryConfiguration { + // Sift Expression Language + message Sel { + string expression = 1; + repeated sift.calculated_channels.v1.ExpressionChannelReference expression_channel_references = 2; + } + + oneof query { + Sel sel = 1; + } +} + +// The request for a call to `CalculatedChannelService_GetCalculatedChannel` to retrieve the latest version of a calculated channel. +// If `calculated_channel_id` is provided then all other arguments will be ignored. The argument `calculated_channel_id` +// should not be used together with `client_key`. The `organization_id` argument is only required +// if using `client_key` and the user belongs to multiple organizations. +message GetCalculatedChannelRequest { + string calculated_channel_id = 1 [(google.api.field_behavior) = OPTIONAL]; + string client_key = 2 [(google.api.field_behavior) = OPTIONAL]; + string organization_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +message GetCalculatedChannelResponse { + CalculatedChannel calculated_channel = 1 [(google.api.field_behavior) = REQUIRED]; +} + +message CreateCalculatedChannelRequest { + string name = 1 [(google.api.field_behavior) = REQUIRED]; + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + string user_notes = 3 [(google.api.field_behavior) = OPTIONAL]; + optional string client_key = 4 [(google.api.field_behavior) = OPTIONAL]; + CalculatedChannelAssetConfiguration asset_configuration = 5 [(google.api.field_behavior) = REQUIRED]; + CalculatedChannelQueryConfiguration query_configuration = 6 [(google.api.field_behavior) = REQUIRED]; +} + +message CreateCalculatedChannelResponse { + CalculatedChannel calculated_channel = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for a call to `CalculatedChannelService_ListCalculatedChannels` to retrieve lateset vesrions of calculated channels. +message ListCalculatedChannelsRequest { + // The maximum number of calculated channels to return. The service may return fewer than this value. + // If unspecified, at most 50 calculated channels will be returned. The maximum value is 1000; values above + // 1000 will be coerced to 1000. Optional. + uint32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // A page token, received from a previous `ListCalculatedChannels` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListCalculatedChannels` must match + // the call that provided the page token. Optional. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. + // Available fields to filter by are `calculated_channel_id`, `client_key`, `name`, and `description`. + // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/calculated_channels#calculated_channel). Optional. + string filter = 3 [(google.api.field_behavior) = OPTIONAL]; + + // This field is only required if your user belongs to multiple organizations. + string organization_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // If `true` then archived calculated channels will be included in the query. Defaults to `false`. + bool include_archived = 5 [(google.api.field_behavior) = OPTIONAL]; + + // How to order the retrieved calculated channels. Formatted as a comma-separated string i.e. "FIELD_NAME[ desc],...". + // Available fields to order_by are `created_date` and `modified_date`. + // If left empty, items are ordered by `created_date` in ascending order (oldest-first). + // For more information about the format of this field, read [this](https://google.aip.dev/132#ordering) + // Example: "created_date desc,modified_date" + string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response of a call to `CalculatedChannelService_ListCalculatedChannelsResponse`. +message ListCalculatedChannelsResponse { + repeated CalculatedChannel calculated_channels = 1; + string next_page_token = 2; +} + +// The request for a call to `CalculatedChannelService_UpdateCalculatedChannel` to update a calculated channel. Updating a calculated +// channel creates a new version of the calculated channel, leaving the previous untouched. If no update is deemed necessary, then the +// the current version is returned. To archive calculated channel, specify `archived_date` in the `update mask` as well as a non-null +// value for `archived_date` in the `calculated_channel` object. To unarchive a calculated channel, specify `archived_date` in the +// `update mask` and a `null` value for `archived_date` in the `calculated_channel` object. +message UpdateCalculatedChannelRequest { + // The calculated channel to update. + CalculatedChannel calculated_channel = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. The fields available to be updated are `name`, `description`, + // `query_configuration`, `archived_date`, and `asset_configuration`. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional user notes to describe changes. + optional string user_notes = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response of a call to `CalculatedChannelService_UpdateCalculatedChannel`. +message UpdateCalculatedChannelResponse { + CalculatedChannel calculated_channel = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for a call to `CalculatedChannelService_ListCalculatedChannelVersions` to retrieve versions +// of a particular calculated channel. If `calculated_channel_id` is provided then `client_key` is ignored. +message ListCalculatedChannelVersionsRequest { + string calculated_channel_id = 1 [(google.api.field_behavior) = OPTIONAL]; + string client_key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // The maximum number of calculated channel versions to return. The service may return fewer than this value. + // If unspecified, at most 50 calculated channels will be returned. The maximum value is 1000; values above + // 1000 will be coerced to 1000. Optional. + uint32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // A page token, received from a previous `ListCalculatedChannelVersions` call. + // Provide this to retrieve the subsequent page. + // When paginating, all other parameters provided to `ListCalculatedChannelVersions` must match + // the call that provided the page token. Optional. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. + // Available fields to filter by are `calculated_channel_id`, `name`, and `description`. + // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/calculated_channels#calculated_channel). Optional. + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; + + // This field is only required if your user belongs to multiple organizations. + string organization_id = 6 [(google.api.field_behavior) = OPTIONAL]; + + // How to order the retrieved calculated channel versions. Formatted as a comma-separated string i.e. "FIELD_NAME[ desc],...". + // Available fields to order_by are `created_date` and `modified_date`. + // If left empty, items are ordered by `created_date` in ascending order (oldest-first). + // For more information about the format of this field, read [this](https://google.aip.dev/132#ordering) + // Example: "created_date desc,modified_date" + string order_by = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response of a call to `CalculatedChannelService_ListCalculatedChannelVersionsResponse`. +message ListCalculatedChannelVersionsResponse { + repeated CalculatedChannel calculated_channel_versions = 1; + string next_page_token = 2; +} diff --git a/protos/sift/channels/v2/channels.proto b/protos/sift/channels/v2/channels.proto index 4bb20886..3f28e908 100644 --- a/protos/sift/channels/v2/channels.proto +++ b/protos/sift/channels/v2/channels.proto @@ -84,15 +84,16 @@ message ListChannelsRequest { string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; // A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. - // Available fields to filter by are `channel_id`, `asset_id`, `name`, `component`, `description`, `active`, `created_date`, and `modified_date`. + // Available fields to filter by are `channel_id`, `asset_id`, `name`, `component`, `description`, `active`, + // `run_id`, `run_name`, `run_client_key`, `created_date`, and `modified_date`. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). - // For more information about the fields used for filtering, please refer to [this definition](/api/grpc/protocol_buffers/channels#channel). Optional. + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/channels#channel). Optional. string filter = 3 [(google.api.field_behavior) = OPTIONAL]; // This field is only required if your user belongs to multiple organizations. string organization_id = 4 [(google.api.field_behavior) = OPTIONAL]; - // How to order the retrieved channels. Formatted as a comma-separated string i.e. "[ desc],...". + // How to order the retrieved channels. Formatted as a comma-separated string i.e. "FIELD_NAME[ desc],...". // Available fields to order_by are `created_date` and `modified_date`. // If left empty, items are ordered by `created_date` in ascending order (oldest-first). // For more information about the format of this field, read [this](https://google.aip.dev/132#ordering) diff --git a/protos/sift/common/type/v1/resource_ref.proto b/protos/sift/common/type/v1/resource_ref.proto new file mode 100644 index 00000000..0519ef77 --- /dev/null +++ b/protos/sift/common/type/v1/resource_ref.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; + +package sift.common.type.v1; + +import "google/api/field_behavior.proto"; + + + +// ResourceRef is meant to be embedded as a field in other resources. It's used by one resource to point to another resource. +// In a request, use the `find_by` field to select a resource to point to. +// In a response, the fields marked `google.api.field_behavior = OUTPUT_ONLY` will be populated by the backend. +message ResourceRef { + // The global unique id of the resource, e.g. the asset_id, run_id, or report_id. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // If a resource has a client_key associated with it, it will be included. + optional string client_key = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The name of the resource. + string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Use this field to 'construct' a ResourceRef. + // You can give just the name, id, or client_key and the backend will find the resource you're referring to. + FindResourceBy find_by = 4 [(google.api.field_behavior) = INPUT_ONLY]; +} + +message FindResourceBy { + oneof identifier { + // Find by the resource's global id, e.g. asset_id, run_id, report_id. + string id = 1; + + // Find by the resource's client_key, if available. + string client_key = 2; + + // Find by the resource's name. If multiple resources are found with the same name, an error will be returned. + string name = 3; + } + + // When finding by `client_key` or `name`, the `organization_id` should also be specified. + // Only required if the user belongs to more than one organization. + string organization_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/protos/sift/ingestion_configs/v1/ingestion_configs.proto b/protos/sift/ingestion_configs/v1/ingestion_configs.proto index 8d16adf4..77033b06 100644 --- a/protos/sift/ingestion_configs/v1/ingestion_configs.proto +++ b/protos/sift/ingestion_configs/v1/ingestion_configs.proto @@ -55,7 +55,10 @@ service IngestionConfigService { // Create ingestion config [flows](/glossary#flow). rpc CreateIngestionConfigFlows(CreateIngestionConfigFlowsRequest) returns (CreateIngestionConfigFlowsResponse) { - option (google.api.http) = {post: "/api/v1/ingestion-configs/{ingestion_config_id}/flows"}; + option (google.api.http) = { + post: "/api/v1/ingestion-configs/{ingestion_config_id}/flows", + body: "*" + }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { summary: "CreateIngestionConfigFlows" description: "Create ingestion config [flows](/glossary#flow)." @@ -136,7 +139,7 @@ message ListIngestionConfigsRequest { // A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. // Available fields to filter by are `ingestion_config_id`, `client_key`, `asset_id`, `created_date`, and `modified_date`. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). - // For more information about the fields used for filtering, please refer to [this definition](/api/grpc/protocol_buffers/ingestion_configs#ingestionconfigservice). Optional. + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/ingestion_configs#ingestionconfigservice). Optional. string filter = 3 [(google.api.field_behavior) = OPTIONAL]; } @@ -175,7 +178,7 @@ message ListIngestionConfigFlowsRequest { // A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. // Available fields to filter by are `flow_name`, `flow_id`, `created_date`, and `modified_date`. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). - // For more information about the fields used for filtering, please refer to [this definition](/api/grpc/protocol_buffers/ingestion_configs#ingestionconfig). Optional. + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/ingestion_configs#ingestionconfig). Optional. string filter = 4 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/protos/sift/notifications/v1/notifications.proto b/protos/sift/notifications/v1/notifications.proto index 473e5da9..71984d99 100644 --- a/protos/sift/notifications/v1/notifications.proto +++ b/protos/sift/notifications/v1/notifications.proto @@ -81,7 +81,7 @@ message ListNotificationsRequest { // Available fields to filter by are `notification_id`, `created_by_user_id`, `recipient_user_id`, // `created_date`, `notification_type`, and `is_read`. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). - // For more information about the fields used for filtering, please refer to [this definition](/api/grpc/protocol_buffers/notifications#notification). Optional. + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/notifications#notification). Optional. string filter = 3 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/protos/sift/remote_files/v1/remote_files.proto b/protos/sift/remote_files/v1/remote_files.proto index d42c79e7..935ee717 100644 --- a/protos/sift/remote_files/v1/remote_files.proto +++ b/protos/sift/remote_files/v1/remote_files.proto @@ -154,7 +154,7 @@ message ListRemoteFilesRequest { // A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. // Available fields to filter by are `remote_file_id`, `entity_id`, `entity_type`, and `file_name`. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). - // For more information about the fields used for filtering, please refer to [this definition](/api/grpc/protocol_buffers/remote_files#remotefile). Optional. + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/remote_files#remotefile). Optional. string filter = 3 [(google.api.field_behavior) = OPTIONAL]; // This field is only required if your user belongs to multiple organizations. diff --git a/protos/sift/report_templates/v1/report_templates.proto b/protos/sift/report_templates/v1/report_templates.proto index d50d2a92..983ddd94 100644 --- a/protos/sift/report_templates/v1/report_templates.proto +++ b/protos/sift/report_templates/v1/report_templates.proto @@ -144,7 +144,7 @@ message ListReportTemplatesRequest { // A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. // Available fields to filter by are `report_template_id`, `tag_id`, `tag_name`, `client_key`, and `name`. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). - // For more information about the fields used for filtering, please refer to [this definition](/api/grpc/protocol_buffers/report_templates#report_template). Optional. + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/report_templates#report_template). Optional. string filter = 3 [(google.api.field_behavior) = OPTIONAL]; // This field is only required if your user belongs to multiple organizations. @@ -153,7 +153,7 @@ message ListReportTemplatesRequest { // If `true` then archived report templates will be included in the query. Defaults to `false`. bool include_archived = 5 [(google.api.field_behavior) = OPTIONAL]; - // How to order the retrieved report templates. Formatted as a comma-separated string i.e. "[ desc],...". + // How to order the retrieved report templates. Formatted as a comma-separated string i.e. "FIELD_NAME[ desc],...". // Available fields to order_by are `created_date` and `modified_date`. // If left empty, items are ordered by `created_date` in ascending order (oldest-first). // For more information about the format of this field, read [this](https://google.aip.dev/132#ordering) diff --git a/protos/sift/reports/v1/reports.proto b/protos/sift/reports/v1/reports.proto index 6ef83697..fa27694c 100644 --- a/protos/sift/reports/v1/reports.proto +++ b/protos/sift/reports/v1/reports.proto @@ -195,13 +195,13 @@ message ListReportsRequest { // A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. // Available fields to filter by are `report_id`, `report_template_id`, `tag_name`, `name`, and `run_id`. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). - // For more information about the fields used for filtering, please refer to [this definition](/api/grpc/protocol_buffers/reports#report). Optional. + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/reports#report). Optional. string filter = 3 [(google.api.field_behavior) = OPTIONAL]; // This field is only required if your user belongs to multiple organizations. string organization_id = 4 [(google.api.field_behavior) = OPTIONAL]; - // How to order the retrieved reports. Formatted as a comma-separated string i.e. "[ desc],...". + // How to order the retrieved reports. Formatted as a comma-separated string i.e. "FIELD_NAME[ desc],...". // Available fields to order_by are `created_date` and `modified_date`. // If left empty, items are ordered by `created_date` in ascending order (oldest-first). // For more information about the format of this field, read [this](https://google.aip.dev/132#ordering) diff --git a/protos/sift/rules/v1/rules.proto b/protos/sift/rules/v1/rules.proto index c4418065..4e6aec12 100644 --- a/protos/sift/rules/v1/rules.proto +++ b/protos/sift/rules/v1/rules.proto @@ -14,6 +14,7 @@ import "google/api/field_behavior.proto"; import "google/protobuf/timestamp.proto"; import "protoc-gen-openapiv2/options/annotations.proto"; import "sift/annotations/v1/annotations.proto"; +import "sift/common/type/v1/resource_identifier.proto"; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { @@ -110,6 +111,42 @@ service RuleService { }; } + // Deletes multiple rules + rpc BatchDeleteRules(BatchDeleteRulesRequest) returns (BatchDeleteRulesResponse) { + option (google.api.http) = { + post: "/api/v1/rules/batchDelete" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "BatchDeleteRules" + description: "Deletes multiple rules." + }; + } + + // Undeletes a rule + rpc UndeleteRule(UndeleteRuleRequest) returns (UndeleteRuleResponse) { + option (google.api.http) = { + post: "/api/v1/rules/undelete" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "UndeleteRule" + description: "Undeletes a rule." + }; + } + + // Undeletes multiple rules + rpc BatchUndeleteRules(BatchUndeleteRulesRequest) returns (BatchUndeleteRulesResponse) { + option (google.api.http) = { + post: "/api/v1/rules/batchUndelete" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "BatchUndeleteRules" + description: "Undeletes multiple rules." + }; + } + // Deprecated - use RuleEvaluationService instead. rpc EvaluateRules(EvaluateRulesRequest) returns (EvaluateRulesResponse) { option deprecated = true; @@ -133,8 +170,9 @@ service RuleService { }; } - // Retrieve a JSON object containing all of the rules for a given asset. + // Deprecated - use BatchGetRules instead. Retrieve a JSON object containing all of the rules for a given asset. rpc ViewJsonRules(ViewJsonRulesRequest) returns (ViewJsonRulesResponse) { + option deprecated = true; option (google.api.http) = {get: "/api/v1/rules:viewJson"}; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { summary: "ViewJsonRules" @@ -142,7 +180,7 @@ service RuleService { }; } - // Deprecated - use UpdateJsonRules instead. Batch update rules given the `rules_json` which is a JSON list of rules. + // Deprecated - use BatchUpdateRules instead. Batch update rules given the `rules_json` which is a JSON list of rules. rpc UpdateHumanFriendlyRules(UpdateHumanFriendlyRulesRequest) returns (UpdateHumanFriendlyRulesResponse) { option deprecated = true; option (google.api.http) = { @@ -155,8 +193,9 @@ service RuleService { }; } - // Validate a batch update for rules given the `rules_json` which is a JSON list of rules. This is a dry-run operation. + // Deprecated - use BatchUpdateRules with validate_only flag instead. Validate a batch update for rules given the `rules_json` which is a JSON list of rules. This is a dry-run operation. rpc ValidateJsonRules(ValidateJsonRulesRequest) returns (ValidateJsonRulesResponse) { + option deprecated = true; option (google.api.http) = { post: "/api/v1/rules:validateJson" body: "*" @@ -167,8 +206,9 @@ service RuleService { }; } - // Batch update rules given the `rules_json` which is a JSON list of rules. + // Deprecated - use BatchUpdateRules instead. Batch update rules given the `rules_json` which is a JSON list of rules. rpc UpdateJsonRules(UpdateJsonRulesRequest) returns (UpdateJsonRulesResponse) { + option deprecated = true; option (google.api.http) = { post: "/api/v1/rules:updateJson" body: "*" @@ -234,6 +274,7 @@ message Rule { RuleAssetConfiguration asset_configuration = 15 [(google.api.field_behavior) = REQUIRED]; ContextualChannels contextual_channels = 16 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Timestamp deleted_date = 17 [(google.api.field_behavior) = OPTIONAL]; } message RuleCondition { // 4 is reserved from old "status" column that lived directly on rule condition @@ -269,6 +310,14 @@ message ContextualChannels { repeated ChannelReference channels = 1 [(google.api.field_behavior) = REQUIRED]; } +message AssetExpressionValidationResult { + string asset_id = 1 [(google.api.field_behavior) = REQUIRED]; + string asset_name = 2 [(google.api.field_behavior) = REQUIRED]; + // asset_tag_id is the tag_id that caused this asset to be included in the rule + string asset_tag_id = 3 [(google.api.field_behavior) = OPTIONAL]; + optional string error = 4 [(google.api.field_behavior) = OPTIONAL]; +} + message SearchRulesRequest { // Max number of rules to return (returns all if omitted). optional uint32 limit = 1; @@ -282,8 +331,11 @@ message SearchRulesRequest { optional string order_by = 7; // If provided, only returns rules with the given ids repeated string rule_ids = 8; - // If provided, only returns rules with the given asset ids + // If provided, only returns rules that apply to the given asset ids repeated string asset_ids = 9; + bool include_deleted = 10; + // If provided, returns rules with assets that have the given tags + sift.common.type.v1.NamedResources asset_tags = 11; } enum SearchOrder { SEARCH_ORDER_UNSPECIFIED = 0 [deprecated = true]; @@ -336,6 +388,7 @@ message UpdateRuleRequest { repeated UpdateConditionRequest conditions = 6 [(google.api.field_behavior) = REQUIRED]; string organization_id = 7; string version_notes = 8; + // client_key is a client provided identifier for the rule. It is immutable after being set optional string client_key = 9; RuleAssetConfiguration asset_configuration = 10; ContextualChannels contextual_channels = 11; @@ -360,14 +413,45 @@ enum ActionKind { message UpdateRuleResponse { string rule_id = 1 [(google.api.field_behavior) = REQUIRED]; } + +message ValidationResult { + string rule_id = 1 [(google.api.field_behavior) = OPTIONAL]; + string client_key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // If the expression is invalid for an asset, one or more AssetExpressionValidationResult will be returned. This may block + // saving if the override_expression_validation flag is not set. + repeated AssetExpressionValidationResult asset_expression_validation_results = 3 [(google.api.field_behavior) = REQUIRED]; + + // If the rule is invalid and unable to be saved, this will contain the error message. Expression errors will be returned in + // the asset_expression_validation_results. + optional string error = 4 [(google.api.field_behavior) = OPTIONAL]; +} + message BatchUpdateRulesRequest { // rules are limited 1000 rules at a time repeated UpdateRuleRequest rules = 1 [(google.api.field_behavior) = REQUIRED]; + + // If validate_only is true, the request will only validate the request and not save the rules. + bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; + + // If override_expression_validation is true, the request will save the rules even if the expressions are invalid. This + // can be useful for multi-asset rules where an invalid expression for one asset should not prevent the rule from being saved. + bool override_expression_validation = 3 [(google.api.field_behavior) = REQUIRED]; } message BatchUpdateRulesResponse { bool success = 1 [(google.api.field_behavior) = REQUIRED]; + + // The total number of rules created in the request. If validate_only is true, this will indicate how many rules would have been created. int32 rules_created_count = 2 [(google.api.field_behavior) = REQUIRED]; + + // The total number of rules updated in the request. If validate_only is true, this will indicate how many rules would have been updated. int32 rules_updated_count = 3 [(google.api.field_behavior) = REQUIRED]; + + // This will be true if the request only validated the request and did not save the rules. + bool validate_only = 4 [(google.api.field_behavior) = REQUIRED]; + + // One ValidationResult per rule in the request will be returned + repeated ValidationResult validation_results = 5 [(google.api.field_behavior) = REQUIRED]; } // DeleteRuleRequest is used to delete a rule by rule_id or client_key. If both are provided, only rule_id will be used. @@ -377,6 +461,27 @@ message DeleteRuleRequest { } message DeleteRuleResponse {} +// BatchDeleteRulesRequest is used to delete a rule by rule_id or client_key. For each rule if both are provided, only rule_id will be used. +message BatchDeleteRulesRequest { + repeated string rule_ids = 1 [(google.api.field_behavior) = OPTIONAL]; + repeated string client_keys = 2 [(google.api.field_behavior) = OPTIONAL]; +} +message BatchDeleteRulesResponse {} + +// UndeleteRuleRequest is used to undelete a rule by rule_id or client_key. If both are provided, only rule_id will be used. +message UndeleteRuleRequest { + string rule_id = 1 [(google.api.field_behavior) = OPTIONAL]; + string client_key = 2 [(google.api.field_behavior) = OPTIONAL]; +} +message UndeleteRuleResponse {} + +// BatchUndeleteRulesRequest is used to delete a rule by rule_id or client_key. For each rule if both are provided, only rule_id will be used. +message BatchUndeleteRulesRequest { + repeated string rule_ids = 1 [(google.api.field_behavior) = OPTIONAL]; + repeated string client_keys = 2 [(google.api.field_behavior) = OPTIONAL]; +} +message BatchUndeleteRulesResponse {} + // Deprecated - use ViewJsonRulesRequest. message ViewHumanFriendlyRulesRequest { option deprecated = true; diff --git a/protos/sift/runs/v2/runs.proto b/protos/sift/runs/v2/runs.proto index d6f9b62a..3fdaa457 100644 --- a/protos/sift/runs/v2/runs.proto +++ b/protos/sift/runs/v2/runs.proto @@ -144,10 +144,10 @@ message ListRunsRequest { // Available fields to filter by are `run_id`, `organization_id`, `name`, `description`, `created_by_user_id`, `modified_by_user_id`, // `created_date`, `modified_date`, `start_time`, `stop_time`, `client_key`, `is_pinned`, `asset_id`, `client_key`, and `asset_name`. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). - // For more information about the fields used for filtering, please refer to [this definition](/api/grpc/protocol_buffers/runs#run). Optional. + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/runs#run). Optional. string filter = 3 [(google.api.field_behavior) = OPTIONAL]; - // How to order the retrieved runs. Formatted as a comma-separated string i.e. "[ desc],...". + // How to order the retrieved runs. Formatted as a comma-separated string i.e. "FIELD_NAME[ desc],...". // Available fields to order_by are `created_date`, `modified_date`, `start_time`, and `stop_time`. // If left empty, items are ordered by `created_date` in ascending order (oldest-first). // For more information about the format of this field, read [this](https://google.aip.dev/132#ordering) diff --git a/protos/sift/saved_searches/v1/saved_searches.proto b/protos/sift/saved_searches/v1/saved_searches.proto index 8f4f38c1..b931a914 100644 --- a/protos/sift/saved_searches/v1/saved_searches.proto +++ b/protos/sift/saved_searches/v1/saved_searches.proto @@ -134,7 +134,7 @@ message ListSavedSearchesRequest { // A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. // Available fields to filter by are 'name' and 'saved_search_id'. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). - // For more information about the fields used for filtering, please refer to [this definition](/api/grpc/protocol_buffers/saved_searches#savedsearch). Optional. + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/saved_searches#savedsearch). Optional. string filter = 3 [(google.api.field_behavior) = OPTIONAL]; // This field is only required if your user belongs to multiple organizations. diff --git a/protos/sift/users/v2/users.proto b/protos/sift/users/v2/users.proto index 5bd2e05c..7f16f536 100644 --- a/protos/sift/users/v2/users.proto +++ b/protos/sift/users/v2/users.proto @@ -81,7 +81,7 @@ message ListActiveUsersRequest { // A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. // Available fields to filter by are `user_id` and `name`. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). - // For more information about the fields used for filtering, please refer to [this definition](/api/grpc/protocol_buffers/users#user). Optional. + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/users#user). Optional. string filter = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. If provided, this will scope down the user search to just those in the organization ID provided. diff --git a/protos/sift/views/v1/views.proto b/protos/sift/views/v1/views.proto index d283ba47..4d9bdb70 100644 --- a/protos/sift/views/v1/views.proto +++ b/protos/sift/views/v1/views.proto @@ -190,7 +190,7 @@ message ListViewsRequest { // A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string // Available fields to filter by are 'name', 'createdDate', and 'modifiedDate'. // For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). - // For more information about the fields used for filtering, please refer to [this definition](/api/grpc/protocol_buffers/views#view). Optional. + // For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/views#view). Optional. string filter = 3; }