Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to force delete a group and add ability to add app depenedencies #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/main/java/mesosphere/marathon/client/Marathon.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ Result updateGroup(@Param("id") String id, Group group, @Param("force") boolean
@RequestLine("DELETE /v2/groups/{id}")
Result deleteGroup(@Param("id") String id) throws MarathonException;

@RequestLine("DELETE /v2/groups/{id}?force={force}")
Result deleteGroup(@Param("id") String id, @Param("force") boolean force) throws MarathonException;

@RequestLine("GET /v2/groups/{id}")
Group getGroup(@Param("id") String id) throws MarathonException;

Expand All @@ -78,10 +81,10 @@ Result updateGroup(@Param("id") String id, Group group, @Param("force") boolean
// Deployments
@RequestLine("GET /v2/deployments")
List<Deployment> getDeployments();

@RequestLine("DELETE /v2/deployments/{deploymentId}")
void cancelDeploymentAndRollback(@Param("deploymentId") String id);

@RequestLine("DELETE /v2/deployments/{deploymentId}?force=true")
void cancelDeployment(@Param("deploymentId") String id);

Expand Down
11 changes: 10 additions & 1 deletion src/main/java/mesosphere/marathon/client/model/v2/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class App {
private Collection<HealthCheck> healthChecks;
private UpgradeStrategy upgradeStrategy;
private Collection<Deployment> deployments;
private List<String> dependencies;

public UpgradeStrategy getUpgradeStrategy() {
return upgradeStrategy;
Expand Down Expand Up @@ -202,12 +203,20 @@ public Collection<Deployment> getDeployments() {
public void setDeployments(Collection<Deployment> deployments) {
this.deployments = deployments;
}

public void addDeployment(Deployment deployment) {
this.deployments = (this.deployments != null) ? this.deployments : new ArrayList<Deployment>();
this.deployments.add(deployment);
}

public List<String> getDependencies() {
return dependencies;
}

public void setDependencies(List<String> dependencies) {
this.dependencies = dependencies;
}

public Map<String, String> getLabels() {
return labels;
}
Expand Down