本文整理汇总了Java中com.github.dockerjava.api.command.CreateVolumeCmd类的典型用法代码示例。如果您正苦于以下问题:Java CreateVolumeCmd类的具体用法?Java CreateVolumeCmd怎么用?Java CreateVolumeCmd使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CreateVolumeCmd类属于com.github.dockerjava.api.command包,在下文中一共展示了CreateVolumeCmd类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doCreate
import com.github.dockerjava.api.command.CreateVolumeCmd; //导入依赖的package包/类
private void doCreate(String name) {
CreateVolumeCmd createVolumeCmd = dockerClient.createVolumeCmd();
createVolumeCmd.withName(name);
driver = getPropertyAsString("volume_driver");
Map<String, String> driverOpts = (Map<String, String>) getProperty("volume_driver_opts");
if (StringUtils.isNotBlank(driver)) {
createVolumeCmd.withDriver(driver);
}
if (driverOpts != null && !driverOpts.isEmpty()) {
createVolumeCmd.withDriverOpts(driverOpts);
}
CreateVolumeResponse volumeResponse = createVolumeCmd.exec();
volumeId = volumeResponse.getName();
mountPoint = volumeResponse.getMountpoint();
driver = volumeResponse.getDriver();
log.info("Volume [{}]: Created new volume {} mounted at {} with driver {}", getId(), volumeId, mountPoint, driver);
initializeAttributes();
}
示例2: execute
import com.github.dockerjava.api.command.CreateVolumeCmd; //导入依赖的package包/类
@Override
protected CreateVolumeResponse execute(CreateVolumeCmd command) {
WebTarget webResource = getBaseResource().path("/volumes/create");
LOGGER.trace("POST: {}", webResource);
return webResource.request().accept(MediaType.APPLICATION_JSON)
.post(entity(command, MediaType.APPLICATION_JSON), CreateVolumeResponse.class);
}
示例3: execute
import com.github.dockerjava.api.command.CreateVolumeCmd; //导入依赖的package包/类
@Override
protected CreateVolumeResponse execute(CreateVolumeCmd command) {
WebTarget webResource = getBaseResource().path("/volumes/create");
LOGGER.trace("POST: {}", webResource);
return webResource.request().accept(MediaType.APPLICATION_JSON)
.post(command, new TypeReference<CreateVolumeResponse>() {
});
}
示例4: createCreateVolumeCmdExec
import com.github.dockerjava.api.command.CreateVolumeCmd; //导入依赖的package包/类
@Override
public CreateVolumeCmd.Exec createCreateVolumeCmdExec() {
return new CreateVolumeCmd.Exec() {
@Override
public CreateVolumeResponse exec(CreateVolumeCmd command) {
CreateVolumeResponse result = delegate.createCreateVolumeCmdExec().exec(command);
volumeNames.add(command.getName());
return result;
}
};
}
示例5: createCreateVolumeCmdExec
import com.github.dockerjava.api.command.CreateVolumeCmd; //导入依赖的package包/类
@Override
public CreateVolumeCmd.Exec createCreateVolumeCmdExec() {
return new CreateVolumeCmdExec(getBaseResource(), getDockerClientConfig());
}
示例6: createVolumeCmd
import com.github.dockerjava.api.command.CreateVolumeCmd; //导入依赖的package包/类
@Override
public CreateVolumeCmd createVolumeCmd() {
return new CreateVolumeCmdImpl(getDockerCmdExecFactory().createCreateVolumeCmdExec());
}
示例7: CreateVolumeCmdImpl
import com.github.dockerjava.api.command.CreateVolumeCmd; //导入依赖的package包/类
public CreateVolumeCmdImpl(CreateVolumeCmd.Exec exec) {
super(exec);
}
示例8: withDriverOpts
import com.github.dockerjava.api.command.CreateVolumeCmd; //导入依赖的package包/类
@Override
public CreateVolumeCmd withDriverOpts(Map<String, String> driverOpts) {
checkNotNull(driverOpts, "driverOpts was not specified");
this.driverOpts = driverOpts;
return this;
}
示例9: createVolumeCmd
import com.github.dockerjava.api.command.CreateVolumeCmd; //导入依赖的package包/类
CreateVolumeCmd createVolumeCmd();