// Targets are the build time configured provisioners
176868
func (b *Resolver) Targets(ctx context.Context, log *logrus.Entry) []string {
	if build.ProvisionBrokerURLs != "" {
		return strings.Split(build.ProvisionBrokerURLs, ",")
	}

	return []string{}
}
962642
func (s *RegisterTargetsInput) SetTargets(v []*TargetDescription) *RegisterTargetsInput {
	s.Targets = v
	return s
}
761501
func (c *Client) ListTargets(ctx context.Context, filter influxdb.ScraperTargetFilter) (list []influxdb.ScraperTarget, err error) {
	list = make([]influxdb.ScraperTarget, 0)
	err = c.db.View(func(tx *bolt.Tx) (err error) {
		cur := tx.Bucket(scraperBucket).Cursor()
		for k, v := cur.First(); k != nil; k, v = cur.Next() {
			target := new(influxdb.ScraperTarget)
			if err = json.Unmarshal(v, target); err != nil {
				return err
			}
			if err != nil {
				return err
			}
			if filter.IDs != nil {
				if _, ok := filter.IDs[target.ID]; !ok {
					continue
				}
			}
			if filter.Name != nil && target.Name != *filter.Name {
				continue
			}
			if filter.Org != nil {
				o, err := c.findOrganizationByName(ctx, tx, *filter.Org)
				if err != nil {
					return err
				}
				if target.OrgID != o.ID {
					continue
				}
			}
			if filter.OrgID != nil {
				o, err := c.findOrganizationByID(ctx, tx, *filter.OrgID)
				if err != nil {
					return err
				}
				if target.OrgID != o.ID {
					continue
				}
			}
			list = append(list, *target)
		}
		return err
	})
	if err != nil {
		return nil, &influxdb.Error{
			Op:  getOp(influxdb.OpListTargets),
			Err: err,
		}
	}
	return list, err
}
840668
func WithTargets(targets ...fab.Peer) RequestOption {
	return func(ctx context.Client, o *requestOptions) error {

		// Validate targets
		for _, t := range targets {
			if t == nil {
				return errors.New("target is nil")
			}
		}

		o.Targets = targets
		return nil
	}
}
56160
func (client *Client) TargetCF(settings TargetSettings) (Warnings, error) {
	client.cloudControllerURL = settings.URL

	client.connection = cloudcontroller.NewConnection(cloudcontroller.Config{
		DialTimeout:       settings.DialTimeout,
		SkipSSLValidation: settings.SkipSSLValidation,
	})

	for _, wrapper := range client.wrappers {
		client.connection = wrapper.Wrap(client.connection)
	}

	apiInfo, resourceLinks, warnings, err := client.GetInfo()
	if err != nil {
		return warnings, err
	}

	client.Info = apiInfo

	resources := map[string]string{}
	for resource, link := range resourceLinks {
		resources[resource] = link.HREF
	}
	client.router = internal.NewRouter(internal.APIRoutes, resources)

	return warnings, nil
}
1256255
func (s *UpdateCrawlerInput) SetTargets(v *CrawlerTargets) *UpdateCrawlerInput {
	s.Targets = v
	return s
}
118939
func jobsToTargets(jobs []multiwatcher.MachineJob, isMaster bool) (targets []upgrades.Target) {
	if jobs == nil {
		return
	}
	for _, job := range jobs {
		switch job {
		case multiwatcher.JobManageModel:
			targets = append(targets, upgrades.Controller)
			if isMaster {
				targets = append(targets, upgrades.DatabaseMaster)
			}
		case multiwatcher.JobHostUnits:
			targets = append(targets, upgrades.HostMachine)
		}
	}
	return
}
815296
func (s *SendCommandInput) SetTargets(v []*Target) *SendCommandInput {
	s.Targets = v
	return s
}
951731
func (s *AssociationDescription) SetTargets(v []*Target) *AssociationDescription {
	s.Targets = v
	return s
}
1219902
func (s *Service) ListTargets(ctx context.Context, filter influxdb.ScraperTargetFilter) (list []influxdb.ScraperTarget, err error) {
	list = make([]influxdb.ScraperTarget, 0)
	s.scraperTargetKV.Range(func(_, v interface{}) bool {
		target, ok := v.(influxdb.ScraperTarget)
		if !ok {
			err = &influxdb.Error{
				Code: influxdb.EInvalid,
				Msg:  fmt.Sprintf("type %T is not a scraper target", v),
			}
			return false
		}
		if filter.IDs != nil {
			if _, ok := filter.IDs[target.ID]; !ok {
				return true
			}
		}
		if filter.Name != nil && target.Name != *filter.Name {
			return true
		}
		if filter.Org != nil {
			o, orgErr := s.findOrganizationByName(ctx, *filter.Org)
			if orgErr != nil {
				err = orgErr
				return false
			}
			if target.OrgID != o.ID {
				return true
			}
		}
		if filter.OrgID != nil {
			o, orgErr := s.FindOrganizationByID(ctx, *filter.OrgID)
			if orgErr != nil {
				err = orgErr
				return true
			}
			if target.OrgID != o.ID {
				return true
			}
		}
		list = append(list, target)
		return true
	})
	return list, err
}
853360
func (u *Update) Target(path string) *Update {
	u.TargetPath = path
	return u
}
818512
func (s *DeploymentInfo) SetTargetInstances(v *TargetInstances) *DeploymentInfo {
	s.TargetInstances = v
	return s
}
992828
func (s *CreateJobInput) SetTargets(v []*string) *CreateJobInput {
	s.Targets = v
	return s
}
21007
func (m ModuleInstance) TargetContains(other Targetable) bool {
	switch to := other.(type) {

	case ModuleInstance:
		if len(to) < len(m) {
			// Can't be contained if the path is shorter
			return false
		}
		// Other is contained if its steps match for the length of our own path.
		for i, ourStep := range m {
			otherStep := to[i]
			if ourStep != otherStep {
				return false
			}
		}
		// If we fall out here then the prefixed matched, so it's contained.
		return true

	case AbsResource:
		return m.TargetContains(to.Module)

	case AbsResourceInstance:
		return m.TargetContains(to.Module)

	default:
		return false
	}
}
861060
func (s *IndicesShrinkService) Target(target string) *IndicesShrinkService {
	s.target = target
	return s
}
4318
func (s *AutomationExecutionMetadata) SetTargets(v []*Target) *AutomationExecutionMetadata {
	s.Targets = v
	return s
}
417296
func (s *UpdateMaintenanceWindowTargetInput) SetTargets(v []*Target) *UpdateMaintenanceWindowTargetInput {
	s.Targets = v
	return s
}