本文整理汇总了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;
}
示例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();
}
示例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>>() {
});
}
示例4: createListNetworksCmdExec
import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
@Override
public ListNetworksCmd.Exec createListNetworksCmdExec() {
return new ListNetworksCmdExec(getBaseResource(), getDockerClientConfig());
}
示例5: listNetworksCmd
import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
@Override
public ListNetworksCmd listNetworksCmd() {
return new ListNetworksCmdImpl(getDockerCmdExecFactory().createListNetworksCmdExec());
}
示例6: ListNetworksCmdImpl
import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
public ListNetworksCmdImpl(ListNetworksCmd.Exec exec) {
super(exec);
}
示例7: withIdFilter
import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
@Override
public ListNetworksCmd withIdFilter(String... networkId) {
this.filtersBuilder.withFilter("id", networkId);
return this;
}
示例8: withNameFilter
import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
@Override
public ListNetworksCmd withNameFilter(String... networkName) {
this.filtersBuilder.withFilter("name", networkName);
return this;
}
示例9: createListNetworksCmdExec
import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
@Override
public ListNetworksCmd.Exec createListNetworksCmdExec() {
return delegate.createListNetworksCmdExec();
}
示例10: listNetworksCmd
import com.github.dockerjava.api.command.ListNetworksCmd; //导入依赖的package包/类
ListNetworksCmd listNetworksCmd();