mesosphere / marathon

Deploy and manage containers (including Docker) on top of Apache Mesos at scale.
https://mesosphere.github.io/marathon/
Apache License 2.0
4.07k stars 845 forks source link

How can marathon v1.1.2 “/v2/apps/{app_id}/tasks” return container name? #4692

Closed JerryDog closed 7 years ago

JerryDog commented 7 years ago

Marathon Rest API "/v2/apps/{app_id}/tasks" return without docker container name.

I saw formats in src/main/scala/mesosphere/marathon/api/v2/json/Formats.scala.

Like:

val base = Json.obj( "id" -> task.taskId, "slaveId" -> task.agentInfo.agentId, "host" -> task.agentInfo.host, "state" -> task.mesosStatus.fold(mesos.TaskState.TASKSTAGING)(.getState) )

I want to add an op like this:

val base = Json.obj( "id" -> task.taskId, "containerName": task.containerName. "slaveId" -> task.agentInfo.agentId, "host" -> task.agentInfo.host, "state" -> task.mesosStatus.fold(mesos.TaskState.TASKSTAGING)(.getState) )

Or tell me where the code path marathon get mesos returned data and parsing them.

jasongilanfarr commented 7 years ago

If I am not mistaken, the container name is not available from the mesos Task message.

meichstedt commented 7 years ago

Note: This issue has been migrated to https://jira.mesosphere.com/browse/MARATHON-2095. For more information see https://groups.google.com/forum/#!topic/marathon-framework/khtvf-ifnp8.