![JAR search and dependency download from the Maven repository](/logo.png)
com.elastisys.scale.cloudpool.splitter.requests.http.AttachMachineRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudpool.splitter Show documentation
Show all versions of cloudpool.splitter Show documentation
A cloud pool that uses a configured list of child cloud pools to carry out operations.
The newest version!
package com.elastisys.scale.cloudpool.splitter.requests.http;
import java.util.concurrent.Callable;
import org.apache.http.client.methods.HttpPost;
import com.elastisys.scale.cloudpool.splitter.config.PrioritizedCloudPool;
import com.elastisys.scale.commons.net.http.client.AuthenticatedHttpClient;
/**
* A {@link Callable} request that will execute
* {@code POST /pool//attach} against a cloud pool.
*/
public class AttachMachineRequest extends CloudPoolRequest {
/** Machine to request cloud pool to attach. */
private final String machineId;
public AttachMachineRequest(PrioritizedCloudPool cloudPool, String machineId) {
super(cloudPool);
this.machineId = machineId;
}
@Override
public Void execute(AuthenticatedHttpClient client) throws Exception {
String path = String.format("/pool/%s/attach", this.machineId);
HttpPost request = new HttpPost(url(path));
client.execute(request);
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy