From 86eaf3ff8d5be74e0254e22045789c5d6d8c969b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Date: Mon, 18 Sep 2023 13:29:10 +0000 Subject: [PATCH] feat(assuredworkloads): update the api #### assuredworkloads:v1 The following keys were added: - resources.organizations.resources.locations.resources.workloads.methods.analyzeWorkloadMove (Total Keys: 21) - schemas.GoogleCloudAssuredworkloadsV1AnalyzeWorkloadMoveResponse (Total Keys: 5) - schemas.GoogleCloudAssuredworkloadsV1AssetMoveAnalysis (Total Keys: 6) - schemas.GoogleCloudAssuredworkloadsV1MoveAnalysisGroup (Total Keys: 5) - schemas.GoogleCloudAssuredworkloadsV1MoveAnalysisResult (Total Keys: 6) - schemas.GoogleCloudAssuredworkloadsV1MoveImpact (Total Keys: 3) --- ..._v1.organizations.locations.workloads.html | 75 ++++++++++ .../documents/assuredworkloads.v1.json | 140 +++++++++++++++++- 2 files changed, 214 insertions(+), 1 deletion(-) diff --git a/docs/dyn/assuredworkloads_v1.organizations.locations.workloads.html b/docs/dyn/assuredworkloads_v1.organizations.locations.workloads.html index 7adc3db08bc..23079025acd 100644 --- a/docs/dyn/assuredworkloads_v1.organizations.locations.workloads.html +++ b/docs/dyn/assuredworkloads_v1.organizations.locations.workloads.html @@ -79,6 +79,12 @@

Instance Methods

Returns the violations Resource.

+

+ analyzeWorkloadMove(target, assetTypes=None, pageSize=None, pageToken=None, project=None, x__xgafv=None)

+

Analyzes a hypothetical move of a source resource to a target workload to surface compliance risks. The analysis is best effort and is not guaranteed to be exhaustive.

+

+ analyzeWorkloadMove_next()

+

Retrieves the next page of results.

close()

Close httplib2 connections.

@@ -107,6 +113,75 @@

Instance Methods

restrictAllowedResources(name, body=None, x__xgafv=None)

Restrict the list of resources allowed in the Workload environment. The current list of allowed products can be found at https://cloud.google.com/assured-workloads/docs/supported-products In addition to assuredworkloads.workload.update permission, the user should also have orgpolicy.policy.set permission on the folder resource to use this functionality.

Method Details

+
+ analyzeWorkloadMove(target, assetTypes=None, pageSize=None, pageToken=None, project=None, x__xgafv=None) +
Analyzes a hypothetical move of a source resource to a target workload to surface compliance risks. The analysis is best effort and is not guaranteed to be exhaustive.
+
+Args:
+  target: string, Required. The resource ID of the folder-based destination workload. This workload is where the source resource will hypothetically be moved to. Specify the workload's relative resource name, formatted as: "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" For example: "organizations/123/locations/us-east1/workloads/assured-workload-2" (required)
+  assetTypes: string, Optional. List of asset types to be analyzed, including and under the source resource. If empty, all assets are analyzed. The complete list of asset types is available [here](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types). (repeated)
+  pageSize: integer, Optional. Page size. If a value is not specified, the default value of 10 is used.
+  pageToken: string, Optional. The page token from the previous response. It needs to be passed in the second and following requests.
+  project: string, The source type is a project. Specify the project's relative resource name, formatted as either a project number or a project ID: "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" For example: "projects/951040570662" when specifying a project number, or "projects/my-project-123" when specifying a project ID.
+  x__xgafv: string, V1 error format.
+    Allowed values
+      1 - v1 error format
+      2 - v2 error format
+
+Returns:
+  An object of the form:
+
+    { # Response containing the analysis results for the hypothetical resource move.
+  "assetMoveAnalyses": [ # List of analysis results for each asset in scope.
+    { # Represents move analysis results for an asset.
+      "analysisGroups": [ # List of eligible analyses performed for the asset.
+        { # Represents a logical group of checks performed for an asset. If successful, the group contains the analysis result, otherwise it contains an error with the failure reason.
+          "analysisResult": { # Represents the successful move analysis results for a group. # Result of a successful analysis.
+            "blockers": [ # List of blockers. If not resolved, these will result in compliance violations in the target.
+              { # Represents the impact of moving the asset to the target.
+                "detail": "A String", # Explanation of the impact.
+              },
+            ],
+            "warnings": [ # List of warnings. These are risks that may or may not result in compliance violations.
+              { # Represents the impact of moving the asset to the target.
+                "detail": "A String", # Explanation of the impact.
+              },
+            ],
+          },
+          "displayName": "A String", # Name of the analysis group.
+          "error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # Error details for a failed analysis.
+            "code": 42, # The status code, which should be an enum value of google.rpc.Code.
+            "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
+              {
+                "a_key": "", # Properties of the object. Contains field @type with type URL.
+              },
+            ],
+            "message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
+          },
+        },
+      ],
+      "asset": "A String", # The full resource name of the asset being analyzed. Example: //compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1
+      "assetType": "A String", # Type of the asset being analyzed. Possible values will be among the ones listed [here](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
+    },
+  ],
+  "nextPageToken": "A String", # The next page token. Is empty if the last page is reached.
+}
+
+ +
+ analyzeWorkloadMove_next() +
Retrieves the next page of results.
+
+        Args:
+          previous_request: The request for the previous page. (required)
+          previous_response: The response from the request for the previous page. (required)
+
+        Returns:
+          A request object that you can call 'execute()' on to request the next
+          page. Returns None if there are no more items in the collection.
+        
+
+
close()
Close httplib2 connections.
diff --git a/googleapiclient/discovery_cache/documents/assuredworkloads.v1.json b/googleapiclient/discovery_cache/documents/assuredworkloads.v1.json index cf8cc37f2b0..3a6a79830bc 100644 --- a/googleapiclient/discovery_cache/documents/assuredworkloads.v1.json +++ b/googleapiclient/discovery_cache/documents/assuredworkloads.v1.json @@ -181,6 +181,53 @@ }, "workloads": { "methods": { + "analyzeWorkloadMove": { + "description": "Analyzes a hypothetical move of a source resource to a target workload to surface compliance risks. The analysis is best effort and is not guaranteed to be exhaustive.", + "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/workloads/{workloadsId}:analyzeWorkloadMove", + "httpMethod": "GET", + "id": "assuredworkloads.organizations.locations.workloads.analyzeWorkloadMove", + "parameterOrder": [ + "target" + ], + "parameters": { + "assetTypes": { + "description": "Optional. List of asset types to be analyzed, including and under the source resource. If empty, all assets are analyzed. The complete list of asset types is available [here](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).", + "location": "query", + "repeated": true, + "type": "string" + }, + "pageSize": { + "description": "Optional. Page size. If a value is not specified, the default value of 10 is used.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. The page token from the previous response. It needs to be passed in the second and following requests.", + "location": "query", + "type": "string" + }, + "project": { + "description": "The source type is a project. Specify the project's relative resource name, formatted as either a project number or a project ID: \"projects/{PROJECT_NUMBER}\" or \"projects/{PROJECT_ID}\" For example: \"projects/951040570662\" when specifying a project number, or \"projects/my-project-123\" when specifying a project ID.", + "location": "query", + "type": "string" + }, + "target": { + "description": "Required. The resource ID of the folder-based destination workload. This workload is where the source resource will hypothetically be moved to. Specify the workload's relative resource name, formatted as: \"organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}\" For example: \"organizations/123/locations/us-east1/workloads/assured-workload-2\"", + "location": "path", + "pattern": "^organizations/[^/]+/locations/[^/]+/workloads/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+target}:analyzeWorkloadMove", + "response": { + "$ref": "GoogleCloudAssuredworkloadsV1AnalyzeWorkloadMoveResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "create": { "description": "Creates Assured Workload.", "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/workloads", @@ -519,7 +566,7 @@ } } }, - "revision": "20230831", + "revision": "20230907", "rootUrl": "https://assuredworkloads.googleapis.com/", "schemas": { "GoogleCloudAssuredworkloadsV1AcknowledgeViolationRequest": { @@ -544,6 +591,46 @@ "properties": {}, "type": "object" }, + "GoogleCloudAssuredworkloadsV1AnalyzeWorkloadMoveResponse": { + "description": "Response containing the analysis results for the hypothetical resource move.", + "id": "GoogleCloudAssuredworkloadsV1AnalyzeWorkloadMoveResponse", + "properties": { + "assetMoveAnalyses": { + "description": "List of analysis results for each asset in scope.", + "items": { + "$ref": "GoogleCloudAssuredworkloadsV1AssetMoveAnalysis" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The next page token. Is empty if the last page is reached.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudAssuredworkloadsV1AssetMoveAnalysis": { + "description": "Represents move analysis results for an asset.", + "id": "GoogleCloudAssuredworkloadsV1AssetMoveAnalysis", + "properties": { + "analysisGroups": { + "description": "List of eligible analyses performed for the asset.", + "items": { + "$ref": "GoogleCloudAssuredworkloadsV1MoveAnalysisGroup" + }, + "type": "array" + }, + "asset": { + "description": "The full resource name of the asset being analyzed. Example: //compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1", + "type": "string" + }, + "assetType": { + "description": "Type of the asset being analyzed. Possible values will be among the ones listed [here](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudAssuredworkloadsV1CreateWorkloadOperationMetadata": { "description": "Operation metadata to give request details of CreateWorkload.", "id": "GoogleCloudAssuredworkloadsV1CreateWorkloadOperationMetadata", @@ -644,6 +731,57 @@ }, "type": "object" }, + "GoogleCloudAssuredworkloadsV1MoveAnalysisGroup": { + "description": "Represents a logical group of checks performed for an asset. If successful, the group contains the analysis result, otherwise it contains an error with the failure reason.", + "id": "GoogleCloudAssuredworkloadsV1MoveAnalysisGroup", + "properties": { + "analysisResult": { + "$ref": "GoogleCloudAssuredworkloadsV1MoveAnalysisResult", + "description": "Result of a successful analysis." + }, + "displayName": { + "description": "Name of the analysis group.", + "type": "string" + }, + "error": { + "$ref": "GoogleRpcStatus", + "description": "Error details for a failed analysis." + } + }, + "type": "object" + }, + "GoogleCloudAssuredworkloadsV1MoveAnalysisResult": { + "description": "Represents the successful move analysis results for a group.", + "id": "GoogleCloudAssuredworkloadsV1MoveAnalysisResult", + "properties": { + "blockers": { + "description": "List of blockers. If not resolved, these will result in compliance violations in the target.", + "items": { + "$ref": "GoogleCloudAssuredworkloadsV1MoveImpact" + }, + "type": "array" + }, + "warnings": { + "description": "List of warnings. These are risks that may or may not result in compliance violations.", + "items": { + "$ref": "GoogleCloudAssuredworkloadsV1MoveImpact" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudAssuredworkloadsV1MoveImpact": { + "description": "Represents the impact of moving the asset to the target.", + "id": "GoogleCloudAssuredworkloadsV1MoveImpact", + "properties": { + "detail": { + "description": "Explanation of the impact.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudAssuredworkloadsV1MutatePartnerPermissionsRequest": { "description": "Request for updating permission settings for a partner workload.", "id": "GoogleCloudAssuredworkloadsV1MutatePartnerPermissionsRequest",