@@ -27,6 +27,7 @@ import "google/protobuf/empty.proto";
2727import "google/protobuf/field_mask.proto" ;
2828import "google/protobuf/struct.proto" ;
2929import "google/protobuf/timestamp.proto" ;
30+ import "google/rpc/status.proto" ;
3031import "google/type/expr.proto" ;
3132
3233option csharp_namespace = "Google.Cloud.Asset.V1" ;
@@ -165,17 +166,36 @@ service AssetService {
165166 // [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation
166167 // status. We recommend intervals of at least 2 seconds with exponential
167168 // backoff retry to poll the operation result. The metadata contains the
168- // request to help callers to map responses to requests .
169+ // metadata for the long-running operation .
169170 rpc AnalyzeIamPolicyLongrunning (AnalyzeIamPolicyLongrunningRequest ) returns (google .longrunning .Operation ) {
170171 option (google.api.http ) = {
171172 post : "/v1/{analysis_query.scope=*/*}:analyzeIamPolicyLongrunning"
172173 body : "*"
173174 };
174175 option (google.longrunning.operation_info ) = {
175176 response_type : "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse"
176- metadata_type : "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest "
177+ metadata_type : "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata "
177178 };
178179 }
180+
181+ // Analyze moving a resource to a specified destination without kicking off
182+ // the actual move. The analysis is best effort depending on the user's
183+ // permissions of viewing different hierarchical policies and configurations.
184+ // The policies and configuration are subject to change before the actual
185+ // resource migration takes place.
186+ rpc AnalyzeMove (AnalyzeMoveRequest ) returns (AnalyzeMoveResponse ) {
187+ option (google.api.http ) = {
188+ get : "/v1/{resource=*/*}:analyzeMove"
189+ };
190+ }
191+ }
192+
193+ // Represents the metadata of the longrunning operation for the
194+ // AnalyzeIamPolicyLongrunning rpc.
195+ message AnalyzeIamPolicyLongrunningMetadata {
196+ // The time the operation was created.
197+ google.protobuf.Timestamp create_time = 1
198+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
179199}
180200
181201// Export asset request.
@@ -659,7 +679,7 @@ message Feed {
659679 // optional.
660680 //
661681 // See our [user
662- // guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes#feed_with_condition )
682+ // guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes-with-condition )
663683 // for detailed instructions.
664684 google.type.Expr condition = 6 ;
665685}
@@ -703,8 +723,8 @@ message SearchAllResourcesRequest {
703723 // encryption key whose name contains the word "key".
704724 // * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a
705725 // word.
706- // * `NOT state:ACTIVE` to find {{gcp_name}} resources whose state
707- // doesn't contain "ACTIVE" as a word.
726+ // * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain
727+ // "ACTIVE" as a word.
708728 // * `createTime<1609459200` to find Cloud resources that were created before
709729 // "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
710730 // "2021-01-01 00:00:00 UTC" in seconds.
@@ -754,6 +774,7 @@ message SearchAllResourcesRequest {
754774 // to indicate descending order. Redundant space characters are ignored.
755775 // Example: "location DESC, name".
756776 // Only singular primitive fields in the response are sortable:
777+ //
757778 // * name
758779 // * assetType
759780 // * project
@@ -766,10 +787,41 @@ message SearchAllResourcesRequest {
766787 // * state
767788 // * parentFullResourceName
768789 // * parentAssetType
790+ //
769791 // All the other fields such as repeated fields (e.g., `networkTags`), map
770792 // fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`)
771793 // are not supported.
772794 string order_by = 6 [(google.api.field_behavior ) = OPTIONAL ];
795+
796+ // Optional. A comma-separated list of fields specifying which fields to be returned in
797+ // ResourceSearchResult. Only '*' or combination of top level fields can be
798+ // specified. Field names of both snake_case and camelCase are supported.
799+ // Examples: `"*"`, `"name,location"`, `"name,versionedResources"`.
800+ //
801+ // The read_mask paths must be valid field paths listed but not limited to
802+ // (both snake_case and camelCase are supported):
803+ //
804+ // * name
805+ // * assetType
806+ // * project
807+ // * displayName
808+ // * description
809+ // * location
810+ // * labels
811+ // * networkTags
812+ // * kmsKey
813+ // * createTime
814+ // * updateTime
815+ // * state
816+ // * additionalAttributes
817+ // * versionedResources
818+ //
819+ // If read_mask is not specified, all fields except versionedResources will
820+ // be returned.
821+ // If only '*' is specified, all fields including versionedResources will be
822+ // returned.
823+ // Any invalid field path will trigger INVALID_ARGUMENT error.
824+ google.protobuf.FieldMask read_mask = 8 [(google.api.field_behavior ) = OPTIONAL ];
773825}
774826
775827// Search all resources response.
@@ -1203,7 +1255,84 @@ message AnalyzeIamPolicyLongrunningRequest {
12031255}
12041256
12051257// A response message for [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning].
1206- message AnalyzeIamPolicyLongrunningResponse {}
1258+ message AnalyzeIamPolicyLongrunningResponse {
1259+
1260+ }
1261+
1262+ // The request message for performing resource move analysis.
1263+ message AnalyzeMoveRequest {
1264+ // View enum for supporting partial analysis responses.
1265+ enum AnalysisView {
1266+ // The default/unset value.
1267+ // The API will default to the FULL view.
1268+ ANALYSIS_VIEW_UNSPECIFIED = 0 ;
1269+
1270+ // Full analysis including all level of impacts of the specified resource
1271+ // move.
1272+ FULL = 1 ;
1273+
1274+ // Basic analysis only including blockers which will prevent the specified
1275+ // resource move at runtime.
1276+ BASIC = 2 ;
1277+ }
1278+
1279+ // Required. Name of the resource to perform the analysis against.
1280+ // Only GCP Project are supported as of today. Hence, this can only be Project
1281+ // ID (such as "projects/my-project-id") or a Project Number (such as
1282+ // "projects/12345").
1283+ string resource = 1 [(google.api.field_behavior ) = REQUIRED ];
1284+
1285+ // Required. Name of the GCP Folder or Organization to reparent the target
1286+ // resource. The analysis will be performed against hypothetically moving the
1287+ // resource to this specified desitination parent. This can only be a Folder
1288+ // number (such as "folders/123") or an Organization number (such as
1289+ // "organizations/123").
1290+ string destination_parent = 2 [(google.api.field_behavior ) = REQUIRED ];
1291+
1292+ // Analysis view indicating what information should be included in the
1293+ // analysis response. If unspecified, the default view is FULL.
1294+ AnalysisView view = 3 ;
1295+ }
1296+
1297+ // The response message for resource move analysis.
1298+ message AnalyzeMoveResponse {
1299+ // The list of analyses returned from performing the intended resource move
1300+ // analysis. The analysis is grouped by different Cloud services.
1301+ repeated MoveAnalysis move_analysis = 1 ;
1302+ }
1303+
1304+ // A message to group the analysis information.
1305+ message MoveAnalysis {
1306+ // The user friendly display name of the analysis. E.g. IAM, Organization
1307+ // Policy etc.
1308+ string display_name = 1 ;
1309+
1310+ oneof result {
1311+ // Analysis result of moving the target resource.
1312+ MoveAnalysisResult analysis = 2 ;
1313+
1314+ // Description of error encountered when performing the analysis.
1315+ google.rpc.Status error = 3 ;
1316+ }
1317+ }
1318+
1319+ // An analysis result including blockers and warnings.
1320+ message MoveAnalysisResult {
1321+ // Blocking information that would prevent the target resource from moving
1322+ // to the specified destination at runtime.
1323+ repeated MoveImpact blockers = 1 ;
1324+
1325+ // Warning information indicating that moving the target resource to the
1326+ // specified destination might be unsafe. This can include important policy
1327+ // information and configuration changes, but will not block moves at runtime.
1328+ repeated MoveImpact warnings = 2 ;
1329+ }
1330+
1331+ // A message to group impacts of moving the target resource.
1332+ message MoveImpact {
1333+ // User friendly impact detail in a free form message.
1334+ string detail = 1 ;
1335+ }
12071336
12081337// Asset content type.
12091338enum ContentType {
0 commit comments