diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mogilefs/backend.rb | 1 | ||||
-rw-r--r-- | lib/mogilefs/mogilefs.rb | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/mogilefs/backend.rb b/lib/mogilefs/backend.rb index c60bd2b..a6b5e93 100644 --- a/lib/mogilefs/backend.rb +++ b/lib/mogilefs/backend.rb @@ -118,6 +118,7 @@ class MogileFS::Backend add_command :delete_domain add_command :create_class add_command :update_class + add_command :updateclass add_command :delete_class add_command :create_host add_command :update_host diff --git a/lib/mogilefs/mogilefs.rb b/lib/mogilefs/mogilefs.rb index 75a3936..9f4f988 100644 --- a/lib/mogilefs/mogilefs.rb +++ b/lib/mogilefs/mogilefs.rb @@ -256,6 +256,14 @@ class MogileFS::MogileFS < MogileFS::Client true end + # Updates +key+ to +newclass+ + def updateclass(key, newclass) + raise MogileFS::ReadOnlyError if readonly? + + @backend.updateclass(:domain => @domain, :key => key, :class => newclass) + true + end + # Sleeps +duration+, only used for testing def sleep(duration) # :nodoc: @backend.sleep :duration => duration |