moveDisk method

Future<Operation> moveDisk(
  1. MoveDiskProjectRequest request
)

Moves a persistent disk from one zone to another. Note: The moveDisk API will be deprecated on September 29, 2026.

Starting September 29, 2025, you can't use the moveDisk API on new projects. To move a disk to a different region or zone, follow the steps in Change the location of a disk.

Projects that already use the moveDisk API can continue usage until September 29, 2026.

Starting November 1, 2025, API responses will include a warning message in the response body about the upcoming deprecation. You can skip the message to continue using the service without interruption.

Throws a http.ClientException if there were problems communicating with the API service. Throws a ServiceException if the API method failed for any reason.

Implementation

Future<Operation> moveDisk(MoveDiskProjectRequest request) async {
  final url = _endPoint.replace(
    path: '/compute/v1/projects/${request.project}/moveDisk',
    queryParameters: {'requestId': ?request.requestId},
  );
  final response = await _client.post(
    url,
    body: request.diskMoveRequestResource,
  );
  return Operation.fromJson(response);
}