// Delete existing SNI endpoint.
323736
func (s *Service) SniEndpointDelete(ctx context.Context, appIdentity string, sniEndpointIdentity string) (*SniEndpoint, error) {
	var sniEndpoint SniEndpoint
	return &sniEndpoint, s.Delete(ctx, &sniEndpoint, fmt.Sprintf("/apps/%v/sni-endpoints/%v", appIdentity, sniEndpointIdentity))
}
1237667
func (forceApi *ForceApi) Delete(path string, params url.Values) error {
	return forceApi.request("DELETE", path, params, nil, nil)
}
534999
func (s *ServicesService) Delete(idOrName string) (*http.Response, error) {
	return s.DeleteWithContext(context.TODO(), idOrName)
}
1015764
func (s *VPNService) NewDeleteVpnCustomerGatewayParams(id string) *DeleteVpnCustomerGatewayParams {
	p := &DeleteVpnCustomerGatewayParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}
961877
func (assocs *associations) delete(endpoint string) {
	assocs.Lock()
	defer assocs.Unlock()
	delete(assocs.store, strings.TrimRight(endpoint, "/"))
}
1296952
func (s *ProxyLBSetting) DeleteServer(ip string, port int) {
	var res []ProxyLBServer
	for i := range s.Servers {
		if s.Servers[i].IPAddress != ip || s.Servers[i].Port != port {
			res = append(res, s.Servers[i])
		}
	}

	s.Servers = res
}
1243373
func (c *Client) Delete() *Request {
	req := c.Request()
	req.Method("DELETE")
	return req
}
1140661
func DeleteEndpoints(hostAddr string) error {
	// Get the state driver
	stateDriver, err := utils.GetStateDriver()
	if err != nil {
		return err
	}

	readEp := &mastercfg.CfgEndpointState{}
	readEp.StateDriver = stateDriver
	epCfgs, err := readEp.ReadAll()
	if err != nil {
		return err
	}

	for _, epCfg := range epCfgs {
		ep := epCfg.(*mastercfg.CfgEndpointState)
		nwCfg := &mastercfg.CfgNetworkState{}
		nwCfg.StateDriver = stateDriver
		err = nwCfg.Read(ep.NetID)
		if err != nil {
			log.Errorf("Network not found for NetID: %+v", ep.NetID)
			continue
		}

		netID := nwCfg.NetworkName + "." + nwCfg.Tenant
		epID := getEpName(netID, &intent.ConfigEP{Container: ep.EndpointID})
		if ep.HomingHost == hostAddr {
			log.Infof("Sending DeleteEndpoint for %+v", ep)
			_, err = DeleteEndpointID(stateDriver, epID)
			if err != nil {
				log.Errorf("Error delete endpoint: %+v. Err: %+v", ep, err)
			}
			epOper := &drivers.OperEndpointState{}
			epOper.StateDriver = stateDriver
			err := epOper.Read(epID)
			if err != nil {
				log.Errorf("Failed to read epOper: %+v", epOper)
				return err
			}
			err = epOper.Clear()
			if err != nil {
				log.Errorf("Error deleting oper state for %+v", epOper)
			} else {
				log.Infof("Deleted EP oper: %+v", epOper)
			}
		} else {
			log.Infof("EP not on host: %+v", hostAddr)
		}
	}

	return err
}
403841
func (ac *APIController) NetworkDelete(network *contivModel.Network) error {
	log.Infof("Received NetworkDelete: %+v", network)

	// Find the tenant
	tenant := contivModel.FindTenant(network.TenantName)
	if tenant == nil {
		return core.Errorf("Tenant not found")
	}

	// if the network has associated epgs, fail the delete
	epgCount := len(network.LinkSets.EndpointGroups)
	if epgCount != 0 {
		return core.Errorf("cannot delete %s has %d endpoint groups",
			network.NetworkName, epgCount)
	}

	svcCount := len(network.LinkSets.Servicelbs)
	if svcCount != 0 {
		return core.Errorf("cannot delete %s has %d services ",
			network.NetworkName, svcCount)
	}

	// In swarm-mode work-flow, if this is mapped to a docker network, reject delete
	if master.GetClusterMode() == core.SwarmMode {
		docknet, err := docknet.GetDocknetState(network.TenantName, network.NetworkName, "")
		if err == nil {
			return fmt.Errorf("cannot delete network %s mapped to docker network %s",
				network.NetworkName, docknet.DocknetUUID)
		}
		if !strings.Contains(strings.ToLower(err.Error()), "key not found") {
			log.Errorf("Error getting docknet state for %s.%s. (retval = %s)",
				network.TenantName, network.NetworkName, err.Error())
			return err
		}
		log.Infof("No docknet state for %s.%s. (retval = %s)",
			network.TenantName, network.NetworkName, err.Error())
	}

	// Remove link
	modeldb.RemoveLinkSet(&tenant.LinkSets.Networks, network)

	// Get the state driver
	stateDriver, err := utils.GetStateDriver()
	if err != nil {
		return err
	}

	// Delete the network
	networkID := network.NetworkName + "." + network.TenantName
	err = master.DeleteNetworkID(stateDriver, networkID)
	if err != nil {
		log.Errorf("Error deleting network %s. Err: %v", network.NetworkName, err)
		return err
	}

	// Save the tenant too since we removed the links
	return tenant.Write()
}
317249
func (proxier *Proxier) OnEndpointsDelete(endpoints *v1.Endpoints) {
	proxier.OnEndpointsUpdate(endpoints, nil)
}
461591
func (d *VppDriver) DeleteEndpoint(id string) (err error) {
	log.Infof("Not implemented")
	return nil
}
1021377
func (s *LoadBalancerSetting) DeleteServer(ip string, port string) {
	res := []*LoadBalancerServer{}
	for _, server := range s.Servers {
		if server.IPAddress != ip || server.Port != port {
			res = append(res, server)
		}
	}

	s.Servers = res

}
95001
func (a *API) Delete(path string, f func(http.ResponseWriter, *http.Request)) {
	a.router.Del(path, http.HandlerFunc(f))
}
36927
func (ep *multiPortEndpoint) unregisterEndpoint(t TransportEndpoint) bool {
	ep.mu.Lock()
	defer ep.mu.Unlock()

	idx, ok := ep.endpointsMap[t]
	if !ok {
		return false
	}
	delete(ep.endpointsMap, t)
	l := len(ep.endpointsArr)
	if l > 1 {
		// The last endpoint in endpointsArr is moved instead of the deleted one.
		lastEp := ep.endpointsArr[l-1]
		ep.endpointsArr[idx] = lastEp
		ep.endpointsMap[lastEp] = idx
		ep.endpointsArr = ep.endpointsArr[0 : l-1]
		return false
	}
	return true
}
21287
func (b *BigIP) DeleteSnatPool(name string) error {
	return b.delete(uriLtm, uriSnatPool, name)
}
512566
func (c *FakeCiliumEndpoints) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewDeleteAction(ciliumendpointsResource, c.ns, name), &v2.CiliumEndpoint{})

	return err
}
372594
func (raw *Raw) Delete(endpoint string, out interface{}, q *WriteOptions) (*WriteMeta, error) {
	return raw.c.delete(endpoint, out, q)
}