# Method: organizations.locations.workloads.analyzeWorkloadMove

- [HTTP request](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#body.request_body)
- [Response body](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#body.AnalyzeWorkloadMoveResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#body.aspect_1)
- [AssetMoveAnalysis](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#AssetMoveAnalysis)
  - [JSON representation](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#AssetMoveAnalysis.SCHEMA_REPRESENTATION)
- [MoveAnalysisGroup](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#MoveAnalysisGroup)
  - [JSON representation](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#MoveAnalysisGroup.SCHEMA_REPRESENTATION)
- [MoveAnalysisResult](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#MoveAnalysisResult)
  - [JSON representation](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#MoveAnalysisResult.SCHEMA_REPRESENTATION)
- [MoveImpact](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#MoveImpact)
  - [JSON representation](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#MoveImpact.SCHEMA_REPRESENTATION)

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.

### HTTP request

`GET https://{endpoint}/v1/{target=organizations/*/locations/*/workloads/*}:analyzeWorkloadMove`

Where `{endpoint}` is one of the [supported service endpoints](https://docs.cloud.google.com/assured-workloads/docs/reference/rest#rest_endpoints).

The URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `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" |

### Query parameters

| Parameters ||
|---|---|
| `pageSize` | `integer` Optional. Page size. If a value is not specified, the default value of 10 is used. The maximum value is 50. |
| `pageToken` | `string` Optional. The page token from the previous response. It needs to be passed in the second and following requests. |
| `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). |
| Union parameter `sourceResource`. The resource type to be moved to the destination workload. `sourceResource` can be only one of the following: ||
| `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. |

### Request body

The request body must be empty.

### Response body

Response containing the analysis results for the hypothetical resource move.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "assetMoveAnalyses": [ { object (`https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#AssetMoveAnalysis`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `assetMoveAnalyses[]` | ``object (`https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#AssetMoveAnalysis`)`` List of analysis results for each asset in scope. |
| `nextPageToken` | `string` The next page token. Is empty if the last page is reached. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `target` resource:

- `assuredworkloads.workload.get`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## AssetMoveAnalysis

Represents move analysis results for an asset.

| JSON representation |
|---|
| ``` { "asset": string, "assetType": string, "analysisGroups": [ { object (`https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#MoveAnalysisGroup`) } ] } ``` |

| Fields ||
|---|---|
| `asset` | `string` The full resource name of the asset being analyzed. Example: //compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1 |
| `assetType` | `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). |
| `analysisGroups[]` | ``object (`https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#MoveAnalysisGroup`)`` List of eligible analyses performed for the asset. |

## MoveAnalysisGroup

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.

| JSON representation |
|---|
| ``` { "displayName": string, // Union field `result` can be only one of the following: "analysisResult": { object (`https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#MoveAnalysisResult`) }, "error": { object (`https://docs.cloud.google.com/assured-workloads/docs/reference/rest/Shared.Types/ListOperationsResponse#Status`) } // End of list of possible types for union field `result`. } ``` |

| Fields ||
|---|---|
| `displayName` | `string` Name of the analysis group. |
| Union field `result`. `result` can be only one of the following: ||
| `analysisResult` | ``object (`https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#MoveAnalysisResult`)`` Result of a successful analysis. |
| `error` | ``object (`https://docs.cloud.google.com/assured-workloads/docs/reference/rest/Shared.Types/ListOperationsResponse#Status`)`` Error details for a failed analysis. |

## MoveAnalysisResult

Represents the successful move analysis results for a group.

| JSON representation |
|---|
| ``` { "warnings": [ { object (`https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#MoveImpact`) } ], "blockers": [ { object (`https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#MoveImpact`) } ] } ``` |

| Fields ||
|---|---|
| `warnings[]` | ``object (`https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#MoveImpact`)`` List of warnings. These are risks that may or may not result in compliance violations. |
| `blockers[]` | ``object (`https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1/organizations.locations.workloads/analyzeWorkloadMove#MoveImpact`)`` List of blockers. If not resolved, these will result in compliance violations in the target. |

## MoveImpact

Represents the impact of moving the asset to the target.

| JSON representation |
|---|
| ``` { "detail": string } ``` |

| Fields ||
|---|---|
| `detail` | `string` Explanation of the impact. |