本文整理汇总了Java中com.spotify.docker.client.messages.Info类的典型用法代码示例。如果您正苦于以下问题:Java Info类的具体用法?Java Info怎么用?Java Info使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Info类属于com.spotify.docker.client.messages包,在下文中一共展示了Info类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testConnection
import com.spotify.docker.client.messages.Info; //导入依赖的package包/类
private String testConnection() throws DockerException, InterruptedException, DockerCertificateException{
DockerConnectionElement elem = getDockerConnection();
DockerClient client = elem.getDockerClient();
if(client == null)
return null;
else{
Info info = client.info();
return info.toString();
}
}
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:11,代码来源:DockerConnectionWizardPage.java
示例2: connect
import com.spotify.docker.client.messages.Info; //导入依赖的package包/类
/**
* connect to the docker daemon
* @throws MetadataCollectorException
*/
protected void connect() throws MetadataCollectorException
{
if (connected) {
return;
}
try {
connected = true;
Info dockerInfo = dockerClient.info();
logger.info("Connected to docker server " + dockerInfo.toString());
} catch (DockerException | InterruptedException e) {
throw new MetadataCollectorException("Failed to connect to Docker-Daemon", e);
}
}
开发者ID:Marmelatze,项目名称:docker-controller,代码行数:19,代码来源:DockerMetadataCollectorProvider.java
示例3: testGetMetadata
import com.spotify.docker.client.messages.Info; //导入依赖的package包/类
@Test()
public void testGetMetadata() throws Exception
{
List<String> env = new ArrayList<>();
env.add("FOO=BAR");
env.add("MESOS_TASK_ID=test.1234-foo-bar");
env.add("MARATHON_APP_ID=/customers/1/foo");
env.add("MARATHON_APP_VERSION=2015-01-12");
ContainerInfo containerInfo = mock(ContainerInfo.class, RETURNS_DEEP_STUBS);
when(containerInfo.id()).thenReturn("123asfd");
when(containerInfo.name()).thenReturn("/test");
when(containerInfo.networkSettings().ipAddress()).thenReturn("1.2.3.4");
when(containerInfo.config().env()).thenReturn(env);
DockerClient dockerClient = mock(DockerClient.class);
when(dockerClient.info()).thenReturn(new Info());
when(dockerClient.inspectContainer("fake_container")).thenReturn(containerInfo);
DockerClientFactory dockerClientFactory = mock(DockerClientFactory.class);
when(dockerClientFactory.get(any(URI.class))).thenReturn(dockerClient);
DockerMetadataCollectorProvider collector = new DockerMetadataCollectorProvider(dockerClientFactory, "localhost");
ContainerMetadata metadata = collector.getCollector(URI.create("docker://foo:2375")).get("fake_container");
assertEquals("123asfd", metadata.getContainerId());
assertEquals("1.2.3.4", metadata.getIp());
assertEquals("test.1234-foo-bar", metadata.getMesosTaskId());
assertEquals("/customers/1/foo", metadata.getMarathonAppId());
assertEquals("2015-01-12", metadata.getMarathonVersion());
}
开发者ID:Marmelatze,项目名称:docker-controller,代码行数:31,代码来源:DockerMetadataCollectorProviderTest.java
示例4: info
import com.spotify.docker.client.messages.Info; //导入依赖的package包/类
@Override
public Info info() {
throw new IllegalStateException(DISCONNECTED);
}
开发者ID:amihaiemil,项目名称:comdor,代码行数:5,代码来源:Disconnected.java
注:本文中的com.spotify.docker.client.messages.Info类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论