Exemplo n.º 1
0
Arquivo: api.go Projeto: noqcks/docker
func buildSandboxResource(sb libnetwork.Sandbox) *sandboxResource {
	r := &sandboxResource{}
	if sb != nil {
		r.ID = sb.ID()
		r.Key = sb.Key()
		r.ContainerID = sb.ContainerID()
	}
	return r
}
Exemplo n.º 2
0
// Join creates a new sandbox for the given container ID and populates the
// network resources allocated for the endpoint and joins the sandbox to
// the endpoint. It returns the sandbox key to the caller
func (e *remoteEndpoint) Join(sandbox libnetwork.Sandbox, options ...libnetwork.EndpointOption) error {
	url := path.Join("/networks", e.networkID, "endpoints", e.er.ID, "containers")

	//TODO: process options somehow
	join := endpointJoin{
		SandboxID: sandbox.ID(),
	}

	sk := ""
	return e.rc.httpPost(url, join, &sk)
}
Exemplo n.º 3
0
func (container *Container) updateSandboxNetworkSettings(sb libnetwork.Sandbox) error {
	container.NetworkSettings.SandboxID = sb.ID()
	container.NetworkSettings.SandboxKey = sb.Key()
	return nil
}