// Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any.
434469
func (c *cronJobs) Update(cronJob *v1beta1.CronJob) (result *v1beta1.CronJob, err error) {
	result = &v1beta1.CronJob{}
	err = c.client.Put().
		Namespace(c.ns).
		Resource("cronjobs").
		Name(cronJob.Name).
		Body(cronJob).
		Do().
		Into(result)
	return
}
1306152
func (s *ServicesService) Update(idOrName string, svc *Service) (*Service, *http.Response, error) {
	return s.UpdateWithContext(context.TODO(), idOrName, svc)
}
1093925
func (d *Document) Update(ctx context.Context) APIResponse {
	newDoc, resp := d.client.Get(ctx, d.Links.Document, d.Owner)

	if resp.Error != nil {
		return resp
	}

	*d = *newDoc

	return apiResponse("update completed", d.ID, resp.HttpResponse, nil)
}
76342
func (c *Client) Update(args params.ApplicationUpdate) error {
	return c.facade.FacadeCall("Update", args, nil)
}
1169373
func Update(db DB, table string, src interface{}) error {
	return Default.Update(db, table, src)
}
722236
func (m *Mercury) Update(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.TxnResponse, error) {
	return m.BatchUpdate(ctx, map[string]string{key: val}, opts...)
}
1322541
func (s *Server) Update(ctx context.Context, filePath string, contents []byte, version topo.Version) (topo.Version, error) {
	nodePath := path.Join(s.root, filePath)

	// Again, we need to get the final version back.
	// So we have to use a transaction, as Put doesn't return the version.
	ops := api.KVTxnOps{
		&api.KVTxnOp{
			Verb:  api.KVSet,
			Key:   nodePath,
			Value: contents,
		},
	}
	if version != nil {
		ops[0].Verb = api.KVCAS
		ops[0].Index = uint64(version.(ConsulVersion))
	}
	ok, resp, _, err := s.kv.Txn(ops, nil)
	if err != nil {
		// Communication error.
		return nil, err
	}
	if !ok {
		// Transaction was rolled back, means the node has a
		// bad version.
		return nil, topo.NewError(topo.BadVersion, nodePath)
	}
	return ConsulVersion(resp.Results[0].ModifyIndex), nil
}
109568
func (crs *ConfigRepoService) Update(ctx context.Context, id string, cr *ConfigRepo) (out *ConfigRepo, resp *APIResponse, err error) {
	out = &ConfigRepo{}
	_, resp, err = crs.client.putAction(ctx, &APIClientRequest{
		Path:         fmt.Sprintf("admin/config_repos/%s", id),
		RequestBody:  cr,
		ResponseBody: out,
		APIVersion:   apiV1,
	})

	out.client = crs.client
	return
}
1003204
func (tm *taskManager) Update(ctx context.Context, task *api.Task) error {
	select {
	case tm.updateq <- task:
		return nil
	case <-tm.closed:
		return ErrClosed
	case <-ctx.Done():
		return ctx.Err()
	}
}
413001
func (d *OvsdbDriver) Update(context interface{}, tableUpdates libovsdb.TableUpdates) {
	d.populateCache(tableUpdates)
	intfUpds, ok := tableUpdates.Updates["Interface"]
	if !ok {
		return
	}

	for _, intfUpd := range intfUpds.Rows {
		intf := intfUpd.New.Fields["name"]
		oldLacpStatus, ok := intfUpd.Old.Fields["lacp_current"]
		if !ok {
			return
		}
		newLacpStatus, ok := intfUpd.New.Fields["lacp_current"]
		if !ok {
			return
		}
		if oldLacpStatus == newLacpStatus || d.ovsSwitch == nil {
			return
		}

		linkUpd := ofnet.LinkUpdateInfo{
			LinkName:   intf.(string),
			LacpStatus: newLacpStatus.(bool),
		}
		log.Debugf("LACP_UPD: Interface: %+v. LACP Status - (Old: %+v, New: %+v)\n", intf, oldLacpStatus, newLacpStatus)
		d.ovsSwitch.HandleLinkUpdates(linkUpd)
	}
}
590165
func (s *Server) Update(ctx context.Context, q *RepoUpdateRequest) (*appsv1.Repository, error) {
	if err := s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceRepositories, rbacpolicy.ActionUpdate, q.Repo.Repo); err != nil {
		return nil, err
	}
	_, err := s.db.UpdateRepository(ctx, q.Repo)
	return &appsv1.Repository{Repo: q.Repo.Repo}, err
}
439896
func (db *database) Update(ctx context.Context, api api) (time.Duration, bool) {
	db.mu.Lock()
	defer db.mu.Unlock()

	// Construct the request.
	var numTypes int
	var s []*pb.FetchThreatListUpdatesRequest_ListUpdateRequest
	for _, td := range db.config.ThreatLists {
		var state []byte
		if row, ok := db.tfu[td]; ok {
			state = row.State
		}

		s = append(s, &pb.FetchThreatListUpdatesRequest_ListUpdateRequest{
			ThreatType:      pb.ThreatType(td.ThreatType),
			PlatformType:    pb.PlatformType(td.PlatformType),
			ThreatEntryType: pb.ThreatEntryType(td.ThreatEntryType),
			Constraints: &pb.FetchThreatListUpdatesRequest_ListUpdateRequest_Constraints{
				SupportedCompressions: db.config.compressionTypes},
			State: state,
		})
		numTypes++
	}
	req := &pb.FetchThreatListUpdatesRequest{
		Client: &pb.ClientInfo{
			ClientId:      db.config.ID,
			ClientVersion: db.config.Version,
		},
		ListUpdateRequests: s,
	}

	// Query the API for the threat list and update the database.
	last := db.config.now()
	resp, err := api.ListUpdate(ctx, req)
	if err != nil {
		db.log.Printf("ListUpdate failure (%d): %v", db.updateAPIErrors+1, err)
		db.setError(err)
		// backoff strategy: MIN((2**N-1 * 15 minutes) * (RAND + 1), 24 hours)
		n := 1 << db.updateAPIErrors
		delay := time.Duration(float64(n) * (rand.Float64() + 1) * float64(baseRetryDelay))
		if delay > maxRetryDelay {
			delay = maxRetryDelay
		}
		db.updateAPIErrors++
		return delay, false
	}
	db.updateAPIErrors = 0

	// add jitter to wait time to avoid all servers lining up
	nextUpdateWait := db.config.UpdatePeriod + time.Duration(rand.Int31n(60)-30)*time.Second
	if resp.MinimumWaitDuration != nil {
		serverMinWait := time.Duration(resp.MinimumWaitDuration.Seconds)*time.Second + time.Duration(resp.MinimumWaitDuration.Nanos)
		if serverMinWait > nextUpdateWait {
			nextUpdateWait = serverMinWait
			db.log.Printf("Server requested next update in %v", nextUpdateWait)
		}
	}
	if len(resp.ListUpdateResponses) != numTypes {
		db.setError(errors.New("safebrowsing: threat list count mismatch"))
		db.log.Printf("invalid server response: got %d, want %d threat lists",
			len(resp.ListUpdateResponses), numTypes)
		return nextUpdateWait, false
	}

	// Update the threat database with the response.
	db.generateThreatsForUpdate()
	if err := db.tfu.update(resp); err != nil {
		db.setError(err)
		db.log.Printf("update failure: %v", err)
		db.tfu = nil
		return nextUpdateWait, false
	}
	dbf := databaseFormat{make(threatsForUpdate), last}
	for td, phs := range db.tfu {
		// Copy of partialHashes before generateThreatsForLookups clobbers it.
		dbf.Table[td] = phs
	}
	db.generateThreatsForLookups(last)

	// Regenerate the database and store it.
	if db.config.DBPath != "" {
		// Semantically, we ignore save errors, but we do log them.
		if err := saveDatabase(db.config.DBPath, dbf); err != nil {
			db.log.Printf("save failure: %v", err)
		}
	}

	return nextUpdateWait, true
}
898989
func (c *FakeExamples) Update(example *crv1.Example) (result *crv1.Example, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewUpdateAction(examplesResource, c.ns, example), &crv1.Example{})

	if obj == nil {
		return nil, err
	}
	return obj.(*crv1.Example), err
}
177705
func (job *AnalyzeJob) Update(rowCount int64) {
	now := time.Now()
	job.Mutex.Lock()
	job.RowCount += rowCount
	job.updateTime = now
	job.Mutex.Unlock()
}
399409
func (r *Env) Update(op lmdb.TxnOp) error {
	return r.runHandler(false, func() error { return r.Env.Update(op) }, r.Handlers)
}
1247781
func Update(id string, params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) {
	return getC().Update(id, params)
}
874982
func (s *SourcesStore) Update(ctx context.Context, src chronograf.Source) error {
	return s.UpdateF(ctx, src)
}