deleteNetworkInterface method
Deletes one dynamic network interface from an active instance. InstancesDeleteNetworkInterfaceRequest indicates:
- instance from which to delete, using project+zone+resource_id fields;
- dynamic network interface to be deleted, using network_interface_name field;
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> deleteNetworkInterface(
DeleteNetworkInterfaceInstanceRequest request,
) async {
final url = _endPoint.replace(
path:
'/compute/v1/projects/${request.project}/zones/${request.zone}/instances/${request.instance}/deleteNetworkInterface',
queryParameters: {
if (request.networkInterfaceName case final $1 when $1.isNotDefault)
'networkInterfaceName': $1,
'requestId': ?request.requestId,
},
);
final response = await _client.post(url);
return Operation.fromJson(response);
}