Index: /trunk/Nebulous/lib/Nebulous/Client.pm
===================================================================
--- /trunk/Nebulous/lib/Nebulous/Client.pm	(revision 13066)
+++ /trunk/Nebulous/lib/Nebulous/Client.pm	(revision 13067)
@@ -1,5 +1,5 @@
 # Copyright (c) 2004  Joshua Hoblitt
 #
-# $Id: Client.pm,v 1.26 2007-04-27 21:30:16 jhoblitt Exp $
+# $Id: Client.pm,v 1.27 2007-04-27 23:50:57 jhoblitt Exp $
 
 package Nebulous::Client;
@@ -583,5 +583,5 @@
     my $self = shift;
 
-    my ( $key, $new_key ) = validate_pos( @_,
+    my ( $key, $new_key, $volume ) = validate_pos( @_,
         {
             type => SCALAR,
@@ -589,4 +589,9 @@
         {
             type => SCALAR,
+        },
+        {
+            #volume
+            type        => SCALAR,
+            optional    => 1,
         },
     );
@@ -602,5 +607,10 @@
     }
 
-    my $new_fh  = $self->open_create( $new_key );
+    my $new_fh;
+    if (defined $volume) {
+        $new_fh  = $self->open_create( $new_key, 0, $volume );
+    } else {
+        $new_fh  = $self->open_create( $new_key );
+    }
     unless ( $new_fh ) {
         $log->debug( "can not open object" );
Index: /trunk/Nebulous/lib/Nebulous/Client.pod
===================================================================
--- /trunk/Nebulous/lib/Nebulous/Client.pod	(revision 13066)
+++ /trunk/Nebulous/lib/Nebulous/Client.pod	(revision 13067)
@@ -24,5 +24,5 @@
     my $fh = $neb->open( "key", 'read' );
     $data->delete( "key" );
-    $data->copy( "key", "new_key" );
+    $data->copy( "key", "new_key", "node01" );
     $data->move( "key", "new_key" );
     $data->delete_instance( $uri );
@@ -330,5 +330,5 @@
 
 
-=item * copy($key, $new_key)
+=item * copy($key, $new_key, $volume)
 
 Copy a storage object.
@@ -343,4 +343,10 @@
 
 The destination object.
+
+=item * volume
+
+The preferred storage location of the new instance.
+
+This parameter is optional.
 
 =back
Index: /trunk/Nebulous/t/60_client_copy.t
===================================================================
--- /trunk/Nebulous/t/60_client_copy.t	(revision 13066)
+++ /trunk/Nebulous/t/60_client_copy.t	(revision 13067)
@@ -3,5 +3,5 @@
 # Copryight (C) 2004-2005  Joshua Hoblitt
 #
-# $Id: 60_client_copy.t,v 1.1 2005-12-03 02:52:31 jhoblitt Exp $
+# $Id: 60_client_copy.t,v 1.2 2007-04-27 23:50:57 jhoblitt Exp $
 
 use strict;
@@ -10,5 +10,5 @@
 use Apache::Test qw( -withtestmore );
 
-plan tests => 8;
+plan tests => 11;
 
 use lib qw( ./t ./lib );
@@ -43,4 +43,21 @@
         proxy => "http://$hostport/nebulous",
     );
+    $neb->create( "foo" );
+
+    ok( $neb->copy( "foo", "foobar", "node01" ), "copied object" );
+
+    my $locations1 = $neb->find_instances( "foobar" );
+    my $locations2 = $neb->find_instances( "foobar" );
+
+    is( scalar @$locations1, 1, "old object has an instances" );
+    is( scalar @$locations2, 1, "new object has an instances" );
+}
+
+Test::Nebulous->setup;
+
+{
+    my $neb = Nebulous::Client->new(
+        proxy => "http://$hostport/nebulous",
+    );
 
     ok( ! $neb->copy( "foo", "foobar" ), "copy non-existant object" );
@@ -59,5 +76,5 @@
     $neb->copy();
 };
-like( $@, qr/2 were expected/, "no params" );
+like( $@, qr/2 - 3 were expected/, "no params" );
 
 Test::Nebulous->setup;
@@ -69,5 +86,5 @@
     $neb->copy( "foo" );
 };
-like( $@, qr/2 were expected/, "not enough params" );
+like( $@, qr/2 - 3 were expected/, "not enough params" );
 
 Test::Nebulous->setup;
@@ -77,7 +94,7 @@
         proxy => "http://$hostport/nebulous",
     );
-    $neb->copy( "foo", "bar", "baz" );
+    $neb->copy( "foo", "bar", "baz", "bong" );
 };
-like( $@, qr/2 were expected/, "too many params" );
+like( $@, qr/2 - 3 were expected/, "too many params" );
 
 Test::Nebulous->cleanup;
