Class: DTK::Network::Client::Command::Delete

Inherits:
DTK::Network::Client::Command show all
Defined in:
lib/client/command/delete.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(module_ref, options = {}) ⇒ Delete

Returns a new instance of Delete.



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

def initialize(module_ref, options = {})
  @module_ref       = module_ref
  @options          = options
end

Class Method Details

.run(module_info, opts = {}) ⇒ Object



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

def self.run(module_info, opts = {})
  module_ref      = ModuleRef.new(module_info)
  new(module_ref, opts).delete
end

Instance Method Details

#deleteObject



14
15
16
17
18
19
20
21
22
# File 'lib/client/command/delete.rb', line 14

def delete
  params = {
    name: @module_ref.name,
    namespace: @module_ref.namespace
  }
  rest_delete("modules/#{@module_ref.name}", params)

  nil
end