insert method

Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.

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> insert(InsertInstanceTemplateRequest request) async {
  final url = _endPoint.replace(
    path: '/compute/v1/projects/${request.project}/global/instanceTemplates',
    queryParameters: {'requestId': ?request.requestId},
  );
  final response = await _client.post(
    url,
    body: request.instanceTemplateResource,
  );
  return Operation.fromJson(response);
}