// ContainerNames returns a slice of names of containers in this account.
352920
func (c *Connection) ContainerNames(opts *ContainersOpts) ([]string, error) {
	v, h := opts.parse()
	resp, _, err := c.storage(RequestOpts{
		Operation:  "GET",
		Parameters: v,
		ErrorMap:   ContainerErrorMap,
		Headers:    h,
	})
	if err != nil {
		return nil, err
	}
	lines, err := readLines(resp)
	return lines, err
}
237510
func (db *Database) CollectionNames() (names []string, err error) {
	c := len(db.Name) + 1
	iter := db.C("system.namespaces").Find(nil).Iter()
	var result *struct{ Name string }
	for iter.Next(&result) {
		if strings.Index(result.Name, "$") < 0 || strings.Index(result.Name, ".oplog.$") >= 0 {
			names = append(names, result.Name[c:])
		}
	}
	if err := iter.Close(); err != nil {
		return nil, err
	}
	sort.Strings(names)
	return names, nil
}
9718
func (c *ContainerServer) ContainerRename(container, name string) error {
	ctr, err := c.LookupContainer(container)
	if err != nil {
		return err
	}

	oldName := ctr.Name()
	_, err = c.ReserveContainerName(ctr.ID(), name)
	if err != nil {
		return err
	}
	defer func() {
		if err != nil {
			c.ReleaseContainerName(name)
		} else {
			c.ReleaseContainerName(oldName)
		}
	}()

	// Update state.json
	if err = c.updateStateName(ctr, name); err != nil {
		return err
	}

	// Update config.json
	configRuntimePath := filepath.Join(ctr.BundlePath(), configFile)
	if err = updateConfigName(configRuntimePath, name); err != nil {
		return err
	}
	configStoragePath := filepath.Join(ctr.Dir(), configFile)
	if err = updateConfigName(configStoragePath, name); err != nil {
		return err
	}

	// Update containers.json
	if err = c.store.SetNames(ctr.ID(), []string{name}); err != nil {
		return err
	}
	return nil
}
406140
func (e *EmptyService) Containers(ctx context.Context) ([]Container, error) {
	return []Container{}, nil
}
198506
func layoutContainerCells(containers []api.Container) (names string, images string) {
	var namesBuffer bytes.Buffer
	var imagesBuffer bytes.Buffer

	for i, container := range containers {
		namesBuffer.WriteString(container.Name)
		imagesBuffer.WriteString(container.Image)
		if i != len(containers)-1 {
			namesBuffer.WriteString(",")
			imagesBuffer.WriteString(",")
		}
	}
	return namesBuffer.String(), imagesBuffer.String()
}
587138
func (s *Store) ServiceNames() []string {
	s.mu.RLock()
	defer s.mu.RUnlock()

	var a []string
	for name := range s.data.Services {
		a = append(a, name)
	}
	sort.Strings(a)

	return a
}
315735
func (r *RegexpNamer) ServiceName(container *docker.APIContainers) string {
	if container == nil {
		log.Warn("ServiceName() called with nil service passed!")
		return ""
	}

	if r.expression == nil {
		log.Errorf("Invalid regex can't match using: %s", r.ServiceNameMatch)
		return container.Image
	}

	var svcName string

	toMatch := []byte(container.Names[0])
	matches := r.expression.FindSubmatch(toMatch)
	if len(matches) < 1 {
		svcName = container.Image
	} else {
		svcName = string(matches[1])
	}

	return svcName
}
1068069
func (dh *Client) Containers() (containers []*docker.Container, e error) {
	return dh.ListContainers(nil)
}
1023074
func (r *runtimeOCI) ContainerStats(c *Container) (*ContainerStats, error) {
	c.opLock.Lock()
	defer c.opLock.Unlock()

	return r.containerStats(c)
}
933416
func (daemon *Daemon) Containers(config *types.ContainerListOptions) ([]*types.Container, error) {
	return daemon.reduceContainers(config, daemon.refreshImage)
}
1291692
func ResourceNames(resources corev1.ResourceList) []corev1.ResourceName {
	result := []corev1.ResourceName{}
	for resourceName := range resources {
		result = append(result, resourceName)
	}
	return result
}
347119
func (r *ClusterVFS) listNames() ([]string, error) {
	paths, err := r.basePath.ReadTree()
	if err != nil {
		return nil, fmt.Errorf("error reading state store: %v", err)
	}

	var keys []string
	for _, p := range paths {
		relativePath, err := vfs.RelativePath(r.basePath, p)
		if err != nil {
			return nil, err
		}
		if !strings.HasSuffix(relativePath, "/config") {
			continue
		}
		key := strings.TrimSuffix(relativePath, "/config")
		keys = append(keys, key)
	}
	return keys, nil
}
1042841
func (u *Unit) containerAddress() (network.Address, error) {
	containerInfo, err := u.cloudContainer()
	if errors.IsNotFound(err) {
		return network.Address{}, network.NoAddressError("container")
	}
	if err != nil {
		return network.Address{}, errors.Trace(err)
	}
	addr := containerInfo.Address
	if addr == nil {
		return network.Address{}, network.NoAddressError("container")
	}
	return addr.networkAddress(), nil
}
297384
func (s *Server) ServiceNames() []string {
	s.mu.Lock()
	defer s.mu.Unlock()

	names := make([]string, 0, len(s.services))
	for name := range s.services {
		names = append(names, name)
	}
	sort.Strings(names)
	return names
}
304859
func (s *Server) GetContainerProfiles(name string) ([]string, error) {
	container, _, err := s.GetContainer(name)
	if err != nil {
		return []string{}, errors.Trace(err)
	}
	return container.Profiles, nil
}
258664
func (pdev podDevices) containerDevices(podUID, contName, resource string) sets.String {
	if _, podExists := pdev[podUID]; !podExists {
		return nil
	}
	if _, contExists := pdev[podUID][contName]; !contExists {
		return nil
	}
	devs, resourceExists := pdev[podUID][contName][resource]
	if !resourceExists {
		return nil
	}
	return devs.deviceIds
}
1041762
func (m *MockCommonAPIClient) ContainerRename(ctx context.Context, container, newContainerName string) error {
	ret := m.ctrl.Call(m, "ContainerRename", ctx, container, newContainerName)
	ret0, _ := ret[0].(error)
	return ret0
}