// SetUpgradeMongoMode writes a value in the state server to be picked up
// by api servers to know that there is an upgrade ready to happen.
501834
func (st *State) SetUpgradeMongoMode(v mongo.Version) (UpgradeMongoParams, error) {
	currentInfo, err := st.ControllerInfo()
	if err != nil {
		return UpgradeMongoParams{}, errors.Annotate(err, "could not obtain current controller information")
	}
	result := UpgradeMongoParams{}
	machines := []*Machine{}
	for _, mID := range currentInfo.MachineIds {
		m, err := st.Machine(mID)
		if err != nil {
			return UpgradeMongoParams{}, errors.Annotate(err, "cannot change all the replicas")
		}
		isMaster, err := mongo.IsMaster(st.session, m)
		if err != nil {
			return UpgradeMongoParams{}, errors.Annotatef(err, "cannot determine if machine %q is master", mID)
		}
		paddr, err := m.PublicAddress()
		if err != nil {
			return UpgradeMongoParams{}, errors.Annotatef(err, "cannot obtain public address for machine: %v", m)
		}
		tag := m.Tag()
		mtag := tag.(names.MachineTag)
		member := HAMember{
			Tag:           mtag.Id(),
			PublicAddress: paddr,
			Series:        m.Series(),
		}
		if isMaster {
			result.Master = member
		} else {
			result.Members = append(result.Members, member)
		}
		machines = append(machines, m)
	}
	rsMembers, err := replicaset.CurrentMembers(st.session)
	if err != nil {
		return UpgradeMongoParams{}, errors.Annotate(err, "cannot obtain current replicaset members")
	}
	masterRs, err := replicaset.MasterHostPort(st.session)
	if err != nil {
		return UpgradeMongoParams{}, errors.Annotate(err, "cannot determine master on replicaset members")
	}
	for _, m := range rsMembers {
		if m.Address != masterRs {
			result.RsMembers = append(result.RsMembers, m)
		}
	}
	for _, m := range machines {
		if err := m.SetStopMongoUntilVersion(v); err != nil {
			return UpgradeMongoParams{}, errors.Annotate(err, "cannot trigger replica shutdown")
		}
	}
	return result, nil
}
810979
func (s *ModifyCacheClusterInput) SetAZMode(v string) *ModifyCacheClusterInput {
	s.AZMode = &v
	return s
}
574743
func (c *ConfigLocal) SetMode(mode InitMode) {
	c.lock.Lock()
	defer c.lock.Unlock()
	c.mode = mode
}
3666
func (s *DefaultRetention) SetMode(v string) *DefaultRetention {
	s.Mode = &v
	return s
}
1187391
func (s *AutomationExecution) SetMode(v string) *AutomationExecution {
	s.Mode = &v
	return s
}
242766
func PerformUpgrade(from version.Number, targets []Target, context Context) error {
	if hasStateTarget(targets) {
		ops := newStateUpgradeOpsIterator(from)
		if err := runUpgradeSteps(ops, targets, context.StateContext()); err != nil {
			return err
		}
	}
	ops := newUpgradeOpsIterator(from)
	if err := runUpgradeSteps(ops, targets, context.APIContext()); err != nil {
		return err
	}
	logger.Infof("All upgrade steps completed successfully")
	return nil
}
858863
func (m *Machine) setUpgradeSeriesInstanceStatus(usStatus model.UpgradeSeriesStatus) error {
	msg := "Running"
	if !noInstanceMessage.Contains(string(usStatus)) {
		msg = "Series upgrade: " + string(usStatus)
	}

	sInfo := status.StatusInfo{
		Status:  status.Running,
		Message: msg,
	}
	return errors.Trace(m.SetInstanceStatus(sInfo))
}
258711
func (o *Disk) SetMode(v *string) *Disk {
	if o.Mode = v; o.Mode == nil {
		o.nullFields = append(o.nullFields, "Mode")
	}
	return o
}
785758
func (opts *Options) SetMergeOperator(value MergeOperator) {
	if nmo, ok := value.(nativeMergeOperator); ok {
		opts.cmo = nmo.c
	} else {
		idx := registerMergeOperator(value)
		opts.cmo = C.gorocksdb_mergeoperator_create(C.uintptr_t(idx))
	}
	C.rocksdb_options_set_merge_operator(opts.c, opts.cmo)
}
695852
func (s *ImportDocumentationPartsInput) SetMode(v string) *ImportDocumentationPartsInput {
	s.Mode = &v
	return s
}
279734
func (s *Deinterlacer) SetMode(v string) *Deinterlacer {
	s.Mode = &v
	return s
}
1173101
func (s *Cluster) SetModifyStatus(v string) *Cluster {
	s.ModifyStatus = &v
	return s
}
129886
func (s *AutomationExecutionMetadata) SetMode(v string) *AutomationExecutionMetadata {
	s.Mode = &v
	return s
}
886955
func (s *MotionImageInserter) SetInsertionMode(v string) *MotionImageInserter {
	s.InsertionMode = &v
	return s
}
1348503
func (mr *MockUpgradeSeriesMachineMockRecorder) SetUpgradeSeriesStatus(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetUpgradeSeriesStatus", reflect.TypeOf((*MockUpgradeSeriesMachine)(nil).SetUpgradeSeriesStatus), arg0, arg1)
}
905837
func (m *InstallMode) Set(value string) error {
	val := InstallMode(value)
	if err := ValidateInstallMode(val); err != nil {
		return err
	}
	*m = val
	return nil
}
183120
func (s *UpgradeStepItem) SetUpgradeStep(v string) *UpgradeStepItem {
	s.UpgradeStep = &v
	return s
}