// CreateOVSDBRow creates a new row in Nuage_Port_Table using the data provided by the user
17153
func (row *NuagePortTableRow) CreateOVSDBRow(ovsdbRow map[string]interface{}) error {

	metadataMap, err := libovsdb.NewOvsMap(row.Metadata)
	if err != nil {
		glog.Errorf("error while creating metadataMap (%+v)", ovsdbRow)
		return err
	}

	ovsdbRow["name"] = row.Name
	ovsdbRow["mac"] = row.Mac
	ovsdbRow["ip_addr"] = row.IPAddr
	ovsdbRow["subnet_mask"] = row.SubnetMask
	ovsdbRow["gateway"] = row.Gateway
	ovsdbRow["bridge"] = row.Bridge
	ovsdbRow["alias"] = row.Alias
	ovsdbRow["nuage_domain"] = row.NuageDomain
	ovsdbRow["nuage_network"] = row.NuageNetwork
	ovsdbRow["nuage_zone"] = row.NuageZone
	ovsdbRow["nuage_network_type"] = row.NuageNetworkType
	ovsdbRow["evpn_id"] = row.EVPNId
	ovsdbRow["vrf_id"] = row.VRFId
	ovsdbRow["vm_domain"] = row.VMDomain
	ovsdbRow["metadata"] = metadataMap
	ovsdbRow["dirty"] = row.Dirty
	return nil
}
1308907
func (o *L2DomainTemplate) CreateEgressAdvFwdTemplate(child *EgressAdvFwdTemplate) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
807330
func (f *Field) createViewIfNotExistsBase(name string) (*view, bool, error) {
	f.mu.Lock()
	defer f.mu.Unlock()

	if view := f.viewMap[name]; view != nil {
		return view, false, nil
	}
	view := f.newView(f.viewPath(name), name)

	if err := view.open(); err != nil {
		return nil, false, errors.Wrap(err, "opening view")
	}
	view.rowAttrStore = f.rowAttrStore
	f.viewMap[view.name] = view

	return view, true, nil
}
398712
func NewOvsdbDriver(bridgeName string, failMode string, vxlanUDPPort int) (*OvsdbDriver, error) {
	// Create a new driver instance
	d := new(OvsdbDriver)
	d.bridgeName = bridgeName
	d.vxlanUDPPort = fmt.Sprintf("%d", vxlanUDPPort)

	// Connect to OVS
	ovs, err := libovsdb.ConnectUnix("")
	if err != nil {
		log.Fatalf("Error connecting to OVS. Err: %v", err)
		return nil, err
	}

	d.ovs = ovs

	// Initialize the cache
	d.cache = make(map[string]map[libovsdb.UUID]libovsdb.Row)
	d.ovs.Register(d)
	initial, _ := d.ovs.MonitorAll(ovsDataBase, "")
	d.populateCache(*initial)

	// Create a bridge after registering for events as we depend on ovsdb cache.
	// Since the same dirver is used as endpoint driver, only create the bridge
	// if it's not already created
	// XXX: revisit if the bridge-name needs to be configurable
	brCreated := false
	for _, row := range d.cache[bridgeTable] {
		if row.Fields["name"] == bridgeName {
			brCreated = true
			break
		}
	}

	if !brCreated {
		err = d.createDeleteBridge(bridgeName, failMode, operCreateBridge)
		if err != nil {
			log.Fatalf("Error creating bridge %s. Err: %v", bridgeName, err)
			return nil, err
		}
	}

	return d, nil
}
437379
func (r Virtual_Guest) CreatePostSoftwareInstallTransaction(data *string, returnBoolean *bool) (resp bool, err error) {
	params := []interface{}{
		data,
		returnBoolean,
	}
	err = r.Session.DoRequest("SoftLayer_Virtual_Guest", "createPostSoftwareInstallTransaction", params, &r.Options, &resp)
	return
}
1243812
func (_class PVSProxyClass) Create(sessionID SessionRef, site PVSSiteRef, vif VIFRef) (_retval PVSProxyRef, _err error) {
	_method := "PVS_proxy.create"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_siteArg, _err := convertPVSSiteRefToXen(fmt.Sprintf("%s(%s)", _method, "site"), site)
	if _err != nil {
		return
	}
	_vifArg, _err := convertVIFRefToXen(fmt.Sprintf("%s(%s)", _method, "VIF"), vif)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _siteArg, _vifArg)
	if _err != nil {
		return
	}
	_retval, _err = convertPVSProxyRefToGo(_method + " -> ", _result.Value)
	return
}
343862
func NewDefaultStdDevForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *StdDev, err error) {
	ind, err := NewDefaultStdDev()
	priceStream.AddTickSubscription(ind)
	return ind, err
}
421498
func (vrsConnection *VRSConnection) CreatePort(name string, attributes port.Attributes,
	metadata map[port.MetadataKey]string) error {

	portMetadata := make(map[string]string)

	for k, v := range metadata {
		portMetadata[string(k)] = v
	}

	nuagePortRow := ovsdb.NuagePortTableRow{
		Name:             name,
		Mac:              attributes.MAC,
		Bridge:           attributes.Bridge,
		NuageDomain:      metadata[port.MetadataKeyDomain],
		NuageNetwork:     metadata[port.MetadataKeyNetwork],
		NuageNetworkType: metadata[port.MetadataKeyNetworkType],
		NuageZone:        metadata[port.MetadataKeyZone],
		VMDomain:         attributes.Platform,
		Metadata:         portMetadata,
	}

	if err := vrsConnection.portTable.InsertRow(vrsConnection.ovsdbClient, &nuagePortRow); err != nil {
		return fmt.Errorf("Problem adding port info to VRS %v", err)
	}

	return nil
}
112428
func CreateWindow(title string, width, height int, fullscreen bool, msaa int) {
	CurrentBackEnd = BackEndHeadless

	gameWidth = float32(width)
	gameHeight = float32(height)

	Gl = gl.NewContext()

	windowWidth, windowHeight = float32(width), float32(height)
	canvasWidth, canvasHeight = float32(width), float32(height)
}
144888
func (o *Subnet) CreateVPort(child *VPort) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
1071846
func (d *OvsdbDriver) CreatePortBond(intfList []string, bondName string) error {

	var err error
	var ops []libovsdb.Operation
	var intfUUIDList []libovsdb.UUID
	opStr := "insert"

	// Add all the interfaces to the interface table
	for _, intf := range intfList {
		intfUUIDStr := fmt.Sprintf("Intf%s", intf)
		intfUUID := []libovsdb.UUID{{GoUuid: intfUUIDStr}}
		intfUUIDList = append(intfUUIDList, intfUUID...)

		// insert/delete a row in Interface table
		intfOp := libovsdb.Operation{}
		iface := make(map[string]interface{})
		iface["name"] = intf

		// interface table ops
		intfOp = libovsdb.Operation{
			Op:       opStr,
			Table:    interfaceTable,
			Row:      iface,
			UUIDName: intfUUIDStr,
		}
		ops = append(ops, intfOp)
	}

	// Insert bond information in Port table
	portOp := libovsdb.Operation{}
	port := make(map[string]interface{})
	port["name"] = bondName
	port["vlan_mode"] = "trunk"
	port["interfaces"], err = libovsdb.NewOvsSet(intfUUIDList)
	if err != nil {
		return err
	}

	// Set LACP and Hash properties
	// "balance-tcp" - balances flows among slaves based on L2, L3, and L4 protocol information such as
	// destination MAC address, IP address, and TCP port
	// lacp-fallback-ab:true - Fall back to activ-backup mode when LACP negotiation fails
	port["bond_mode"] = "balance-tcp"

	port["lacp"] = "active"
	lacpMap := make(map[string]string)
	lacpMap["lacp-fallback-ab"] = "true"
	port["other_config"], err = libovsdb.NewOvsMap(lacpMap)

	portUUIDStr := bondName
	portUUID := []libovsdb.UUID{{GoUuid: portUUIDStr}}
	portOp = libovsdb.Operation{
		Op:       opStr,
		Table:    portTable,
		Row:      port,
		UUIDName: portUUIDStr,
	}
	ops = append(ops, portOp)

	// Mutate the Ports column of the row in the Bridge table to include bond name
	mutateSet, _ := libovsdb.NewOvsSet(portUUID)
	mutation := libovsdb.NewMutation("ports", opStr, mutateSet)
	condition := libovsdb.NewCondition("name", "==", d.bridgeName)
	mutateOp := libovsdb.Operation{
		Op:        "mutate",
		Table:     bridgeTable,
		Mutations: []interface{}{mutation},
		Where:     []interface{}{condition},
	}
	ops = append(ops, mutateOp)

	return d.performOvsdbOps(ops)

}
701374
func CreateOptionPortMapping(portBindings []types.PortBinding) EndpointOption {
	return func(ep *endpoint) {
		// Store a copy of the bindings as generic data to pass to the driver
		pbs := make([]types.PortBinding, len(portBindings))
		copy(pbs, portBindings)
		ep.generic[netlabel.PortMap] = pbs
	}
}
26108
func NewObvForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Obv, err error) {
	ind, err := NewObv()
	priceStream.AddTickSubscription(ind)
	return ind, err
}
601415
func (p *NetPlugin) CreateHostAccPort(portName, globalIP string) (string, error) {
	p.Lock()
	defer p.Unlock()
	return p.NetworkDriver.CreateHostAccPort(portName, globalIP, p.PluginConfig.Instance.HostPvtNW)
}
1068886
func (ar *avroRecord) createObjectFromRecord(record interface{}) error {
	jsonObj, err := json.Marshal(record)
	if err != nil {
		fwColLog.Debugf("Bad record:\n%s", record)
		return err
	}

	fwColLog.Debugf("JSON Record:\n%s", string(jsonObj))
	return json.Unmarshal(jsonObj, &ar)
}
258750
func (_class VUSBClass) Create(sessionID SessionRef, vm VMRef, usbGroup USBGroupRef, otherConfig map[string]string) (_retval VUSBRef, _err error) {
	_method := "VUSB.create"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_vmArg, _err := convertVMRefToXen(fmt.Sprintf("%s(%s)", _method, "VM"), vm)
	if _err != nil {
		return
	}
	_usbGroupArg, _err := convertUSBGroupRefToXen(fmt.Sprintf("%s(%s)", _method, "USB_group"), usbGroup)
	if _err != nil {
		return
	}
	_otherConfigArg, _err := convertStringToStringMapToXen(fmt.Sprintf("%s(%s)", _method, "other_config"), otherConfig)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _vmArg, _usbGroupArg, _otherConfigArg)
	if _err != nil {
		return
	}
	_retval, _err = convertVUSBRefToGo(_method + " -> ", _result.Value)
	return
}
1206231
func (o *GatewayTemplate) CreatePortTemplate(child *PortTemplate) *bambou.Error {

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