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


Java CreateVolumeCmd类代码示例

本文整理汇总了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();
}
 
开发者ID:vuminhkh,项目名称:tosca-runtime,代码行数:19,代码来源:Volume.java

示例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);
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:9,代码来源:CreateVolumeCmdExec.java

示例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>() {
            });
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:10,代码来源:CreateVolumeCmdExec.java

示例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;
        }
    };
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:12,代码来源:TestDockerCmdExecFactory.java

示例5: createCreateVolumeCmdExec

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

示例6: createVolumeCmd

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

示例7: CreateVolumeCmdImpl

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

示例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;
}
 
开发者ID:docker-java,项目名称:docker-java,代码行数:7,代码来源:CreateVolumeCmdImpl.java

示例9: createVolumeCmd

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


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