mesosphere.marathon.client.model.v2.App Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of marathon-client Show documentation
Show all versions of marathon-client Show documentation
A Java API client for Mesosphere's Marathon.
package mesosphere.marathon.client.model.v2;
import java.util.*;
import mesosphere.client.common.ModelUtils;
public class App {
public App() {
}
public static class Deployment {
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Override
public String toString() {
return ModelUtils.toString(this);
}
}
private String id;
private String cmd;
private List args;
private String user;
private Integer instances;
private Double cpus;
private Double mem;
private Double disk;
private Double gpus;
private Collection uris;
private List> constraints;
private Collection acceptedResourceRoles;
private Container container;
private Map env;
private Map labels;
private AppIpAddress ipAddress;
private String version;
private Residency residency;
private Integer taskKillGracePeriodSeconds;
private Map secrets;
private String executor;
private List fetch;
private List storeUrls;
private List ports;
private List portDefinitions;
private Boolean requirePorts;
private Collection dependencies;
private Integer backoffSeconds;
private Double backoffFactor;
private Integer maxLaunchDelaySeconds;
private Collection tasks;
private AppVersionInfo versionInfo;
private Integer tasksStaged;
private Integer tasksRunning;
private Integer tasksHealthy;
private Integer tasksUnhealthy;
private List healthChecks;
private List readinessChecks;
private UpgradeStrategy upgradeStrategy;
private List deployments;
private TaskFailure lastTaskFailure;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCmd() {
return cmd;
}
public void setCmd(String cmd) {
this.cmd = cmd;
}
public List getArgs() {
return args;
}
public void setArgs(final List args) {
this.args = args;
}
public String getUser() {
return user;
}
public void setUser(final String user) {
this.user = user;
}
public Integer getInstances() {
return instances;
}
public void setInstances(Integer instances) {
this.instances = instances;
}
public Double getCpus() {
return cpus;
}
public void setCpus(Double cpus) {
this.cpus = cpus;
}
public Double getMem() {
return mem;
}
public void setMem(Double mem) {
this.mem = mem;
}
public Double getDisk() {
return disk;
}
public void setDisk(final Double disk) {
this.disk = disk;
}
public Double getGpus() {
return gpus;
}
public void setGpus(final Double gpus) {
this.gpus = gpus;
}
public Collection getUris() {
return uris;
}
public void setUris(Collection uris) {
this.uris = uris;
}
public List> getConstraints() {
return constraints;
}
public void setConstraints(List> constraints) {
this.constraints = constraints;
}
public void addConstraint(String attribute, String operator, String value) {
if (this.constraints == null) {
this.constraints = new ArrayList>();
}
List constraint = new ArrayList(3);
constraint.add(attribute == null ? "" : attribute);
constraint.add(operator == null ? "" : operator);
constraint.add(value == null ? "" : value);
this.constraints.add(constraint);
}
public Collection getAcceptedResourceRoles() {
return acceptedResourceRoles;
}
public void setAcceptedResourceRoles(Collection acceptedResourceRoles) {
this.acceptedResourceRoles = acceptedResourceRoles;
}
public void addAcceptedResourceRole(String role) {
if (this.acceptedResourceRoles == null) {
this.acceptedResourceRoles = new HashSet();
}
this.acceptedResourceRoles.add(role);
}
public Container getContainer() {
return container;
}
public void setContainer(Container container) {
this.container = container;
}
public Map getEnv() {
return env;
}
public void setEnv(Map env) {
this.env = env;
}
public Map getLabels() {
return labels;
}
public void setLabels(Map labels) {
this.labels = labels;
}
public AppIpAddress getIpAddress() {
return ipAddress;
}
public void setIpAddress(final AppIpAddress ipAddress) {
this.ipAddress = ipAddress;
}
public String getVersion() {
return version;
}
public void setVersion(final String version) {
this.version = version;
}
public Residency getResidency() {
return residency;
}
public void setResidency(final Residency residency) {
this.residency = residency;
}
public Integer getTaskKillGracePeriodSeconds() {
return taskKillGracePeriodSeconds;
}
public void setTaskKillGracePeriodSeconds(final Integer taskKillGracePeriodSeconds) {
this.taskKillGracePeriodSeconds = taskKillGracePeriodSeconds;
}
public Map getSecrets() {
return secrets;
}
public void setSecrets(final Map secrets) {
this.secrets = secrets;
}
public void addLabel(final String key, final String value) {
if (key != null && key.trim().length() > 0) {
if (this.labels == null) {
this.labels = new HashMap();
}
this.labels.put(key, value == null ? "" : value);
}
}
public String getExecutor() {
return executor;
}
public void setExecutor(String executor) {
this.executor = executor;
}
public List getFetch() {
return fetch;
}
public void setFetch(final List fetch) {
this.fetch = fetch;
}
public List getStoreUrls() {
return storeUrls;
}
public void setStoreUrls(final List storeUrls) {
this.storeUrls = storeUrls;
}
public List getPorts() {
return ports;
}
public void setPorts(List ports) {
this.ports = ports;
}
public List getPortDefinitions() {
return portDefinitions;
}
public void setPortDefinitions(List portDefinitions) {
this.portDefinitions = portDefinitions;
}
public Boolean getRequirePorts() {
return requirePorts;
}
public void setRequirePorts(final Boolean requirePorts) {
this.requirePorts = requirePorts;
}
public Collection getDependencies() {
return dependencies;
}
public void setDependencies(final Collection dependencies) {
this.dependencies = dependencies;
}
public void addDependency(final String dependency) {
if (dependency != null && dependency.trim().length() > 0) {
if (this.dependencies == null) {
this.dependencies = new HashSet();
}
this.dependencies.add(dependency);
}
}
public Integer getBackoffSeconds() {
return backoffSeconds;
}
public void setBackoffSeconds(final Integer backoffSeconds) {
this.backoffSeconds = backoffSeconds;
}
public Double getBackoffFactor() {
return backoffFactor;
}
public void setBackoffFactor(final Double backoffFactor) {
this.backoffFactor = backoffFactor;
}
public Integer getMaxLaunchDelaySeconds() {
return maxLaunchDelaySeconds;
}
public void setMaxLaunchDelaySeconds(final Integer maxLaunchDelaySeconds) {
this.maxLaunchDelaySeconds = maxLaunchDelaySeconds;
}
public void addUri(String uri) {
if (this.uris == null) {
this.uris = new ArrayList();
}
this.uris.add(uri);
}
public void addPort(int port) {
if (this.ports == null) {
this.ports = new ArrayList();
}
this.ports.add(port);
}
public Collection getTasks() {
return tasks;
}
public void setTasks(Collection tasks) {
this.tasks = tasks;
}
public AppVersionInfo getVersionInfo() {
return versionInfo;
}
public void setVersionInfo(final AppVersionInfo versionInfo) {
this.versionInfo = versionInfo;
}
public Integer getTasksStaged() {
return tasksStaged;
}
public void setTasksStaged(Integer tasksStaged) {
this.tasksStaged = tasksStaged;
}
public Integer getTasksRunning() {
return tasksRunning;
}
public void setTasksRunning(Integer tasksRunning) {
this.tasksRunning = tasksRunning;
}
public Integer getTasksHealthy() {
return tasksHealthy;
}
public void setTasksHealthy(Integer tasksHealthy) {
this.tasksHealthy = tasksHealthy;
}
public Integer getTasksUnhealthy() {
return tasksUnhealthy;
}
public void setTasksUnhealthy(Integer tasksUnhealthy) {
this.tasksUnhealthy = tasksUnhealthy;
}
public List getHealthChecks() {
return healthChecks;
}
public void setHealthChecks(List healthChecks) {
this.healthChecks = healthChecks;
}
public List getReadinessChecks() {
return readinessChecks;
}
public void setReadinessChecks(final List readinessChecks) {
this.readinessChecks = readinessChecks;
}
public UpgradeStrategy getUpgradeStrategy() {
return upgradeStrategy;
}
public List getDeployments() {
return deployments;
}
public void setDeployments(List deployments) {
this.deployments = deployments;
}
public void setUpgradeStrategy(final UpgradeStrategy upgradeStrategy) {
this.upgradeStrategy = upgradeStrategy;
}
public TaskFailure getLastTaskFailure() {
return lastTaskFailure;
}
public void setLastTaskFailure(TaskFailure lastTaskFailure) {
this.lastTaskFailure = lastTaskFailure;
}
@Override
public String toString() {
return ModelUtils.toString(this);
}
}