All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.testifyproject.github.dockerjava.jaxrs.UpdateContainerCmdExec Maven / Gradle / Ivy

package org.testifyproject.testifyproject.github.dockerjava.jaxrs;

import org.testifyproject.testifyproject.github.dockerjava.api.org.testifyproject.testifyprojectmand.UpdateContainerCmd;
import org.testifyproject.testifyproject.github.dockerjava.api.model.UpdateContainerResponse;
import org.testifyproject.testifyproject.github.dockerjava.core.DockerClientConfig;
import org.testifyproject.slf4j.Logger;
import org.testifyproject.slf4j.LoggerFactory;

import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;

import static javax.ws.rs.client.Entity.entity;

/**
 * Update container settings.
 *
 * @author Kanstantsin Shautsou
 */
public class UpdateContainerCmdExec extends AbstrSyncDockerCmdExec
        implements UpdateContainerCmd.Exec {
    private static final Logger LOGGER = LoggerFactory.getLogger(UpdateContainerCmdExec.class);

    public UpdateContainerCmdExec(WebTarget baseResource, DockerClientConfig dockerClientConfig) {
        super(baseResource, dockerClientConfig);
    }

    @Override
    protected UpdateContainerResponse execute(UpdateContainerCmd org.testifyproject.testifyprojectmand) {
        WebTarget webResource = getBaseResource().path("/containers/{id}/update")
                .resolveTemplate("id", org.testifyproject.testifyprojectmand.getContainerId());

        LOGGER.trace("POST: {}", webResource);
        return webResource.request().accept(MediaType.APPLICATION_JSON)
                .post(entity(org.testifyproject.testifyprojectmand, MediaType.APPLICATION_JSON), UpdateContainerResponse.class);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy