// AciGwUpdate updates aci state
553006
func (ac *APIController) AciGwUpdate(aci, params *contivModel.AciGw) error {
	log.Infof("Received AciGwUpdate: %+v", params)
	// Fail the update if app profiles exist
	profCount := contivModel.GetAppProfileCount()
	if profCount != 0 {
		log.Warnf("AciGwUpdate: %d existing App-Profiles found.",
			profCount)
	}

	aci.EnforcePolicies = params.EnforcePolicies
	aci.IncludeCommonTenant = params.IncludeCommonTenant
	aci.NodeBindings = params.NodeBindings
	aci.PathBindings = params.PathBindings
	aci.PhysicalDomain = params.PhysicalDomain
	return nil
}
253052
func (c *ContivClient) AciGwDelete(name string) error {
	// build key and URL
	keyStr := name
	url := c.baseURL + "/api/v1/aciGws/" + keyStr + "/"

	// http get the object
	err := c.httpDelete(url)
	if err != nil {
		log.Debugf("Error deleting aciGw %s. Err: %v", keyStr, err)
		return err
	}

	return nil
}
173058
func (b *storageDBWrapper) txnOpUpdate(id string, updates ...bson.DocElem) txn.Op {
	op := b.txnOpBase(id)
	op.Assert = txn.DocExists
	op.Update = bson.D{{"$set", bson.D(updates)}}
	return op
}
34977
func (c *Client) LinodeConfigUpdate(configID int, conf LinodeConfigUpdateOpts) error {
	args, err := c.argMarshal(conf)
	if err != nil {
		return err
	}
	args["ConfigID"] = configID

	_, err = c.apiCall("linode.config.update", args)
	if err != nil {
		return err
	}

	return nil
}
1196760
func (c *Client) LinodeDiskUpdate(linodeID int, diskID int, label *string, readOnly *bool) error {
	args := make(map[string]interface{})
	args["LinodeID"] = linodeID
	args["DiskID"] = diskID
	args["Label"] = label
	args["isReadOnly"] = readOnly

	_, err := c.apiCall("linode.disk.update", args)
	if err != nil {
		return err
	}
	return nil
}
882532
func (client *rateClient) SendExchangeUpdate(update *dcrrates.ExchangeRateUpdate) (err error) {
	for i := range client.exchanges {
		if client.exchanges[i] == update.Token {
			err = client.stream.Send(update)
			return
		}
	}
	return
}
1265814
func (v *vserver) configUpdate() {
	newSvcs := v.expandServices()
	for svcKey, newSvc := range newSvcs {
		if svc, ok := v.services[svcKey]; ok {
			if svc.ip.Equal(newSvc.ip) {
				svc.update(newSvc)
				continue
			}
			log.Infof("%v: service %v: new IP address: %v", v, svc, newSvc.ip)
			v.deleteService(svc)
		}
		log.Infof("%v: adding new service: %v", v, newSvc)
		v.services[svcKey] = newSvc
		v.updateState(newSvc.ip)
	}

	for svcKey, svc := range v.services {
		if newSvcs[svcKey] == nil {
			// Service no longer exists
			v.deleteService(svc)
			continue
		}

		// Update destinations for this service
		newDests := v.expandDests(svc)
		for destKey, newDest := range newDests {
			if dest, ok := svc.dests[destKey]; ok {
				dest.update(newDest)
				continue
			}
			log.Infof("%v: service %v: adding new destination: %v", v, svc, newDest)
			svc.dests[destKey] = newDest
		}

		for destKey, dest := range svc.dests {
			if newDests[destKey] == nil {
				// Destination no longer exists
				if dest.active {
					dest.healthy = false
					svc.updateState()
				}
				log.Infof("%v: service %v: deleting destination: %v", v, svc, dest)
				delete(svc.dests, destKey)
			}
		}
	}

	// If a VIP has been re-IP'd or has no services configured, remove the old
	// VIP from the interface.
	needVIPs := make(map[seesaw.IP]bool)
	for _, svc := range v.services {
		needVIPs[svc.ip] = true
	}
	for vip := range v.vips {
		if !needVIPs[vip.IP] {
			log.Infof("%v: unconfiguring no longer needed VIP %v", v, vip.IP)
			v.unconfigureVIP(&vip)
		}
	}

	checks := v.expandChecks()
	for k, oldCheck := range v.checks {
		if checks[k] != nil {
			checks[k].description = oldCheck.description
			checks[k].status = oldCheck.status
		}
	}
	v.checks = checks
	// TODO(baptr): Should this only happen if it's enabled?
	v.configureVIPs()
	return
}
86980
func (c *ContivClient) AciGwList() (*[]*AciGw, error) {
	// build key and URL
	url := c.baseURL + "/api/v1/aciGws/"

	// http get the object
	var objList []*AciGw
	err := c.httpGet(url, &objList)
	if err != nil {
		log.Debugf("Error getting aciGws. Err: %v", err)
		return nil, err
	}

	return &objList, nil
}
1074935
func (bot *ExchangeBot) signalExchangeUpdate(update *ExchangeUpdate) {
	for _, ch := range bot.updateChans {
		select {
		case ch <- update:
		default:
			log.Warnf("Failed to write update to exchange update channel")
		}
	}
}
864456
func ConfigUpdate(info *model.ConfigUpdateInfo) error {
	return mgr.Do(func(ctx context.Context, cli *client.Client) (err error) {
		var cfg swarm.Config
		cfg, _, err = cli.ConfigInspectWithRaw(ctx, info.ID)
		if err != nil {
			return err
		}

		spec := cfg.Spec
		// only the Labels field can be updated on API 1.30
		//spec.Name = info.Name
		//spec.Data = []byte(info.Data)
		spec.Labels = info.Labels.ToMap()
		return cli.ConfigUpdate(ctx, info.ID, version(info.Version), spec)
	})
}
1272207
func (m *Sqlbridge) parseSqlUpdate() (*SqlUpdate, error) {

	req := NewSqlUpdate()
	m.Next() // Consume UPDATE token

	//u.Debugf("token:  %v", m.Cur())
	switch m.Cur().T {
	case lex.TokenTable, lex.TokenIdentity:
		req.Table = m.Cur().V
	default:
		return nil, fmt.Errorf("expected table name but got : %v", m.Cur().V)
	}
	m.Next()
	if m.Cur().T != lex.TokenSet {
		return nil, fmt.Errorf("expected SET after table name but got : %v", m.Cur().V)
	}

	// list of name=value pairs
	m.Next()
	cols, err := m.parseUpdateList()
	if err != nil {
		u.Error(err)
		return nil, err
	}
	req.Values = cols

	// WHERE
	req.Where, err = m.parseWhere()
	if err != nil {
		return nil, err
	}

	return req, nil
}
394763
func (d *OvsDriver) GlobalConfigUpdate(inst core.InstanceInfo) error {
	// convert the netplugin config to ofnet config
	// currently, its only ArpMode
	var cfg ofnet.OfnetGlobalConfig
	switch inst.ArpMode {
	case "flood":
		cfg.ArpMode = ofnet.ArpFlood
	default:
		// set the default to proxy for graceful upgrade
		cfg.ArpMode = ofnet.ArpProxy
	}

	errs := ""
	for _, sw := range d.switchDb {
		err := sw.GlobalConfigUpdate(cfg)
		if err != nil {
			errs += err.Error()
		}
	}
	if errs != "" {
		return errors.New(errs)
	}

	return nil
}
1131571
func FindAciGw(key string) *AciGw {
	collections.aciGwMutex.Lock()
	defer collections.aciGwMutex.Unlock()

	obj := collections.aciGws[key]
	if obj == nil {
		return nil
	}

	return obj
}
1347392
func (sw *OvsSwitch) GlobalConfigUpdate(cfg ofnet.OfnetGlobalConfig) error {
	if sw.ofnetAgent == nil {
		return errors.New("no ofnet agent")
	}
	return sw.ofnetAgent.GlobalConfigUpdate(cfg)
}
122115
func (n *nomadFSM) applyACLPolicyUpsert(buf []byte, index uint64) interface{} {
	defer metrics.MeasureSince([]string{"nomad", "fsm", "apply_acl_policy_upsert"}, time.Now())
	var req structs.ACLPolicyUpsertRequest
	if err := structs.Decode(buf, &req); err != nil {
		panic(fmt.Errorf("failed to decode request: %v", err))
	}

	if err := n.state.UpsertACLPolicies(index, req.Policies); err != nil {
		n.logger.Error("UpsertACLPolicies failed", "error", err)
		return err
	}
	return nil
}
1170183
func (s *InstanceSummary) SetLastUpdatedAt(v time.Time) *InstanceSummary {
	s.LastUpdatedAt = &v
	return s
}
656666
func (s *ReplicaSettingsUpdate) SetReplicaProvisionedReadCapacityAutoScalingSettingsUpdate(v *AutoScalingSettingsUpdate) *ReplicaSettingsUpdate {
	s.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate = v
	return s
}