Class: DTK::Network::Client::Command::Chmod

Inherits:
DTK::Network::Client::Command show all
Defined in:
lib/client/command/chmod.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DTK::Network::Client::Command

wrap_command

Methods included from RestWrapper

#rest_delete, #rest_get, #rest_post

Methods included from Client::PermissionsUtil

#validate_permissions!

Methods included from Util::Tar

#gzip, #tar, #ungzip, #untar

Constructor Details

#initialize(namespace, permissions, options = {}) ⇒ Chmod

Returns a new instance of Chmod.



4
5
6
7
# File 'lib/client/command/chmod.rb', line 4

def initialize(namespace, permissions, options = {})
  @namespace   = namespace
  @permissions = permissions
end

Class Method Details

.run(namespace, permissions, opts = {}) ⇒ Object



9
10
11
# File 'lib/client/command/chmod.rb', line 9

def self.run(namespace, permissions, opts = {})
  new(namespace, permissions, opts).chmod
end

Instance Method Details

#chmodObject



13
14
15
16
17
# File 'lib/client/command/chmod.rb', line 13

def chmod
  validate_permissions!(@permissions)
  rest_post("namespaces/#{@namespace}/chmod", { name: @namespace, permissions: @permissions })
  nil
end