Search in sources :

Example 6 with UrlBuilder

use of io.fabric8.maven.docker.access.UrlBuilder in project docker-maven-plugin by fabric8io.

the class DockerAccessWithHcClient method getLogSync.

@Override
public void getLogSync(String containerId, LogCallback callback) {
    LogRequestor extractor = new LogRequestor(delegate.getHttpClient(), urlBuilder, containerId, callback);
    extractor.fetchLogs();
}
Also used : LogRequestor(io.fabric8.maven.docker.access.log.LogRequestor)

Example 7 with UrlBuilder

use of io.fabric8.maven.docker.access.UrlBuilder in project docker-maven-plugin by fabric8io.

the class UrlBuilderTest method tagContainer.

@Test
public void tagContainer() throws URISyntaxException {
    UrlBuilder builder = new UrlBuilder("", "1.0");
    assertEquals(new URI("/1.0/images/t1%3Alatest/tag?force=1&repo=new&tag=tag1"), new URI(builder.tagContainer(new ImageName("t1:latest"), new ImageName("new:tag1"), true)));
}
Also used : ImageName(io.fabric8.maven.docker.util.ImageName) UrlBuilder(io.fabric8.maven.docker.access.UrlBuilder) Test(org.junit.Test)

Example 8 with UrlBuilder

use of io.fabric8.maven.docker.access.UrlBuilder in project docker-maven-plugin by fabric8io.

the class UrlBuilderTest method pullImage.

@Test
public void pullImage() throws URISyntaxException {
    UrlBuilder builder = new UrlBuilder("", "1.0");
    assertEquals(new URI("/1.0/images/create?fromImage=reg%2Ft1&tag=latest"), new URI(builder.pullImage(new ImageName("t1:latest"), "reg")));
    assertEquals(new URI("/1.0/images/create?fromImage=reg%2Ft1&tag=latest"), new URI(builder.pullImage(new ImageName("t1"), "reg")));
}
Also used : ImageName(io.fabric8.maven.docker.util.ImageName) UrlBuilder(io.fabric8.maven.docker.access.UrlBuilder) Test(org.junit.Test)

Example 9 with UrlBuilder

use of io.fabric8.maven.docker.access.UrlBuilder in project docker-maven-plugin by fabric8io.

the class UrlBuilderTest method copyArchive.

@Test
public void copyArchive() throws URISyntaxException {
    UrlBuilder builder = new UrlBuilder("", "1.0");
    assertEquals(new URI("/1.0/containers/cid/archive?path=tp"), new URI(builder.copyArchive("cid", "tp")));
}
Also used : UrlBuilder(io.fabric8.maven.docker.access.UrlBuilder) Test(org.junit.Test)

Example 10 with UrlBuilder

use of io.fabric8.maven.docker.access.UrlBuilder in project docker-maven-plugin by fabric8io.

the class UrlBuilderTest method containerLogs.

@Test
public void containerLogs() throws URISyntaxException {
    UrlBuilder builder = new UrlBuilder("", "1.0");
    assertEquals(new URI("/1.0/containers/cid/logs?follow=0&stderr=1&stdout=1&timestamps=1"), new URI(builder.containerLogs("cid", false)));
}
Also used : UrlBuilder(io.fabric8.maven.docker.access.UrlBuilder) Test(org.junit.Test)

Aggregations

UrlBuilder (io.fabric8.maven.docker.access.UrlBuilder)9 Test (org.junit.Test)9 ImageName (io.fabric8.maven.docker.util.ImageName)3 LogRequestor (io.fabric8.maven.docker.access.log.LogRequestor)2 BuildOptions (io.fabric8.maven.docker.access.BuildOptions)1 HashMap (java.util.HashMap)1