Index: /trunk/Nebulous/Changes
===================================================================
--- /trunk/Nebulous/Changes	(revision 24919)
+++ /trunk/Nebulous/Changes	(revision 24920)
@@ -6,4 +6,5 @@
     - add neb-rm --force flag
     - change neb-locate's output seperator to \n
+    - add Nebulous::Client->prune() method
 
 0.10
Index: /trunk/Nebulous/MANIFEST
===================================================================
--- /trunk/Nebulous/MANIFEST	(revision 24919)
+++ /trunk/Nebulous/MANIFEST	(revision 24920)
@@ -99,4 +99,5 @@
 t/67_client_swap.t
 t/68_client_chmod.t
+t/69_client_prune.t
 t/70_neb-ls.t
 t/90_nebclient.t
Index: /trunk/Nebulous/lib/Nebulous/Client.pm
===================================================================
--- /trunk/Nebulous/lib/Nebulous/Client.pm	(revision 24919)
+++ /trunk/Nebulous/lib/Nebulous/Client.pm	(revision 24920)
@@ -1117,4 +1117,37 @@
 
 
+sub prune
+{
+    my $self = shift;
+
+    my ( $key ) = validate_pos( @_,
+        {
+            type => SCALAR,
+        },
+    );
+
+    $log->debug( "entered - @_" );
+
+    my $response = $self->{ 'server' }->prune_object( $key );
+    if ( $response->fault ) {
+        $self->set_err($response->faultstring);
+        if ($response->faultstring =~ /is valid object key/) {
+            $log->debug( "leaving" );
+            return;
+        }
+
+        $log->logdie("unhandled fault - ", $self->err);
+    }
+
+    $log->debug( "server returned a stat" );
+
+    my $n_removed = $response->result;
+
+    $log->debug( "leaving" );
+
+    return $n_removed;
+}
+
+
 sub err
 {
Index: /trunk/Nebulous/t/69_client_prune.t
===================================================================
--- /trunk/Nebulous/t/69_client_prune.t	(revision 24920)
+++ /trunk/Nebulous/t/69_client_prune.t	(revision 24920)
@@ -0,0 +1,72 @@
+#!/usr/bin/perl
+
+# Copryight (C) 2004-2009  Joshua Hoblitt
+
+use strict;
+use warnings FATAL => qw( all );
+
+use Apache::Test qw( -withtestmore );
+
+plan tests => 5;
+
+use lib qw( ./t ./lib );
+
+
+use Nebulous::Client;
+use Nebulous::Util qw( :standard );
+use Test::Nebulous;
+
+my $hostport = Apache::Test->config->{ 'hostport' };
+
+my $neb = Nebulous::Client->new(
+    proxy => "http://$hostport/nebulous",
+);
+
+# note: Test::DBUnit::expected_dataset_ok() does not seem to work under
+# Apache::Test for some reason
+#
+use Test::DBUnit dsn => $NEB_DB, username => $NEB_USER, password => $NEB_PASS;
+
+Test::Nebulous->setup;
+
+{
+    my $key = "foo";
+    my $uri1 = $neb->create($key, 'node01');
+    my $uri2 = $neb->replicate($key, 'node02');
+
+    # make one of the instances unavailable
+    my $dbh = test_dbh();
+    $dbh->do("UPDATE mountedvol SET available = 0 WHERE name = 'node01'");
+
+    ok($neb->prune($key), "prune object");
+
+    is(scalar @{$neb->find_instances($key)}, 1, "# of instances");
+}
+
+Test::Nebulous->setup;
+
+{
+    my $key = "foo";
+    my $uri1 = $neb->create($key);
+
+    is($neb->prune($key), 0, "no dead instances to remove");
+}
+
+Test::Nebulous->setup;
+
+eval {
+    $neb->prune();
+};
+like($@, qr/1 was expected/, "no params");
+
+Test::Nebulous->setup;
+
+eval {
+    my $key = "foo";
+    my $uri1 = $neb->create($key);
+
+    $neb->prune("foo", 2);
+};
+like($@, qr/1 was expected/, "too many params");
+
+Test::Nebulous->cleanup;
