You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by na...@apache.org on 2015/05/05 11:25:10 UTC

[2/2] jclouds-labs git commit: Add option to remove a volume, when removing docker container

Add option to remove a volume, when removing docker container


Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/ed68eec4
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs/tree/ed68eec4
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs/diff/ed68eec4

Branch: refs/heads/1.9.x
Commit: ed68eec4594559603560a5b6b34baa2d15eaeed7
Parents: a6424a1
Author: Jakub Bartecek <jb...@redhat.com>
Authored: Mon May 4 16:45:25 2015 +0200
Committer: Ignasi Barrera <na...@apache.org>
Committed: Tue May 5 11:01:02 2015 +0200

----------------------------------------------------------------------
 .../docker/options/RemoveContainerOptions.java   | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ed68eec4/docker/src/main/java/org/jclouds/docker/options/RemoveContainerOptions.java
----------------------------------------------------------------------
diff --git a/docker/src/main/java/org/jclouds/docker/options/RemoveContainerOptions.java b/docker/src/main/java/org/jclouds/docker/options/RemoveContainerOptions.java
index 9334e69..7534695 100644
--- a/docker/src/main/java/org/jclouds/docker/options/RemoveContainerOptions.java
+++ b/docker/src/main/java/org/jclouds/docker/options/RemoveContainerOptions.java
@@ -29,6 +29,17 @@ public class RemoveContainerOptions extends BaseHttpRequestOptions {
       this.queryParameters.put("force", force.toString());
       return this;
    }
+   
+   /**
+    * Remove the volumes associated to the container
+    * 
+    * @param volume If set to true the volume associated to the container will be removed. 
+    * Otherwise it will not be removed.
+    */
+   public RemoveContainerOptions volume(Boolean volume) {
+       this.queryParameters.put("v", volume.toString());
+       return this;
+    }
 
    public static class Builder {
       /**
@@ -46,5 +57,13 @@ public class RemoveContainerOptions extends BaseHttpRequestOptions {
          RemoveContainerOptions options = new RemoveContainerOptions();
          return options.force(force);
       }
+      
+      /**
+       * @see RemoveContainerOptions#volume
+       */
+      public static RemoveContainerOptions volume(Boolean volume) {
+         RemoveContainerOptions options = new RemoveContainerOptions();
+         return options.volume(volume);
+      }
    }
 }