当前位置: 首页>>代码示例>>Java>>正文


Java ListNetworksCmd类代码示例

本文整理汇总了Java中com.github.dockerjava.api.command.ListNetworksCmd的典型用法代码示例。如果您正苦于以下问题:Java ListNetworksCmd类的具体用法?Java ListNetworksCmd怎么用?Java ListNetworksCmd使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ListNetworksCmd类属于com.github.dockerjava.api.command包,在下文中一共展示了ListNetworksCmd类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
@Override
protected List<Network> execute(ListNetworksCmd command) {
    WebTarget webTarget = getBaseResource().path("/networks");

    if (command.getFilters() != null && !command.getFilters().isEmpty()) {
        webTarget = webTarget
                .queryParam("filters", urlPathSegmentEscaper().escape(FiltersEncoder.jsonEncode(command.getFilters())));
    }

    LOGGER.trace("GET: {}", webTarget);
    List<Network> networks = webTarget.request().accept(MediaType.APPLICATION_JSON)
            .get(new GenericType<List<Network>>() {
            });
    LOGGER.trace("Response: {}", networks);

    return networks;
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:18,代码来源:ListNetworksCmdExec.java

示例2: findNetwork

import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
private com.github.dockerjava.api.model.Network findNetwork(String id, String name) {
    if (id == null && name == null) {
        return null;
    }
    ListNetworksCmd listNetworksCmd = dockerClient.listNetworksCmd();
    if (StringUtils.isNotBlank(id)) {
        listNetworksCmd.withIdFilter(id);
    }
    if (StringUtils.isNotBlank(name)) {
        listNetworksCmd.withNameFilter(name);
    }
    List<com.github.dockerjava.api.model.Network> networks = listNetworksCmd.exec();
    return networks.isEmpty() ? null : networks.iterator().next();
}
 
开发者ID:vuminhkh,项目名称:tosca-runtime,代码行数:15,代码来源:Network.java

示例3: execute

import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
@Override
protected List<Network> execute(ListNetworksCmd command) {
    WebTarget webTarget = getBaseResource().path("/networks");

    if (command.getFilters() != null && !command.getFilters().isEmpty()) {
        webTarget = webTarget.queryParam("filters", FiltersEncoder.jsonEncode(command.getFilters()));
    }

    LOGGER.trace("GET: {}", webTarget);

    return webTarget.request().accept(MediaType.APPLICATION_JSON).get(new TypeReference<List<Network>>() {
    });
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:14,代码来源:ListNetworksCmdExec.java

示例4: createListNetworksCmdExec

import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
@Override
public ListNetworksCmd.Exec createListNetworksCmdExec() {
    return new ListNetworksCmdExec(getBaseResource(), getDockerClientConfig());
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:5,代码来源:JerseyDockerCmdExecFactory.java

示例5: listNetworksCmd

import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
@Override
public ListNetworksCmd listNetworksCmd() {
    return new ListNetworksCmdImpl(getDockerCmdExecFactory().createListNetworksCmdExec());
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:5,代码来源:DockerClientImpl.java

示例6: ListNetworksCmdImpl

import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
public ListNetworksCmdImpl(ListNetworksCmd.Exec exec) {
    super(exec);
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:4,代码来源:ListNetworksCmdImpl.java

示例7: withIdFilter

import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
@Override
public ListNetworksCmd withIdFilter(String... networkId) {
    this.filtersBuilder.withFilter("id", networkId);
    return this;
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:6,代码来源:ListNetworksCmdImpl.java

示例8: withNameFilter

import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
@Override
public ListNetworksCmd withNameFilter(String... networkName) {
    this.filtersBuilder.withFilter("name", networkName);
    return this;
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:6,代码来源:ListNetworksCmdImpl.java

示例9: createListNetworksCmdExec

import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
@Override
public ListNetworksCmd.Exec createListNetworksCmdExec() {
    return delegate.createListNetworksCmdExec();
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:5,代码来源:TestDockerCmdExecFactory.java

示例10: listNetworksCmd

import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
ListNetworksCmd listNetworksCmd(); 
开发者ID:docker-java,项目名称:docker-java,代码行数:2,代码来源:DockerClient.java


注:本文中的com.github.dockerjava.api.command.ListNetworksCmd类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。