dtk-client 0.5.16 → 0.5.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmFlYmQ1YjcyYjFmMmQ5NzA0NDA5NjJkNjVhZTY2OTJlN2FjMjBlOQ==
4
+ NjlmZmNkNDc5M2UxMjc5N2JhODE2MWJhNTVmYzc1M2RjMWJjZjk5ZQ==
5
5
  data.tar.gz: !binary |-
6
- OWI4ZTU4NTZkZTNiODRhMWY1NDdkZDA4YWRjMzc0Y2Y1NTlhYjQxYQ==
6
+ NTg2ZGMwMzhjZmY4MDkwM2JlZDcyODllMjkwOTcwMDEwZDg3ZDZkOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzE1MTZiNjQ3MmQ1MDBjMDIzMjk2NjU3NTQzMDU4NWY4ZWI4ZTA0MWMzNjdj
10
- ZmVkN2M2NGRkZGMyOGRlZDM5MmY4ZDA5MjllYjA0ZTI5OWRjYzQ5ZmU1ZDhm
11
- YzQ2NmRiMGU4ZWJlNjYzYTg2ZjcxNWQ2ZmU1YWRiNThmZWU0YTU=
9
+ NzVjZjZjY2M2ZmE1MWY5MzU2MzdmNzI0NmFlNWIzNmJlMDA0N2VkZDhiOWJk
10
+ OTJkMGIyMWQ2Y2FlYWNiNWQ1YWYzNTU4MmNmYmVlNTdlYjI2ZWU3NjUwMGY1
11
+ NTgzZjA5ODQ4YmZiMjhiZGJiMWY3MWFmOTQxNzIyNmRmMjJjMTI=
12
12
  data.tar.gz: !binary |-
13
- ZWVjOGQ0YzRhNGU2ZmMyY2NmZmE0ZDk0NWZkOTVmYTM5YjFmNzJjOGU2Yjk3
14
- OWU5Njg1YzBjNmE5OTE1YTlhNjMwYTA3YjZjZjk3OWNkZGRjZTRlNjM4NGZh
15
- NzhjNjg3M2Q3Y2Q4MmQ2NDViNjExN2I2MWQwMGU4ZGEzMjIwNjk=
13
+ NTViMjM2NDZmNDU1MjQ1MmM5OWFiYmM1YzQzMDk1NjEyMTJhMjM2YTI1ZDdl
14
+ YTcxYTdmMmE2Y2NhMjZkNmJjMmM0ZDJlMGRkZmQ5MDU1ZGVmNTM3ZjA4NTg5
15
+ Yjg1ZDM2MzM3ZGYzODQ2NThiNzZiOTJmZDVmOGQ2Y2RmMzdlNjU=
@@ -736,45 +736,15 @@ module DTK::Client
736
736
  end
737
737
  end
738
738
 
739
- #Get list of components on particular node
740
739
  post_body = {
741
740
  :assembly_id => assembly_or_workspace_id,
742
- :node_id => node_id,
743
- :subtype => "instance",
744
- :about => "components"
745
- }
746
-
747
- response = post(rest_url("assembly/info_about"),post_body)
748
-
749
- components = []
750
- if !response['data'].nil?
751
- response['data'].each do |c|
752
- components << c['display_name']
753
- end
754
- end
755
-
756
- #Filter out request per specific component
757
- #Filter works for two types of component notation provided: node/component and component
758
- if !options["component"].nil?
759
- components.reject! do |c|
760
- if options["component"].include? "/"
761
- c != options["component"]
762
- else
763
- c.split("/").last != options["component"]
764
- end
765
- end
766
- end
767
- components = nil if components.empty?
768
-
769
- post_body = {
770
- :assembly_id => assembly_or_workspace_id,
771
- :node_id => node_id,
772
- :components => components
773
- }
741
+ :components => options["component"]
742
+ }
743
+ post_body[:node_id] = node_id unless node_id.nil?
774
744
 
775
745
  response = post(rest_url("assembly/initiate_execute_tests"),post_body)
776
746
 
777
- raise DTK::Client::DtkValidationError, response.data(:errors).first if response.data(:errors)
747
+ raise DTK::Client::DtkValidationError, response.data(:errors) if response.data(:errors)
778
748
  return response unless response.ok?
779
749
 
780
750
  action_results_id = response.data(:action_results_id)
@@ -844,6 +814,7 @@ module DTK::Client
844
814
  :sort_key => "pid"
845
815
  }
846
816
  response = post(rest_url("assembly/get_action_results"),post_body)
817
+
847
818
  count += 1
848
819
  if count > get_ps_tries or response.data(:is_complete)
849
820
  end_loop = true
@@ -19,12 +19,15 @@ module DTK::Client
19
19
  raise DtkValidationError, "Credentials for '#{ssh_credentials}' does not exist in credentials file '#{ssh_creds_path}'" unless ssh_creds_data.include?(ssh_credentials)
20
20
 
21
21
  ref = "physical--#{display_name}"
22
- ret[ref] = {
22
+ row = ret[ref] = {
23
23
  :display_name => display_name,
24
24
  :os_type => data["os_type"]||defaults["os_type"],
25
25
  :managed => false,
26
26
  :external_ref => {:type => "physical", :routable_host_address => node_name, :ssh_credentials => ssh_creds_data["#{ssh_credentials}"]}
27
27
  }
28
+ if tags = data["tags"]
29
+ row[:tags] = tags
30
+ end
28
31
  end
29
32
 
30
33
  ret
@@ -35,19 +35,31 @@ module DTK::Client
35
35
  return Provider.valid_children().include?(name_of_sub_context.to_sym)
36
36
  end
37
37
 
38
- desc "create-provider PROVIDER-TYPE:PROVIDER-NAME [--keypair KEYPAIR] [--security-group SECURITY-GROUP] [--bootstrap]", "Create provider"
39
- method_option :keypair, :type => :string
40
- method_option :security_group, :type => :string
38
+ desc "create-provider PROVIDER-TYPE:PROVIDER-NAME [--keypair KEYPAIR] [--security-group SECURITY-GROUP(S)] [--bootstrap]", "Create provider. Multiple security groups separated with ',' (gr1,gr2,gr3,...)"
39
+ method_option :keypair, :type => :string
40
+ method_option :security_group, :type => :string, :aliases => '--security-groups'
41
41
  method_option :bootstrap, :type => :boolean, :default => false
42
42
  def create_provider(context_params)
43
43
  composed_provider_name = context_params.retrieve_arguments([:option_1!],method_argument_names)
44
44
 
45
45
  provider_type, provider_name = decompose_provider_type_and_name(composed_provider_name)
46
46
  iaas_properties = Hash.new
47
- #TODO: daat-driven check if legal provider type and then what options needed depending on provider type
47
+ #TODO: data-driven check if legal provider type and then what options needed depending on provider type
48
48
  unless provider_type.eql?('physical')
49
+ security_groups = []
49
50
  keypair, security_group = context_params.retrieve_thor_options([:keypair!, :security_group!], options)
50
- iaas_properties.merge!(:keypair_name => keypair,:security_group => security_group)
51
+
52
+ raise ::DTK::Client::DtkValidationError.new("Multiple security groups should be separated with ',' and without spaces between them (e.g. --security_groups gr1,gr2,gr3,...) ") if security_group.end_with?(',')
53
+
54
+ security_groups = security_group.split(',')
55
+ iaas_properties.merge!(:keypair_name => keypair)#,:security_group => security_group)
56
+
57
+ if (security_groups.empty? || security_groups.size==1)
58
+ iaas_properties.merge!(:security_group => security_group)#,:security_group => security_group)
59
+ else
60
+ iaas_properties.merge!(:security_group_set => security_groups)
61
+ end
62
+
51
63
  result = DTK::Shell::InteractiveWizard::interactive_user_input(
52
64
  {'IAAS Credentials' => { :type => :group, :options => [
53
65
  {:key => {}},
@@ -148,7 +148,7 @@ TODO: overlaps with different meaning
148
148
  ['get-netstats',"get-netstats","# Get netstats."],
149
149
  ['get-ps',"get-ps [--filter PATTERN]","# Get ps."],
150
150
  ['grep',"grep LOG-PATH NODE-ID-PATTERN GREP-PATTERN [--first]","# Grep log from multiple nodes. --first option returns first match (latest log entry)."],
151
- ['tail',"tail NODE-ID LOG-PATH [REGEX-PATTERN] [--more]","# Tail specified number of lines from log."]
151
+ ['tail',"tail NODE-NAME LOG-PATH [REGEX-PATTERN] [--more]","# Tail specified number of lines from log."]
152
152
  ]
153
153
  },
154
154
  :identifier_only => {
@@ -660,7 +660,7 @@ TODO: will put in dot release and will rename to 'extend'
660
660
  end
661
661
 
662
662
  # using HIDE_FROM_BASE to hide this command from base context (dtk:/assembly>)
663
- desc "HIDE_FROM_BASE tail NODES-IDENTIFIER LOG-PATH [REGEX-PATTERN] [--more]","Tail specified number of lines from log"
663
+ desc "HIDE_FROM_BASE tail NODE-NAME LOG-PATH [REGEX-PATTERN] [--more]","Tail specified number of lines from log"
664
664
  method_option :more, :type => :boolean, :default => false
665
665
  def tail(context_params)
666
666
  tail_aux(context_params)
@@ -48,7 +48,8 @@ module DTK::Client
48
48
  :context => {
49
49
  :add_component => "component_template",
50
50
  :create_node => "node_template",
51
- :add_component_dependency => "component_template"
51
+ :add_component_dependency => "component_template",
52
+ :set_target => 'target'
52
53
  },
53
54
  :command => {
54
55
  :edit_component_module => {
@@ -120,7 +121,7 @@ module DTK::Client
120
121
  ['get-netstats',"get-netstats","# Get netstats."],
121
122
  ['get-ps',"get-ps [--filter PATTERN]","# Get ps."],
122
123
  ['grep',"grep LOG-PATH NODE-ID-PATTERN GREP-PATTERN [--first]","# Grep log from multiple nodes. --first option returns first match (latest log entry)."],
123
- ['tail',"tail NODE-ID LOG-PATH [REGEX-PATTERN] [--more]","# Tail specified number of lines from log."]
124
+ ['tail',"tail NODE-NAME LOG-PATH [REGEX-PATTERN] [--more]","# Tail specified number of lines from log."]
124
125
  ]
125
126
  },
126
127
  :identifier_only => {
@@ -437,7 +438,7 @@ module DTK::Client
437
438
  end
438
439
 
439
440
  # using HIDE_FROM_BASE to hide this command from base context (dtk:/workspace>)
440
- desc "HIDE_FROM_BASE tail NODES-IDENTIFIER LOG-PATH [REGEX-PATTERN] [--more]","Tail specified number of lines from log"
441
+ desc "HIDE_FROM_BASE tail NODE-NAME LOG-PATH [REGEX-PATTERN] [--more]","Tail specified number of lines from log"
441
442
  method_option :more, :type => :boolean, :default => false
442
443
  def tail(context_params)
443
444
  tail_aux(context_params)
data/lib/configurator.rb CHANGED
@@ -17,7 +17,7 @@ module DTK
17
17
  def self.check_config_exists
18
18
  exists = true
19
19
  if !File.exists?(CONFIG_FILE)
20
- puts "", "Please enter the DTK server address (example: dtk.r8network.com)"
20
+ puts "", "Please enter the DTK server address (example: instance.dtk.io)"
21
21
  header = File.read(File.expand_path('../lib/config/client.conf.header', File.dirname(__FILE__)))
22
22
  generate_conf_file(CONFIG_FILE, [['server_host', 'Server address']], header)
23
23
  exists = false
@@ -1,3 +1,3 @@
1
1
  module DtkClient
2
- VERSION="0.5.16"
2
+ VERSION="0.5.17"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dtk-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.16
4
+ version: 0.5.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rich PELAVIN
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-30 00:00:00.000000000 Z
11
+ date: 2014-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler