Class: DTK::Network::Client::Command::CreateNamespace

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

Returns a new instance of CreateNamespace.



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

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

Class Method Details

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



8
9
10
# File 'lib/client/command/create_namespace.rb', line 8

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

Instance Method Details

#create_namespaceObject



12
13
14
15
# File 'lib/client/command/create_namespace.rb', line 12

def create_namespace
  rest_post("groups", { name: @namespace, reference: 'namespace' })
  nil
end