agent/handlers/v2/response.go
func NewContainerResponse(containerID string,
	state dockerstate.TaskEngineState) (*ContainerResponse, error) {
	dockerContainer, ok := state.ContainerByID(containerID)
	if !ok {
		return nil, errors.Errorf(
			"v2 container response: unable to find container '%s'", containerID)
	}
	task, ok := state.TaskByID(containerID)
	if !ok {
		return nil, errors.Errorf(
			"v2 container response: unable to find task for container '%s'", containerID)
	}

	resp := newContainerResponse(dockerContainer, task.GetTaskENI(), state)
	return &resp, nil
}
func NewContainerResponse(containerID string,
	state dockerstate.TaskEngineState) (*ContainerResponse, error) {
	dockerContainer, ok := state.ContainerByID(containerID)
	if !ok {
		return nil, errors.Errorf(
			"v2 container response: unable to find container '%s'", containerID)
	}
	task, ok := state.TaskByID(containerID)
	if !ok {
		return nil, errors.Errorf(
			"v2 container response: unable to find task for container '%s'", containerID)
	}

	resp := newContainerResponse(dockerContainer, task.GetTaskENI(), state)
	return &resp, nil
}
func NewContainerResponse ( containerID string , state dockerstate . TaskEngineState ) ( * ContainerResponse , error ) { dockerContainer , ok := state . ContainerByID ( containerID ) if ! ok { return nil , errors . Errorf ( " " , containerID ) } task , ok := state . TaskByID ( containerID ) if ! ok { return nil , errors . Errorf ( " " , containerID ) } resp := newContainerResponse ( dockerContainer , task . GetTaskENI ( ) , state ) return & resp , nil }
// NewContainerResponse creates a new container response based on container id
NewContainerResponse creates a new container response based on container id