analyzeWorkloadMove method
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.
Request parameters:
target
- 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"
Value must have pattern
^organizations/\[^/\]+/locations/\[^/\]+/workloads/\[^/\]+$
.
assetTypes
- 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.
pageSize
- Optional. Page size. If a value is not specified, the default
value of 10 is used.
pageToken
- Optional. The page token from the previous response. It
needs to be passed in the second and following requests.
project
- 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.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleCloudAssuredworkloadsV1AnalyzeWorkloadMoveResponse.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<GoogleCloudAssuredworkloadsV1AnalyzeWorkloadMoveResponse>
analyzeWorkloadMove(
core.String target, {
core.List<core.String>? assetTypes,
core.int? pageSize,
core.String? pageToken,
core.String? project,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (assetTypes != null) 'assetTypes': assetTypes,
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if (project != null) 'project': [project],
if ($fields != null) 'fields': [$fields],
};
final url_ =
'v1/' + core.Uri.encodeFull('$target') + ':analyzeWorkloadMove';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GoogleCloudAssuredworkloadsV1AnalyzeWorkloadMoveResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}