Class: Command::AmbariCreateClusterConfiguration

Inherits:
AmbariClusterCommand show all
Defined in:
lib/command/ambari_create_cluster_configuration.rb

Overview

Command used to get the configurations of an ambari cluster.

Instance Attribute Summary collapse

Attributes inherited from AmbariClusterCommand

#cluster_name

Attributes inherited from BasicCommand

#logger, #receiver

Instance Method Summary collapse

Constructor Details

#initialize(cluster_name, type, tag, properties, apply = false) ⇒ AmbariCreateClusterConfiguration

The execution of the command.



20
21
22
23
24
25
26
27
28
# File 'lib/command/ambari_create_cluster_configuration.rb', line 20

def initialize(cluster_name, type, tag, properties, apply=false)
  super(cluster_name)
  @logger.info("Command::AmbariCreateClusterConfiguration   initialize the parameters...")
  @type=type
  @tag=tag
  @properties =  properties
  @apply=apply

end

Instance Attribute Details

#applyObject (private)

Returns the value of attribute apply.



15
16
17
# File 'lib/command/ambari_create_cluster_configuration.rb', line 15

def apply
  @apply
end

#propertiesObject (private)

Returns the value of attribute properties.



14
15
16
# File 'lib/command/ambari_create_cluster_configuration.rb', line 14

def properties
  @properties
end

#tagObject (private)

Returns the value of attribute tag.



13
14
15
# File 'lib/command/ambari_create_cluster_configuration.rb', line 13

def tag
  @tag
end

#typeObject (private)

Returns the value of attribute type.



12
13
14
# File 'lib/command/ambari_create_cluster_configuration.rb', line 12

def type
  @type
end

Instance Method Details

#execObject



29
30
31
32
33
34
35
36
# File 'lib/command/ambari_create_cluster_configuration.rb', line 29

def exec()
  if apply
    @receiver.create_apply_configuration(@cluster_name ,@type , @tag , @properties)
  else
    @receiver.create_configuration(@cluster_name ,@type , @tag , @properties)
  end

end