// RemoveSource deletes the source from the store
508935
func (s *Service) RemoveSource(w http.ResponseWriter, r *http.Request) {
	id, err := paramID("id", r)
	if err != nil {
		Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
		return
	}

	src := chronograf.Source{ID: id}
	ctx := r.Context()
	if err = s.Store.Sources(ctx).Delete(ctx, src); err != nil {
		if err == chronograf.ErrSourceNotFound {
			notFound(w, id, s.Logger)
		} else {
			unknownErrorWithMessage(w, err, s.Logger)
		}
		return
	}

	// Remove all the associated kapacitors for this source
	if err = s.removeSrcsKapa(ctx, id); err != nil {
		unknownErrorWithMessage(w, err, s.Logger)
		return
	}

	w.WriteHeader(http.StatusNoContent)
}
1321043
func (s *CustomRule) SetSource(v string) *CustomRule {
	s.Source = &v
	return s
}
948835
func (m *Manager) AddSource(srcs ...Source) {
	m.srcs = append(m.srcs, srcs...)
}
852973
func (s *UpdateFlowSourceOutput) SetSource(v *Source) *UpdateFlowSourceOutput {
	s.Source = v
	return s
}
1236355
func (c *Cluster) RemoveStore(storeID uint64) {
	c.Lock()
	defer c.Unlock()

	delete(c.stores, storeID)
}
723594
func (s *TerminationHealth) SetSource(v string) *TerminationHealth {
	s.Source = &v
	return s
}
496602
func (ms *Module) RemoveResource(addr addrs.Resource) {
	delete(ms.Resources, addr.String())
}
489854
func (s *SendRawEmailInput) SetSource(v string) *SendRawEmailInput {
	s.Source = &v
	return s
}
34123
func (s *Server) RemoveService(ctx context.Context, request *api.RemoveServiceRequest) (*api.RemoveServiceResponse, error) {
	if request.ServiceID == "" {
		return nil, status.Errorf(codes.InvalidArgument, errInvalidArgument.Error())
	}

	err := s.store.Update(func(tx store.Tx) error {
		return store.DeleteService(tx, request.ServiceID)
	})
	if err != nil {
		if err == store.ErrNotExist {
			return nil, status.Errorf(codes.NotFound, "service %s not found", request.ServiceID)
		}
		return nil, err
	}
	return &api.RemoveServiceResponse{}, nil
}
1049573
func (l *location) RemoveContainer(id string) error {
	return l.client.ContainerDelete(id)
}
895903
func (h *SourceHandler) handleDeleteSource(w http.ResponseWriter, r *http.Request) {
	ctx := r.Context()

	req, err := decodeDeleteSourceRequest(ctx, r)
	if err != nil {
		EncodeError(ctx, err, w)
		return
	}

	if err := h.SourceService.DeleteSource(ctx, req.SourceID); err != nil {
		EncodeError(ctx, err, w)
		return
	}

	w.WriteHeader(http.StatusNoContent)
}
631063
func (p *Pipeline) SetSource(s Source) {
	p.mutex.Lock()
	defer p.mutex.Unlock()

	p.src = s
}
722859
func (a *api) RemoveResourcePool(id string) error {
	client, err := a.connectMaster()
	if err != nil {
		return err
	}

	return client.RemoveResourcePool(id)
}
520521
func (s *Sandbox) RemoveContainer(c *oci.Container) {
	s.containers.Delete(c.Name())
}
763183
func (s *Store) RemoveCollection(name string) {
	for {
		orig := atomic.LoadPointer(&s.coll)
		coll := copyColl(*(*map[string]*Collection)(orig))
		cold := coll[name]
		delete(coll, name)
		if atomic.CompareAndSwapPointer(&s.coll, orig, unsafe.Pointer(&coll)) {
			cold.closeCollection()
			return
		}
	}
}
1331680
func (s *Flow) SetSource(v *Source) *Flow {
	s.Source = v
	return s
}
169989
func (s *DescribeDBClusterParametersInput) SetSource(v string) *DescribeDBClusterParametersInput {
	s.Source = &v
	return s
}