com.fitbur.github.dockerjava.jaxrs.StartContainerCmdExec Maven / Gradle / Ivy
package com.fitbur.github.dockerjava.jaxrs;
import com.fitbur.github.dockerjava.api.com.fitburmand.StartContainerCmd;
import com.fitbur.github.dockerjava.core.DockerClientConfig;
import com.fitbur.slf4j.Logger;
import com.fitbur.slf4j.LoggerFactory;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import static javax.ws.rs.client.Entity.entity;
public class StartContainerCmdExec extends AbstrSyncDockerCmdExec implements
StartContainerCmd.Exec {
private static final Logger LOGGER = LoggerFactory.getLogger(StartContainerCmdExec.class);
public StartContainerCmdExec(WebTarget baseResource, DockerClientConfig dockerClientConfig) {
super(baseResource, dockerClientConfig);
}
@Override
protected Void execute(StartContainerCmd com.fitburmand) {
WebTarget webResource = getBaseResource().path("/containers/{id}/start").resolveTemplate("id",
com.fitburmand.getContainerId());
LOGGER.trace("POST: {}", webResource);
webResource.request().accept(MediaType.APPLICATION_JSON).post(entity(com.fitburmand, MediaType.APPLICATION_JSON))
.close();
return null;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy