// Remove a service Template
558985
func (c *Client) RemoveServiceTemplate(serviceTemplateID string) error {
	if err := c.call("RemoveServiceTemplate", serviceTemplateID, nil); err != nil {
		return err
	}
	return nil

}
895825
func (r *Store) RemoveTemplate(ctx context.Context, name string) error {
	_, store, name := r.getStore(ctx, name)
	return store.RemoveTemplate(ctx, name)
}
997035
func deletePipelineTemplateCommand() *cli.Command {
	return &cli.Command{
		Name:     DeletePipelineTemplateCommandName,
		Usage:    DeletePipelineTemplateCommandUsage,
		Category: "Pipeline Templates",
		Flags: []cli.Flag{
			cli.StringFlag{Name: "template-name", Usage: "Pipeline Template name."}},
		Action: func(client *gocd.Client, c *cli.Context) (r interface{}, resp *gocd.APIResponse, err error) {
			if c.String("template-name") == "" {
				return nil, nil, NewFlagError("template-name")
			}

			deleteResponse, resp, err := client.PipelineTemplates.Delete(context.Background(), c.String("template-name"))
			if resp.HTTP.StatusCode == 406 {
				err = errors.New(deleteResponse)
			}
			return deleteResponse, resp, err
		},
	}
}
219831
func DeleteInstanceTemplate(c GCECloud, selfLink string) error {
	glog.V(2).Infof("Deleting GCE InstanceTemplate %s", selfLink)
	u, err := ParseGoogleCloudURL(selfLink)
	if err != nil {
		return err
	}

	op, err := c.Compute().InstanceTemplates.Delete(u.Project, u.Name).Do()
	if err != nil {
		if IsNotFound(err) {
			glog.Infof("instancetemplate not found, assuming deleted: %q", selfLink)
			return nil
		}
		return fmt.Errorf("error deleting InstanceTemplate %s: %v", selfLink, err)
	}

	return c.WaitForOp(op)
}
849547
func (s *Server) AddServiceTemplate(serviceTemplate servicetemplate.ServiceTemplate, response *string) error  {
	reloadLogstashConfig := true
	templateID, err := s.f.AddServiceTemplate(s.context(), serviceTemplate, reloadLogstashConfig)
	if err != nil {
		return err
	}
	*response = templateID
	return nil
}
196887
func (state *ServicesState) RemoveListener(name string) error {
	state.Lock()
	defer state.Unlock()

	if _, ok := state.listeners[name]; ok {
		delete(state.listeners, name)
		log.Debugf("RemoveListener(): removed %s, new count %d", name, len(state.listeners))
		return nil
	}

	return fmt.Errorf("No listener found with the name: %s", name)
}
1021654
func (service *BaseService) RemoveFilter(filter ...Filter) Service {
	service.filterManager.RemoveFilter(filter...)
	return service
}
1361030
func (c *Controller) removeUnit(ch RemoveUnit) error {
	return errors.Trace(c.removeResident(ch.ModelUUID, func(m *Model) error { return m.removeUnit(ch) }))
}
1137257
func (s *LocalSupervisor) RemoveService(srv Service) error {
	l := logrus.WithFields(logrus.Fields{"service": srv.Name(), trace.Component: teleport.Component(teleport.ComponentProcess, s.id)})
	s.Lock()
	defer s.Unlock()
	for i, el := range s.services {
		if el == srv {
			s.services = append(s.services[:i], s.services[i+1:]...)
			l.Debugf("Service is completed and removed.")
			return nil
		}
	}
	l.Warningf("Service is completed but not found.")
	return trace.NotFound("service %v is not found", srv)
}
267052
func (c *ServiceConfigs) Remove(name string) {
	c.mu.Lock()
	delete(c.m, name)
	c.mu.Unlock()
}
278604
func (mg *MailgunImpl) DeleteTemplate(ctx context.Context, name string) error {
	r := newHTTPRequest(generateApiUrl(mg, templatesEndpoint) + "/" + name)
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.APIKey())
	_, err := makeDeleteRequest(ctx, r)
	return err
}
219176
func (s *storeImpl) removeVolatileInfo(serviceID string) {
	s.serviceCacheLock.Lock()
	defer s.serviceCacheLock.Unlock()
	delete(s.serviceCache, serviceID)
}
573614
func (s *ServiceCache) DeleteService(k8sSvc *types.Service) {
	svcID := ParseServiceID(k8sSvc)

	s.mutex.Lock()
	oldService, serviceOK := s.services[svcID]
	endpoints, _ := s.correlateEndpoints(svcID)
	delete(s.services, svcID)
	s.mutex.Unlock()

	if serviceOK {
		s.Events <- ServiceEvent{
			Action:    DeleteService,
			ID:        svcID,
			Service:   oldService,
			Endpoints: endpoints,
		}
	}
}
1041742
func (c *AggregationController) RemoveAPIService(apiServiceName string) {
	if err := c.openAPIAggregationManager.RemoveAPIServiceSpec(apiServiceName); err != nil {
		utilruntime.HandleError(fmt.Errorf("removing %q from AggregationController failed with: %v", apiServiceName, err))
	}
	// This will only remove it if it was failing before. If it was successful, processNextWorkItem will figure it out
	// and will not add it again to the queue.
	c.queue.Forget(apiServiceName)
}
1341404
func (c *ServicedCli) templates() (data []string) {
	templates, err := c.driver.GetServiceTemplates()
	if err != nil || templates == nil || len(templates) == 0 {
		return
	}

	data = make([]string, len(templates))
	for i, t := range templates {
		data[i] = t.ID
	}

	return
}
511440
func NewRemoveTemplateArg(TemplateId string) *RemoveTemplateArg {
	s := new(RemoveTemplateArg)
	s.TemplateId = TemplateId
	return s
}
1235153
func (f *Facade) DeleteServiceConfig(ctx datastore.Context, fileID string) error {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.DeleteServiceConfig"))
	logger := plog.WithField("fileid", fileID)

	alog := f.auditLogger.Message(ctx, "Removing Service Configuration").
		Action(audit.Remove).ID(fileID).Type(servicedefinition.GetConfigFileType())

	if err := f.configStore.Delete(ctx, serviceconfigfile.Key(fileID)); err != nil {
		logger.WithError(err).Debug("Could not delete service config file")
		return alog.Error(err)
	}

	logger.Debug("Deleted service config file")
	alog.Succeeded()
	return nil
}