// DeleteRegionBackendService deletes the given BackendService by name.
484289
func (g *Cloud) DeleteRegionBackendService(name, region string) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newBackendServiceMetricContext("delete", region)
	return mc.Observe(g.c.RegionBackendServices().Delete(ctx, meta.RegionalKey(name, region)))
}
181300
func (m *Memory) DeleteRange(ctx context.Context, startKey, endKey []byte) error {
	if len(startKey) == 0 {
		return trace.BadParameter("missing parameter startKey")
	}
	if len(endKey) == 0 {
		return trace.BadParameter("missing parameter endKey")
	}
	m.Lock()
	defer m.Unlock()
	m.removeExpired()
	re := m.getRange(ctx, startKey, endKey, backend.NoLimit)
	for _, item := range re.Items {
		m.processEvent(backend.Event{
			Type: backend.OpDelete,
			Item: item,
		})
	}
	return nil
}
942196
func (g *Cloud) ListRegionBackendServices(region string) ([]*compute.BackendService, error) {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newBackendServiceMetricContext("list", region)
	v, err := g.c.RegionBackendServices().List(ctx, region, filter.None)
	return v, mc.Observe(err)
}
327970
func (backend *Backend) DeleteTranslation(t *i18n.Translation) error {
	return backend.DB.Where(Translation{Key: t.Key, Locale: t.Locale}).Delete(&Translation{}).Error
}
1124459
func (client *Client) DeleteRoute(routeGUID string) (Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.DeleteRouteRequest,
		URIParams:   map[string]string{"route_guid": routeGUID},
	})
	if err != nil {
		return nil, err
	}

	var response cloudcontroller.Response
	err = client.connection.Make(request, &response)
	return response.Warnings, err
}
1093438
func (_m *Balancer) DeleteService(_a0 string) error {
	ret := _m.Called(_a0)

	var r0 error
	if rf, ok := ret.Get(0).(func(string) error); ok {
		r0 = rf(_a0)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
87532
func (client *Client) DeleteServiceBinding(serviceBindingGUID string, acceptsIncomplete bool) (ServiceBinding, Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.DeleteServiceBindingRequest,
		URIParams:   map[string]string{"service_binding_guid": serviceBindingGUID},
		Query:       url.Values{"accepts_incomplete": {fmt.Sprint(acceptsIncomplete)}},
	})
	if err != nil {
		return ServiceBinding{}, nil, err
	}

	var response cloudcontroller.Response
	var serviceBinding ServiceBinding
	if acceptsIncomplete {
		response = cloudcontroller.Response{
			DecodeJSONResponseInto: &serviceBinding,
		}
	}

	err = client.connection.Make(request, &response)
	return serviceBinding, response.Warnings, err
}
540022
func (f *Facade) DeleteRegistryImage(ctx datastore.Context, image string) error {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.DeleteRegistryImage"))
	if err := f.registryStore.Delete(ctx, image); err != nil {
		return err
	}
	if err := f.zzk.DeleteRegistryImage(registry.Key(image).ID()); err != nil {
		return err
	}
	return nil
}
286517
func (ep *EtcdClient) DeregisterService(serviceInfo ServiceInfo) error {
	keyName := "/contiv.io/service/" + serviceInfo.ServiceName + "/" +
		serviceInfo.HostAddr + ":" + strconv.Itoa(serviceInfo.Port)

	// Find it in the database
	srvState := ep.serviceDb[keyName]
	if srvState == nil {
		log.Errorf("Could not find the service in db %s", keyName)
		return errors.New("Service not found")
	}

	// stop the refresh thread and delete service
	srvState.stopChan <- true
	delete(ep.serviceDb, keyName)

	// Delete the service instance
	_, err := ep.kapi.Delete(context.Background(), keyName, nil)
	if err != nil {
		log.Errorf("Error deleting key %s. Err: %v", keyName, err)
		return err
	}

	return nil
}
1025232
func (l *State) deleteService(id string) error {
	if id == "" {
		return fmt.Errorf("ServiceID missing")
	}

	req := structs.DeregisterRequest{
		Datacenter:   l.config.Datacenter,
		Node:         l.config.NodeName,
		ServiceID:    id,
		WriteRequest: structs.WriteRequest{Token: l.serviceToken(id)},
	}
	var out struct{}
	err := l.Delegate.RPC("Catalog.Deregister", &req, &out)
	switch {
	case err == nil || strings.Contains(err.Error(), "Unknown service"):
		delete(l.services, id)
		l.logger.Printf("[INFO] agent: Deregistered service %q", id)
		return nil

	case acl.IsErrPermissionDenied(err), acl.IsErrNotFound(err):
		// todo(fs): mark the service to be in sync to prevent excessive retrying before next full sync
		// todo(fs): some backoff strategy might be a better solution
		l.services[id].InSync = true
		l.logger.Printf("[WARN] agent: Service %q deregistration blocked by ACLs", id)
		metrics.IncrCounter([]string{"acl", "blocked", "service", "deregistration"}, 1)
		return nil

	default:
		l.logger.Printf("[WARN] agent: Deregistering service %q failed. %s", id, err)
		return err
	}
}
227218
func (b *Backend) Delete(ctx context.Context, key string) error {
	defer metrics.MeasureSince(metricDelete, time.Now())

	// Pooling
	b.permitPool.Acquire()
	defer b.permitPool.Release()

	// Delete
	m := spanner.Delete(b.table, spanner.Key{key})
	if _, err := b.client.Apply(ctx, []*spanner.Mutation{m}); err != nil {
		return errwrap.Wrapf("failed to delete key: {{err}}", err)
	}

	return nil
}
950327
func (o *LaunchSpecification) SetBackendServiceConfig(v *BackendServiceConfig) *LaunchSpecification {
	if o.BackendServiceConfig = v; o.BackendServiceConfig == nil {
		o.nullFields = append(o.nullFields, "BackendServiceConfig")
	}
	return o
}
387874
func (a *AuditBroker) Deregister(name string) {
	a.Lock()
	defer a.Unlock()
	delete(a.backends, name)
}
316631
func (r *ReleaseModuleServiceServer) DeleteRelease(ctx context.Context, in *rudderAPI.DeleteReleaseRequest) (*rudderAPI.DeleteReleaseResponse, error) {
	grpclog.Print("delete")

	resp := &rudderAPI.DeleteReleaseResponse{}
	rel := in.Release
	vs, err := tiller.GetVersionSet(clientset.Discovery())
	if err != nil {
		return resp, fmt.Errorf("Could not get apiVersions from Kubernetes: %v", err)
	}

	kept, errs := tiller.DeleteRelease(rel, vs, kubeClient)
	rel.Manifest = kept

	allErrors := ""
	for _, e := range errs {
		allErrors = allErrors + "\n" + e.Error()
	}

	if len(allErrors) > 0 {
		err = fmt.Errorf(allErrors)
	}

	return &rudderAPI.DeleteReleaseResponse{
		Release: rel,
	}, err
}
1036078
func DeleteServiceLB(key string) error {
	collections.serviceLBMutex.Lock()
	obj := collections.serviceLBs[key]
	collections.serviceLBMutex.Unlock()
	if obj == nil {
		log.Errorf("serviceLB %s not found", key)
		return errors.New("serviceLB not found")
	}

	// Check if we handle this object
	if objCallbackHandler.ServiceLBCb == nil {
		log.Errorf("No callback registered for serviceLB object")
		return errors.New("Invalid object type")
	}

	// Perform callback
	err := objCallbackHandler.ServiceLBCb.ServiceLBDelete(obj)
	if err != nil {
		log.Errorf("ServiceLBDelete retruned error for: %+v. Err: %v", obj, err)
		return err
	}

	// delete it from modeldb
	collections.serviceLBMutex.Lock()
	err = obj.Delete()
	collections.serviceLBMutex.Unlock()
	if err != nil {
		log.Errorf("Error deleting serviceLB %s. Err: %v", obj.Key, err)
	}

	// delete it from cache
	collections.serviceLBMutex.Lock()
	delete(collections.serviceLBs, key)
	collections.serviceLBMutex.Unlock()

	return nil
}
477635
func (s *Sanitizer) Delete(ctx context.Context, key []byte) error {
	if !isKeySafe(key) {
		return trace.BadParameter(errorMessage)
	}
	return s.backend.Delete(ctx, key)
}
208295
func deleteService(client corev1.ServicesGetter, namespace string) error {
	err := client.Services(namespace).Delete(serviceName, &metav1.DeleteOptions{})
	return ingoreNotFound(err)
}