use of com.mesosphere.sdk.http.endpoints.PodResource in project dcos-commons by mesosphere.
the class Send method replacePod.
/**
* Initiates the replacement of a pod through a call to {@link PodResource#replacePod(String)}.
*/
public static Send replacePod(String podName) {
return new Send() {
@Override
public void send(ClusterState state, SchedulerDriver mockDriver, Scheduler scheduler) {
PodResource r = (PodResource) state.getResources().stream().filter(resource -> resource instanceof PodResource).findAny().get();
r.replace(podName);
}
@Override
public String getDescription() {
return String.format("Replace pod: %s", podName);
}
};
}
Aggregations