// AddSnatPool adds a new snatpool by config to the BIG-IP system.
778999
func (b *BigIP) AddSnatPool(config *SnatPool) error {

	return b.post(config, uriLtm, uriSnatPool)
}
885708
func (f *Facade) AddVirtualIP(ctx datastore.Context, vip pool.VirtualIP) error {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.AddVirtualIP"))
	entity, err := f.GetResourcePool(ctx, vip.PoolID)
	alog := f.auditLogger.Message(ctx, "Adding VirtualIP").
		Action(audit.Update).WithField("virtualip", vip.IP)
	if err != nil {
		return alog.Error(err)
	} else if entity == nil {
		return alog.Error(ErrPoolNotExists)
	}
	alog = alog.Entity(entity)
	if err := f.addVirtualIP(ctx, &vip); err != nil {
		return alog.Error(err)
	}
	entity.VirtualIPs = append(entity.VirtualIPs, vip)
	entity.UpdatedAt = time.Now()

	evtctx := newEventCtx()
	err = f.beforeEvent(beforePoolUpdate, evtctx, entity)
	defer f.afterEvent(afterPoolUpdate, evtctx, entity, err)
	if err != nil {
		return alog.Error(err)
	} else if err = f.poolStore.Put(ctx, pool.Key(entity.ID), entity); err != nil {
		return alog.Error(err)
	} else if err = f.zzk.UpdateResourcePool(entity); err != nil {
		return alog.Error(err)
	}

	alog.Succeeded()
	return nil
}
269215
func (p *Pod) AddNetwork(net *PodNetwork) *Pod {
	p.Networks = append(p.Networks, net)
	return p
}
170659
func (o *Me) CreatePATNATPool(child *PATNATPool) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
338487
func AddDefaultStoragePools(p storage.Provider, pm PoolManager) error {
	for _, pool := range p.DefaultPools() {
		if err := addDefaultPool(pm, pool); err != nil {
			return err
		}
	}
	return nil
}
349500
func (c *certPool) Add(certs ...*x509.Certificate) {
	if len(certs) == 0 {
		return
	}

	//filter certs to be added, check if they already exist or duplicate
	certsToBeAdded := c.filterCerts(certs...)

	if len(certsToBeAdded) > 0 {

		c.lock.Lock()
		defer c.lock.Unlock()

		for _, newCert := range certsToBeAdded {
			// Store cert name index
			name := string(newCert.RawSubject)
			c.certsByName[name] = append(c.certsByName[name], len(c.certs))
			// Store cert
			c.certs = append(c.certs, newCert)
		}

		atomic.CompareAndSwapInt32(&c.dirty, 0, 1)
	}
}
822474
func (b *BigIP) AddBGPInstance(config *BGPInstance) error {
	return b.post(config, uriNet, uriRouting, uriBGP)
}
175950
func (g *Cloud) AddInstancesToTargetPool(name, region string, instanceRefs []*compute.InstanceReference) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	req := &compute.TargetPoolsAddInstanceRequest{
		Instances: instanceRefs,
	}
	mc := newTargetPoolMetricContext("add_instances", region)
	return mc.Observe(g.c.TargetPools().AddInstance(ctx, meta.RegionalKey(name, region), req))
}
946507
func (api *subnetsAPI) AddSubnets(args params.AddSubnetsParams) (params.ErrorResults, error) {
	if err := api.checkCanWrite(); err != nil {
		return params.ErrorResults{}, err
	}
	return networkingcommon.AddSubnets(api.context, api.backing, args)
}
269964
func (b *BigIP) ModifyPool(name string, config *Pool) error {
	return b.put(config, uriLtm, uriPool, name)
}
237338
func (ipp *intPoolPool) put(ip *intPool) {
	ipp.lock.Lock()
	defer ipp.lock.Unlock()

	if len(ipp.pools) < cap(ipp.pools) {
		ipp.pools = append(ipp.pools, ip)
	}
}
578258
func (b *BigIP) AddPoolMember(pool, member string) error {
	config := &poolMember{
		Name: member,
	}

	return b.post(config, uriLtm, uriPool, pool, uriPoolMember)
}
776963
func (idx *NetworkIndex) AddReserved(n *NetworkResource) (collide bool) {
	// Add the port usage
	used := idx.UsedPorts[n.IP]
	if used == nil {
		// Try to get a bitmap from the pool, else create
		raw := bitmapPool.Get()
		if raw != nil {
			used = raw.(Bitmap)
			used.Clear()
		} else {
			used, _ = NewBitmap(maxValidPort)
		}
		idx.UsedPorts[n.IP] = used
	}

	for _, ports := range [][]Port{n.ReservedPorts, n.DynamicPorts} {
		for _, port := range ports {
			// Guard against invalid port
			if port.Value < 0 || port.Value >= maxValidPort {
				return true
			}
			if used.Check(uint(port.Value)) {
				collide = true
			} else {
				used.Set(uint(port.Value))
			}
		}
	}

	// Add the bandwidth
	idx.UsedBandwidth[n.Device] += n.MBits
	return
}
840176
func (a *api) AddVirtualIP(requestVirtualIP pool.VirtualIP) error {
	client, err := a.connectMaster()
	if err != nil {
		return err
	}

	return client.AddVirtualIP(requestVirtualIP)
}
282182
func (r Dns_Domain_Registration) AddNameserversToDomain(nameservers []string) (resp bool, err error) {
	params := []interface{}{
		nameservers,
	}
	err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "addNameserversToDomain", params, &r.Options, &resp)
	return
}
21287
func (b *BigIP) DeleteSnatPool(name string) error {
	return b.delete(uriLtm, uriSnatPool, name)
}
810501
func NewAgentPool(cfg AgentPoolConfig) (*AgentPool, error) {
	if err := cfg.CheckAndSetDefaults(); err != nil {
		return nil, trace.Wrap(err)
	}
	ctx, cancel := context.WithCancel(cfg.Context)
	pool := &AgentPool{
		agents:     make(map[agentKey][]*Agent),
		cfg:        cfg,
		ctx:        ctx,
		cancel:     cancel,
		discoveryC: make(chan *discoveryRequest),
	}
	pool.Entry = log.WithFields(log.Fields{
		trace.Component: teleport.ComponentReverseTunnelAgent,
		trace.ComponentFields: log.Fields{
			"cluster": cfg.Cluster,
		},
	})
	return pool, nil
}