// ServiceCount return number of services.
177317
func ServiceCount() (count int, err error) {
	err = mgr.Do(func(ctx context.Context, cli *client.Client) (err error) {
		var services []swarm.Service
		if services, err = cli.ServiceList(ctx, types.ServiceListOptions{}); err == nil {
			count = len(services)
		}
		return
	})
	return
}
418287
func (r *RestartTracker) GetCount() int {
	r.lock.Lock()
	defer r.lock.Unlock()
	return r.count
}
169195
func newServiceAccounts(c *Client, ns string) ServiceAccountsInterface {
	return &serviceAccounts{
		client:    c,
		namespace: ns,
	}
}
196656
func (self *realKubeFramework) CreateServiceAccount(sa *v1.ServiceAccount) error {
	_, err := self.kubeClient.CoreV1().ServiceAccounts(sa.Namespace).Create(sa)
	return err
}
912508
func (c *ServicedCli) serviceActions(id string) (data []string) {
	svc, err := c.driver.GetService(id)
	if err != nil || svc == nil {
		c.exit(1)
		return
	}

	data = make([]string, len(svc.Actions))
	i := 0
	for a := range svc.Actions {
		data[i] = a
		i++
	}

	return
}
215854
func Service() (c *ServiceController) {
	return &ServiceController{
		List:       serviceList,
		Detail:     serviceDetail,
		Raw:        serviceRaw,
		Logs:       serviceLogs,
		FetchLogs:  serviceFetchLogs,
		Delete:     serviceDelete,
		New:        serviceNew,
		Create:     serviceCreate,
		Edit:       serviceEdit,
		Update:     serviceUpdate,
		Scale:      serviceScale,
		Rollback:   serviceRollback,
		Restart:    serviceRestart,
		PermEdit:   servicePermEdit,
		PermUpdate: permUpdate("service", "name"),
		Stats:      serviceStats,
	}
}
699174
func (s *server) MemberCount() int {
	s.mutex.RLock()
	defer s.mutex.RUnlock()
	return len(s.peers) + 1
}
1292446
func (t *TrafficReferrer) GetCount() int {
	if t == nil || t.Count == nil {
		return 0
	}
	return *t.Count
}
886472
func (f *SeriesFile) SeriesCount() uint64 {
	var n uint64
	for _, p := range f.partitions {
		n += p.SeriesCount()
	}
	return n
}
912723
func (c *UsergroupsCreateCall) IncludeCount(includeCount bool) *UsergroupsCreateCall {
	c.includeCount = includeCount
	return c
}
905441
func NewCountService(client *Client) *CountService {
	return &CountService{
		client: client,
		index:  make([]string, 0),
		typ:    make([]string, 0),
	}
}
663293
func (c *Context) Service() *Service {
	s, _ := serviceByName(c.ServiceName)
	return s
}
216681
func (c *UsergroupsDisableCall) IncludeCount(includeCount bool) *UsergroupsDisableCall {
	c.includeCount = includeCount
	return c
}
440863
func ValidateServiceAccount(serviceAccount *core.ServiceAccount) field.ErrorList {
	allErrs := ValidateObjectMeta(&serviceAccount.ObjectMeta, true, ValidateServiceAccountName, field.NewPath("metadata"))
	return allErrs
}
1016856
func NewCmdServiceAccount(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command {
	o := NewSetServiceAccountOptions(streams)

	cmd := &cobra.Command{
		Use:                   "serviceaccount (-f FILENAME | TYPE NAME) SERVICE_ACCOUNT",
		DisableFlagsInUseLine: true,
		Aliases:               []string{"sa"},
		Short:                 i18n.T("Update ServiceAccount of a resource"),
		Long:                  serviceaccountLong,
		Example:               serviceaccountExample,
		Run: func(cmd *cobra.Command, args []string) {
			cmdutil.CheckErr(o.Complete(f, cmd, args))
			cmdutil.CheckErr(o.Run())
		},
	}

	o.PrintFlags.AddFlags(cmd)
	o.RecordFlags.AddFlags(cmd)

	usage := "identifying the resource to get from a server."
	cmdutil.AddFilenameOptionFlags(cmd, &o.fileNameOptions, usage)
	cmd.Flags().BoolVar(&o.all, "all", o.all, "Select all resources, including uninitialized ones, in the namespace of the specified resource types")
	cmd.Flags().BoolVar(&o.local, "local", o.local, "If true, set serviceaccount will NOT contact api-server but run locally.")
	cmdutil.AddDryRunFlag(cmd)
	cmdutil.AddIncludeUninitializedFlag(cmd)
	return cmd
}
161991
func (t *TrafficPath) GetCount() int {
	if t == nil || t.Count == nil {
		return 0
	}
	return *t.Count
}
948689
func (c *gceCloudImplementation) ServiceAccount() (string, error) {
	if c.projectInfo == nil {
		// Find the project info from the compute API, which includes the default service account
		glog.V(2).Infof("fetching project %q from compute API", c.project)
		p, err := c.compute.Projects.Get(c.project).Do()
		if err != nil {
			return "", fmt.Errorf("error fetching info for project %q: %v", c.project, err)
		}

		c.projectInfo = p
	}

	if c.projectInfo.DefaultServiceAccount == "" {
		return "", fmt.Errorf("compute project %q did not have DefaultServiceAccount", c.project)
	}

	return c.projectInfo.DefaultServiceAccount, nil
}