fetchStorageInventory method

Future<FetchStorageInventoryResponse> fetchStorageInventory(
  1. String source, {
  2. bool? forceRefresh,
  3. int? pageSize,
  4. String? pageToken,
  5. String? type,
  6. String? $fields,
})

List remote source's inventory of storage resources.

The remote source is another cloud vendor (e.g. AWS, Azure). The inventory describes the list of existing storage resources in that source. Note that this operation lists the resources on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.

Request parameters:

source - Required. The name of the Source. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/sources/\[^/\]+$.

forceRefresh - Optional. If this flag is set to true, the source will be queried instead of using cached results. Using this flag will make the call slower.

pageSize - Optional. The maximum number of VMs to return. The service may return fewer than this value.

pageToken - Optional. A page token, received from a previous FetchStorageInventory call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to FetchStorageInventory must match the call that provided the page token.

type - Required. The type of the storage inventory to fetch. Possible string values are:

  • "STORAGE_TYPE_UNSPECIFIED" : The type is unspecified.
  • "DISKS" : The type is disks.
  • "SNAPSHOTS" : The type is snapshots.

$fields - Selector specifying which fields to include in a partial response.

Completes with a FetchStorageInventoryResponse.

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<FetchStorageInventoryResponse> fetchStorageInventory(
  core.String source, {
  core.bool? forceRefresh,
  core.int? pageSize,
  core.String? pageToken,
  core.String? type,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (forceRefresh != null) 'forceRefresh': ['${forceRefresh}'],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (type != null) 'type': [type],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'v1/' + core.Uri.encodeFull('$source') + ':fetchStorageInventory';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return FetchStorageInventoryResponse.fromJson(
    response_ as core.Map<core.String, core.dynamic>,
  );
}