// DeleteBindPort バインドポート削除
437676
func (s *ProxyLBSetting) DeleteBindPort(mode string, port int) {
	var res []*ProxyLBBindPorts
	for i := range s.BindPorts {
		if s.BindPorts[i].ProxyMode != mode || s.BindPorts[i].Port != port {
			res = append(res, s.BindPorts[i])
		}
	}
	s.BindPorts = res
}
1155130
func (i *Instance) deletePortSet(contextID string) error {

	if i.mode == constants.RemoteContainer {
		return nil
	}

	portSetName := i.getPortSet(contextID)
	if portSetName == "" {
		return fmt.Errorf("Failed to find port set")
	}

	ips := ipset.IPSet{
		Name: portSetName,
	}

	if err := ips.Destroy(); err != nil {
		return fmt.Errorf("Failed to delete pu port set "+portSetName, zap.Error(err))
	}

	if err := i.contextIDToPortSetMap.Remove(contextID); err != nil {
		zap.L().Debug("portset not found for the contextID", zap.String("contextID", contextID))
	}

	return nil
}
808132
func (f *Facade) RemovePublicEndpointPort(ctx datastore.Context, serviceid, endpointName, portAddr string) error {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.RemovePublicEndpointPort"))
	alog := f.auditLogger.Message(ctx, "Removing Public Endpoint Port").ID(serviceid).Action(audit.Update).
		WithFields(logrus.Fields{
			"endpointname": endpointName,
			"portaddr":     portAddr,
		})
	// Scrub the port for all checks, as this is what gets stored against the service.
	portAddr = service.ScrubPortString(portAddr)

	// Get the service for this service id.
	svc, err := f.GetService(ctx, serviceid)
	if err != nil {
		err = fmt.Errorf("Could not find service %s: %s", serviceid, err)
		glog.Error(err)
		return alog.Error(err)
	}
	alog = alog.Entity(svc)

	err = svc.RemovePort(endpointName, portAddr)
	if err != nil {
		err = fmt.Errorf("Error removing port %s from service (%s): %v", portAddr, svc.Name, err)
		glog.Error(err)
		return alog.Error(err)
	}

	glog.V(2).Infof("Removed port public endpoint %s from service %s", portAddr, svc.Name)

	if err = f.UpdateService(ctx, *svc); err != nil {
		glog.Error(err)
		return alog.Error(err)
	}

	glog.V(2).Infof("Service (%s) updated", svc.Name)
	alog.Succeeded()
	return nil
}
584059
func (c *Client) DeleteBinding(vhost string, info BindingInfo) (res *http.Response, err error) {
	req, err := newRequestWithBody(c, "DELETE", "bindings/"+PathEscape(vhost)+
		"/e/"+PathEscape(info.Source)+"/"+PathEscape(string(info.DestinationType[0]))+
		"/"+PathEscape(info.Destination)+"/"+PathEscape(info.PropertiesKey), nil)
	if err != nil {
		return nil, err
	}

	res, err = executeRequest(c, req)
	if err != nil {
		return nil, err
	}

	return res, nil
}
930062
func (p *NetPlugin) DeletePeerHost(node core.ServiceInfo) error {
	p.Lock()
	defer p.Unlock()
	return p.NetworkDriver.DeletePeerHost(node)
}
415725
func (p *printer) deleteAttrPrefix(prefix string) {
	delete(p.attrPrefix, p.attrNS[prefix])
	delete(p.attrNS, prefix)
}
843871
func (c *Client) DeleteIndex(indices ...string) *IndicesDeleteService {
	return NewIndicesDeleteService(c).Index(indices)
}
1078325
func (sw *OvsSwitch) DeletePort(epOper *drivers.OperEndpointState, skipVethPair bool) error {

	if epOper.VtepIP != "" {
		return nil
	}

	// Get the OVS port name
	ovsPortName := getOvsPortName(epOper.PortName, skipVethPair)

	// Get the openflow port number for the interface and remove from ofnet
	ofpPort, err := sw.ovsdbDriver.GetOfpPortNo(ovsPortName)
	if err == nil {
		if sw.ofnetAgent != nil {
			err = sw.ofnetAgent.RemoveLocalEndpoint(ofpPort)
		}
	} else {
		if sw.ofnetAgent != nil {
			var tenantName string
			netParts := strings.Split(epOper.NetID, ".")
			if len(netParts) == 2 {
				tenantName = netParts[1]
			} else {
				tenantName = "default"
			}
			epID := sw.ofnetAgent.GetEndpointIdByIpVrf(net.ParseIP(epOper.IPAddress), tenantName)
			err = sw.ofnetAgent.RemoveLocalEndpointByID(epID)
		}
	}
	if err != nil {
		log.Errorf("Error removing endpoint %+v from ofnet. Err: %v", epOper, err)
		// continue with further cleanup
	}

	// Delete it from ovsdb
	err = sw.ovsdbDriver.DeletePort(ovsPortName)
	if err != nil {
		log.Errorf("Error deleting port %s from OVS. Err: %v", ovsPortName, err)
		// continue with further cleanup
	}

	// Delete the Veth pairs if required
	if useVethPair && !skipVethPair {
		// Delete a Veth pair
		verr := deleteVethPair(ovsPortName, epOper.PortName)
		if verr != nil {
			log.Errorf("Error deleting veth pairs. Err: %v", verr)
			return verr
		}
	}

	return err
}
1234047
func (pdb *BytesBrokerWatcherRedis) Delete(match string, opts ...datasync.DelOption) (found bool, err error) {
	if pdb.delegate.closed {
		return false, fmt.Errorf("Delete(%s) called on a closed connection", match)
	}
	pdb.Debugf("Delete(%s)", match)

	return pdb.delegate.Delete(pdb.addPrefix(match), opts...)
}
342627
func (h *netlinkHandle) UnbindAddress(address, devName string) error {
	dev, err := h.LinkByName(devName)
	if err != nil {
		return fmt.Errorf("error get interface: %s, err: %v", devName, err)
	}
	addr := net.ParseIP(address)
	if addr == nil {
		return fmt.Errorf("error parse ip address: %s", address)
	}
	if err := h.AddrDel(dev, &netlink.Addr{IPNet: netlink.NewIPNet(addr)}); err != nil {
		if err != unix.ENXIO {
			return fmt.Errorf("error unbind address: %s from interface: %s, err: %v", address, devName, err)
		}
	}
	return nil
}
832108
func (p *NetPlugin) DeleteHostAccPort(portName string) error {
	p.Lock()
	defer p.Unlock()
	return p.NetworkDriver.DeleteHostAccPort(portName)
}
220855
func (self *BaseDispatcher) DeleteUdid(d *restObjUdid, id string, bundle PBundle) bool {
	allow, ok := d.del.(AllowerUdid)
	if !ok {
		return true
	}
	return allow.Allow(id, "DELETE", bundle)
}
974332
func (s *SetLoadBalancerPoliciesOfListenerInput) SetLoadBalancerPort(v int64) *SetLoadBalancerPoliciesOfListenerInput {
	s.LoadBalancerPort = &v
	return s
}
272253
func (s *LoadBalancerService) DeleteLoadBalancerRule(p *DeleteLoadBalancerRuleParams) (*DeleteLoadBalancerRuleResponse, error) {
	resp, err := s.cs.newRequest("deleteLoadBalancerRule", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r DeleteLoadBalancerRuleResponse
	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
}
618392
func (b *BigIP) DeleteUdpProfile(name string) error {
	return b.delete(uriLtm, uriProfile, uriUdp, name)
}
425607
func (db *ProtoWrapper) Delete(key string, opts ...datasync.DelOption) (existed bool, err error) {
	return db.broker.Delete(key, opts...)
}
1177495
func (s *SetLoadBalancerListenerSSLCertificateInput) SetLoadBalancerPort(v int64) *SetLoadBalancerListenerSSLCertificateInput {
	s.LoadBalancerPort = &v
	return s
}