本文整理匯總了Java中mesosphere.marathon.client.model.v2.GetAppTasksResponse類的典型用法代碼示例。如果您正苦於以下問題:Java GetAppTasksResponse類的具體用法?Java GetAppTasksResponse怎麽用?Java GetAppTasksResponse使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
GetAppTasksResponse類屬於mesosphere.marathon.client.model.v2包,在下文中一共展示了GetAppTasksResponse類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getAppTasks
import mesosphere.marathon.client.model.v2.GetAppTasksResponse; //導入依賴的package包/類
private void getAppTasks(Marathon marathon, App app) throws MojoExecutionException {
try {
final GetAppTasksResponse getAppTasksResponse = marathon.getAppTasks(app.getId());
int taskCount = 0;
for (final Task task : getAppTasksResponse.getTasks()) {
final String hostPropertyName = propertyPrefix + "host" + taskCount;
project.getProperties().put(hostPropertyName, task.getHost());
getLog().info("Setting " + hostPropertyName + " = " + task.getHost());
int portCount = 0;
for (final Integer port : task.getPorts()) {
final String portPropertyName = propertyPrefix + "port"
+ taskCount + "-" + portCount;
project.getProperties().put(portPropertyName, String.valueOf(port));
getLog().info("Setting " + portPropertyName + " = " + port);
portCount++;
}
taskCount++;
}
} catch (Exception deleteAppException) {
throw new MojoExecutionException("Failed to get tasks for Marathon instance "
+ marathonHost, deleteAppException);
}
}
示例2: getAppTasks
import mesosphere.marathon.client.model.v2.GetAppTasksResponse; //導入依賴的package包/類
@RequestLine("GET /v2/apps/{id}/tasks")
@Headers(HeaderUtils.MARATHON_API_SOURCE_HEADER)
GetAppTasksResponse getAppTasks(@Param("id") String id) throws MarathonException;