updateNetworkInterface method
Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics.
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> updateNetworkInterface(
UpdateNetworkInterfaceInstanceRequest request,
) async {
final url = _endPoint.replace(
path:
'/compute/v1/projects/${request.project}/zones/${request.zone}/instances/${request.instance}/updateNetworkInterface',
queryParameters: {
if (request.networkInterface case final $1 when $1.isNotDefault)
'networkInterface': $1,
'requestId': ?request.requestId,
},
);
final response = await _client.patch(
url,
body: request.networkInterfaceResource,
);
return Operation.fromJson(response);
}