// setGlobalRules installs the global rules
778959
func (i *Instance) setGlobalRules() error {

	cfg, err := i.newACLInfo(0, "", nil, 0)
	if err != nil {
		return err
	}

	tmpl := template.Must(template.New(globalRules).Funcs(template.FuncMap{
		"isLocalServer": func() bool {
			return i.mode == constants.LocalServer
		},
	}).Parse(globalRules))

	rules, err := extractRulesFromTemplate(tmpl, cfg)
	if err != nil {
		zap.L().Warn("unable to extract rules", zap.Error(err))
	}

	if err := i.processRulesFromList(rules, "Append"); err != nil {
		return fmt.Errorf("unable to install global rules:%s", err)
	}

	// nat rules cannot be templated, since they interfere with Docker.
	err = i.ipt.Insert(i.appProxyIPTableContext,
		ipTableSectionPreRouting, 1,
		"-p", "tcp",
		"-m", "addrtype", "--dst-type", "LOCAL",
		"-m", "set", "!", "--match-set", excludedNetworkSet, "src",
		"-j", natProxyInputChain)
	if err != nil {
		return fmt.Errorf("unable to add default allow for marked packets at net: %s", err)
	}

	err = i.ipt.Insert(i.appProxyIPTableContext,
		ipTableSectionOutput, 1,
		"-m", "set", "!", "--match-set", excludedNetworkSet, "dst",
		"-j", natProxyOutputChain)
	if err != nil {
		return fmt.Errorf("unable to add default allow for marked packets at net: %s", err)
	}

	return nil
}
1220115
func (s *DeleteGlobalClusterOutput) SetGlobalCluster(v *GlobalCluster) *DeleteGlobalClusterOutput {
	s.GlobalCluster = v
	return s
}
875972
func (s *UpdateTableInput) SetGlobalSecondaryIndexUpdates(v []*GlobalSecondaryIndexUpdate) *UpdateTableInput {
	s.GlobalSecondaryIndexUpdates = v
	return s
}
52218
func (gce *Cloud) SetProxyForGlobalForwardingRule(fw *compute.ForwardingRule, targetProxyLink string) error {
	op, err := gce.service.GlobalForwardingRules.SetTarget(gce.projectID, fw.Name, &compute.TargetReference{Target: targetProxyLink}).Do()
	if err != nil {
		return err
	}
	return gce.waitForGlobalOp(op)
}
311663
func setGlobalsFromContext(ctx *cli.Context) error {
	quiet := ctx.IsSet("quiet")
	debug := ctx.IsSet("debug")
	json := ctx.IsSet("json")
	noColor := ctx.IsSet("no-color")
	insecure := ctx.IsSet("insecure")
	setGlobals(quiet, debug, json, noColor, insecure)
	return nil
}
917599
func (s *CreateIpGroupInput) SetUserRules(v []*IpRuleItem) *CreateIpGroupInput {
	s.UserRules = v
	return s
}
24136
func (s *UpdatePatchBaselineInput) SetGlobalFilters(v *PatchFilterGroup) *UpdatePatchBaselineInput {
	s.GlobalFilters = v
	return s
}
1244624
func (s *ListResolverRulesOutput) SetResolverRules(v []*ResolverRule) *ListResolverRulesOutput {
	s.ResolverRules = v
	return s
}
613261
func SetGlobals(reg template.Registry, globals data.Map) error {
	for _, t := range reg.Templates {
		if err := SetNodeGlobals(t.Node, globals); err != nil {
			return fmt.Errorf("template %v: %v", t.Node.Name, err)
		}
	}
	return nil
}
1325653
func (s *UpdateLicenseConfigurationInput) SetLicenseRules(v []*string) *UpdateLicenseConfigurationInput {
	s.LicenseRules = v
	return s
}
336658
func (s *GlobalTableDescription) SetGlobalTableArn(v string) *GlobalTableDescription {
	s.GlobalTableArn = &v
	return s
}
1057012
func (s *ListRulesOutput) SetRules(v []*RuleSummary) *ListRulesOutput {
	s.Rules = v
	return s
}
496509
func (s *QorSEOSetting) SetGlobalSetting(globalSetting map[string]string) {
	s.Setting.GlobalSetting = globalSetting
}
837844
func (s *GlobalTableDescription) SetGlobalTableName(v string) *GlobalTableDescription {
	s.GlobalTableName = &v
	return s
}
81752
func (tsv *TabletServer) SetQueryRules(ruleSource string, qrs *rules.Rules) error {
	err := tsv.qe.queryRuleSources.SetRules(ruleSource, qrs)
	if err != nil {
		return err
	}
	tsv.qe.ClearQueryPlanCache()
	return nil
}
626457
func (s *CreateDevicePoolInput) SetRules(v []*Rule) *CreateDevicePoolInput {
	s.Rules = v
	return s
}
151900
func (s *WebACL) SetRules(v []*ActivatedRule) *WebACL {
	s.Rules = v
	return s
}