// Deletes a service offering.
543018
func (c *Client) DeleteServiceOffering(p *DeleteServiceOfferingParameter) (*Result, error) {
	obj, err := c.Request("deleteServiceOffering", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*Result), err
}
1176320
func (_m *APIClient) ServiceRemove(ctx context.Context, serviceID string) error {
	ret := _m.Called(ctx, serviceID)

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

	return r0
}
780169
func (c *HyperClient) DeleteService(podID string, services []*types.UserService) error {
	_, err := c.client.ServiceDelete(
		c.ctx,
		&types.ServiceDelRequest{PodID: podID, Services: services},
	)

	if err != nil {
		return err
	}
	return nil
}
1312357
func (v *vserver) deleteService(s *service) {
	if s.active {
		s.healthy = false
		v.updateState(s.ip)
	}
	log.Infof("%v: deleting service: %v", v, s)
	delete(v.services, s.serviceKey)
	// TODO(baptr): Once service contains seesaw.VIP, move check and
	// unconfigureVIP here.
}
1072857
func (s *Service) RemoveService(w http.ResponseWriter, r *http.Request) {
	id, err := paramID("kid", r)
	if err != nil {
		Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
		return
	}

	srcID, err := paramID("id", r)
	if err != nil {
		Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
		return
	}

	ctx := r.Context()
	srv, err := s.Store.Servers(ctx).Get(ctx, id)
	if err != nil || srv.SrcID != srcID || srv.Type == "" {
		notFound(w, id, s.Logger)
		return
	}

	if err = s.Store.Servers(ctx).Delete(ctx, srv); err != nil {
		unknownErrorWithMessage(w, err, s.Logger)
		return
	}

	w.WriteHeader(http.StatusNoContent)
}
1026009
func (s *VPCService) DeleteVPCOffering(p *DeleteVPCOfferingParams) (*DeleteVPCOfferingResponse, error) {
	resp, err := s.cs.newRequest("deleteVPCOffering", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r DeleteVPCOfferingResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}
334587
func (d *Disco) DeleteAdvertisedServices() {
	d.watchedMutex.RLock()
	services := make([]string, 0, len(d.myAdvertisedServices))
	for s := range d.myAdvertisedServices {
		services = append(services, s)
	}
	d.watchedMutex.RUnlock()
	for _, serviceName := range services {
		d.DeleteAdvertisedService(serviceName)
	}
}
838716
func DeleteService(svc Service) error {
	ic := &ipvsCommand{Service: newIPVSService(&svc)}
	return netlink.SendMessageMarshalled(C.IPVS_CMD_DEL_SERVICE, family, 0, ic)
}
813214
func (m *MockCommonAPIClient) ServiceRemove(ctx context.Context, serviceID string) error {
	ret := m.ctrl.Call(m, "ServiceRemove", ctx, serviceID)
	ret0, _ := ret[0].(error)
	return ret0
}
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
}
645508
func (a *api) RemoveService(id string) error {
	client, err := a.connectDAO()
	if err != nil {
		return err
	}

	if err := client.RemoveService(id, new(int)); err != nil {
		return fmt.Errorf("could not remove service %s: %s", id, err)
	}
	return nil
}
1021502
func (r *Service) Delete(key string) error {
	c := r.pool.Get()
	defer c.Close()

	_, err := c.Do("DEL", r.Config.Prefix+key)
	return err
}
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
}
534999
func (s *ServicesService) Delete(idOrName string) (*http.Response, error) {
	return s.DeleteWithContext(context.TODO(), idOrName)
}
1274444
func (k *kubernetesClient) DeleteService(appName string) (err error) {
	logger.Debugf("deleting application %s", appName)

	deploymentName := k.deploymentName(appName)
	if err := k.deleteService(deploymentName); err != nil {
		return errors.Trace(err)
	}
	if err := k.deleteStatefulSet(deploymentName); err != nil {
		return errors.Trace(err)
	}
	if err := k.deleteDeployment(deploymentName); err != nil {
		return errors.Trace(err)
	}
	secrets := k.client().CoreV1().Secrets(k.namespace)
	secretList, err := secrets.List(v1.ListOptions{
		LabelSelector: applicationSelector(appName),
	})
	if err != nil {
		return errors.Trace(err)
	}
	for _, s := range secretList.Items {
		if err := k.deleteSecret(s.Name); err != nil {
			return errors.Trace(err)
		}
	}
	return nil
}
266582
func (s *EventsService) Delete(e EventKey) (*http.Response, error) {
	return s.client.delete(e.URI(), nil)
}
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,
		}
	}
}