// L4ServiceGroups retrieves the list of child L4ServiceGroups of the L4Service
6754
func (o *L4Service) L4ServiceGroups(info *bambou.FetchingInfo) (L4ServiceGroupsList, *bambou.Error) {

	var list L4ServiceGroupsList
	err := bambou.CurrentSession().FetchChildren(o, L4ServiceGroupIdentity, &list, info)
	return list, err
}
802641
func (o *Enterprise) CreateL4ServiceGroup(child *L4ServiceGroup) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
940187
func (s *AutoScaleService) ListAutoScaleVmGroups(p *ListAutoScaleVmGroupsParams) (*ListAutoScaleVmGroupsResponse, error) {
	resp, err := s.cs.newRequest("listAutoScaleVmGroups", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ListAutoScaleVmGroupsResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
377572
func (b *Broker) ListGroups(request *ListGroupsRequest) (*ListGroupsResponse, error) {
	response := new(ListGroupsResponse)

	err := b.sendAndReceive(request, response)
	if err != nil {
		return nil, err
	}

	return response, nil
}
334472
func (d *CachedDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) {
	filename := filepath.Join(d.cacheDirectory, "servergroups.json")
	cachedBytes, err := d.getCachedFile(filename)
	// don't fail on errors, we either don't have a file or won't be able to run the cached check. Either way we can fallback.
	if err == nil {
		cachedGroups := &metav1.APIGroupList{}
		if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), cachedBytes, cachedGroups); err == nil {
			klog.V(10).Infof("returning cached discovery info from %v", filename)
			return cachedGroups, nil
		}
	}

	liveGroups, err := d.delegate.ServerGroups()
	if err != nil {
		klog.V(3).Infof("skipped caching discovery info due to %v", err)
		return liveGroups, err
	}
	if liveGroups == nil || len(liveGroups.Groups) == 0 {
		klog.V(3).Infof("skipped caching discovery info, no groups found")
		return liveGroups, err
	}

	if err := d.writeCachedFile(filename, liveGroups); err != nil {
		klog.V(1).Infof("failed to write cache to %v due to %v", filename, err)
	}

	return liveGroups, nil
}
316878
func (o *L4ServiceGroup) AssignL4Services(children L4ServicesList) *bambou.Error {

	list := []bambou.Identifiable{}
	for _, c := range children {
		list = append(list, c)
	}

	return bambou.CurrentSession().AssignChildren(o, list, L4ServiceIdentity)
}
1215825
func GetGroups() (*Groups, error) {
	groups := NewGroups()
	if err := groups.GetGroups(); err != nil {
		return nil, err
	}

	return groups, nil
}
757481
func (c *awsCloudImplementation) GetCloudGroups(cluster *kops.Cluster, instancegroups []*kops.InstanceGroup, warnUnmatched bool, nodes []v1.Node) (map[string]*cloudinstances.CloudInstanceGroup, error) {
	if c.spotinst != nil {
		return spotinst.GetCloudGroups(c.spotinst, cluster,
			instancegroups, warnUnmatched, nodes)
	}

	return getCloudGroups(c, cluster, instancegroups, warnUnmatched, nodes)
}
11463
func AllServiceGroups(g osgraph.Graph, excludeNodeIDs IntSet) ([]ServiceGroup, IntSet) {
	covered := IntSet{}
	services := []ServiceGroup{}

	for _, uncastNode := range g.NodesByKind(kubegraph.ServiceNodeKind) {
		if excludeNodeIDs.Has(uncastNode.ID()) {
			continue
		}

		service, covers := NewServiceGroup(g, uncastNode.(*kubegraph.ServiceNode))
		covered.Insert(covers.List()...)
		services = append(services, service)
	}

	sort.Sort(ServiceGroupByObjectMeta(services))
	return services, covered
}
993818
func (o *L2Domain) Groups(info *bambou.FetchingInfo) (GroupsList, *bambou.Error) {

	var list GroupsList
	err := bambou.CurrentSession().FetchChildren(o, GroupIdentity, &list, info)
	return list, err
}
364107
func GroupMembers(ctx context.Context, groupName string) ([]string, error) {
	return groupServiceInstance.GroupMembers(ctx, groupName)
}
538880
func (c *Client) ListServices(i *ListServicesInput) ([]*Service, error) {
	resp, err := c.Get("/service", nil)
	if err != nil {
		return nil, err
	}

	var s []*Service
	if err := decodeJSON(&s, resp.Body); err != nil {
		return nil, err
	}
	sort.Stable(servicesByName(s))
	return s, nil
}
374162
func (gce *Cloud) ListInstanceGroups(zone string) (*compute.InstanceGroupList, error) {
	// TODO: use PageToken to list all not just the first 500
	return gce.service.InstanceGroups.List(gce.projectID, zone).Do()
}
615780
func (o *L2Domain) PolicyGroups(info *bambou.FetchingInfo) (PolicyGroupsList, *bambou.Error) {

	var list PolicyGroupsList
	err := bambou.CurrentSession().FetchChildren(o, PolicyGroupIdentity, &list, info)
	return list, err
}
201308
func GroupCountMembers(ctx context.Context, groupName string) (int, error) {
	return groupServiceInstance.GroupCountMembers(ctx, groupName)
}
921703
func listServices(scmgr WinServiceManager, userServices []string) ([]string, error) {
	if len(userServices) != 0 {
		return userServices, nil
	}

	names, err := scmgr.ListServices()
	if err != nil {
		return nil, fmt.Errorf("Could not list services: %s", err)
	}
	return names, nil
}
259440
func (a *aks) listResourceGroups(clusters []cluster) ([]resourceGroupDetails, error) {
	usedRG := set.Strings{}
	for _, c := range clusters {
		usedRG.Add(c.resourceGroup)
	}

	// It seems that any resource group that has a non-null 'managedBy' is a
	// generated RG i.e. via the creation of the cluster itself.
	cmd := []string{
		"az", "group", "list",
		"--output", "json",
		"--query", `"[?properties.provisioningState=='Succeeded']"`,
	}
	result, err := runCommand(a, cmd, "")
	err = collapseRunError(result, err)
	if err != nil {
		return nil, errors.Trace(err)
	}
	var groups []resourceGroupDetails
	if err := json.Unmarshal(result.Stdout, &groups); err != nil {
		return nil, errors.Trace(err)
	}

	var filteredGroups []resourceGroupDetails
	for _, group := range groups {
		if usedRG.Contains(group.Name) {
			filteredGroups = append(filteredGroups, group)
		}
	}

	return filteredGroups, nil
}