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

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

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

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

import org.testifyproject.apache.org.testifyproject.testifyprojectmons.lang.StringUtils;
import org.testifyproject.slf4j.Logger;
import org.testifyproject.slf4j.LoggerFactory;

import org.testifyproject.testifyproject.github.dockerjava.api.org.testifyproject.testifyprojectmand.TopContainerCmd;
import org.testifyproject.testifyproject.github.dockerjava.api.org.testifyproject.testifyprojectmand.TopContainerResponse;
import org.testifyproject.testifyproject.github.dockerjava.core.DockerClientConfig;

public class TopContainerCmdExec extends AbstrSyncDockerCmdExec implements
        TopContainerCmd.Exec {

    private static final Logger LOGGER = LoggerFactory.getLogger(TopContainerCmdExec.class);

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

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

        if (!StringUtils.isEmpty(org.testifyproject.testifyprojectmand.getPsArgs())) {
            webResource = webResource.queryParam("ps_args", org.testifyproject.testifyprojectmand.getPsArgs());
        }

        LOGGER.trace("GET: {}", webResource);
        return webResource.request().accept(MediaType.APPLICATION_JSON).get(TopContainerResponse.class);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy