// CreateOverlayPATNATEntry creates a new child OverlayPATNATEntry under the OverlayAddressPool
1533
func (o *OverlayAddressPool) CreateOverlayPATNATEntry(child *OverlayPATNATEntry) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
971513
func (f *MockInfraProvider) CreatePeerFromConfig(peerCfg *fab.NetworkPeer) (fab.Peer, error) {
	if peerCfg != nil {
		p := NewMockPeer(peerCfg.MSPID, peerCfg.URL)
		p.SetMSPID(peerCfg.MSPID)

		return p, nil
	}
	return &MockPeer{}, nil
}
774287
func createDirWithOverlayOpaque(tmp string) (string, error) {
	lower := filepath.Join(tmp, "l")
	upper := filepath.Join(tmp, "u")
	work := filepath.Join(tmp, "w")
	merged := filepath.Join(tmp, "m")
	for _, s := range []string{lower, upper, work, merged} {
		if err := os.MkdirAll(s, 0700); err != nil {
			return "", errors.Wrapf(err, "failed to mkdir %s", s)
		}
	}
	dummyBase := "d"
	lowerDummy := filepath.Join(lower, dummyBase)
	if err := os.MkdirAll(lowerDummy, 0700); err != nil {
		return "", errors.Wrapf(err, "failed to create a dummy lower directory %s", lowerDummy)
	}
	mOpts := fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", lower, upper, work)
	// docker/pkg/mount.Mount() requires procfs to be mounted. So we use syscall.Mount() directly instead.
	if err := syscall.Mount("overlay", merged, "overlay", uintptr(0), mOpts); err != nil {
		return "", errors.Wrapf(err, "failed to mount overlay (%s) on %s", mOpts, merged)
	}
	mergedDummy := filepath.Join(merged, dummyBase)
	if err := os.Remove(mergedDummy); err != nil {
		syscall.Unmount(merged, 0)
		return "", errors.Wrapf(err, "failed to rmdir %s", mergedDummy)
	}
	// upperDummy becomes a 0,0-char device file here
	if err := os.Mkdir(mergedDummy, 0700); err != nil {
		syscall.Unmount(merged, 0)
		return "", errors.Wrapf(err, "failed to mkdir %s", mergedDummy)
	}
	// upperDummy becomes a directory with trusted.overlay.opaque xattr
	// (but can't be verified in userns)
	if err := syscall.Unmount(merged, 0); err != nil {
		return "", errors.Wrapf(err, "failed to unmount %s", merged)
	}
	upperDummy := filepath.Join(upper, dummyBase)
	return upperDummy, nil
}
1151278
func (o *Domain) CreateSPATSourcesPool(child *SPATSourcesPool) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
530685
func (s *PresenceService) CreateRemoteCluster(rc services.RemoteCluster) error {
	value, err := json.Marshal(rc)
	if err != nil {
		return trace.Wrap(err)
	}
	item := backend.Item{
		Key:     backend.Key(remoteClustersPrefix, rc.GetName()),
		Value:   value,
		Expires: rc.Expiry(),
	}
	_, err = s.Create(context.TODO(), item)
	if err != nil {
		return trace.Wrap(err)
	}
	return nil
}
790174
func (o *VPort) CreateBGPNeighbor(child *BGPNeighbor) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
371744
func (client *Client) CreateNatGateway(args *CreateNatGatewayArgs) (resp *CreateNatGatewayResponse, err error) {
	response := CreateNatGatewayResponse{}
	err = client.Invoke("CreateNatGateway", args, &response)
	if err != nil {
		return nil, err
	}
	return &response, err
}
1247552
func (o *RedundancyGroup) CreateIngressProfile(child *IngressProfile) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
564803
func (scw *SplitCloneWorker) createKeyResolver(td *tabletmanagerdatapb.TableDefinition) (keyspaceIDResolver, error) {
	if scw.cloneType == verticalSplit {
		// VerticalSplitClone currently always has exactly one destination shard
		// and therefore does not require routing between multiple shards.
		return nil, nil
	}

	if *useV3ReshardingMode {
		return newV3ResolverFromTableDefinition(scw.keyspaceSchema, td)
	}
	return newV2Resolver(scw.destinationKeyspaceInfo, td)
}
582720
func NewAddressBasedPool(factory func(string) IOSession, handler ConnStatusHandler) *AddressBasedPool {
	return &AddressBasedPool{
		handler: handler,
		factory: factory,
		conns:   make(map[string]IOSession),
	}
}
879113
func (o *IngressACLTemplate) CreateIngressACLEntryTemplate(child *IngressACLEntryTemplate) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
840579
func (api *API) CreateLoadBalancerPool(pool LoadBalancerPool) (LoadBalancerPool, error) {
	uri := api.userBaseURL("/user") + "/load_balancers/pools"
	res, err := api.makeRequest("POST", uri, pool)
	if err != nil {
		return LoadBalancerPool{}, errors.Wrap(err, errMakeRequestError)
	}
	var r loadBalancerPoolResponse
	if err := json.Unmarshal(res, &r); err != nil {
		return LoadBalancerPool{}, errors.Wrap(err, errUnmarshalError)
	}
	return r.Result, nil
}
375864
func (o *CSNATPool) CreateCTranslationMap(child *CTranslationMap) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
1029882
func (o *PSNATPool) CreatePSPATMap(child *PSPATMap) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
464115
func (o *Subnet) CreateProxyARPFilter(child *ProxyARPFilter) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
287199
func (f *InfraProvider) CreatePeerFromConfig(peerCfg *fab.NetworkPeer) (fab.Peer, error) {
	return peerImpl.New(f.providerContext.EndpointConfig(), peerImpl.FromPeerConfig(peerCfg))
}
850641
func (o *OverlayManagementProfile) CreateOverlayManagementSubnetProfile(child *OverlayManagementSubnetProfile) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}