dtk-client 0.5.16 → 0.5.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/commands/common/thor/assembly_workspace.rb +5 -34
- data/lib/commands/common/thor/inventory_parser.rb +4 -1
- data/lib/commands/thor/provider.rb +17 -5
- data/lib/commands/thor/service.rb +2 -2
- data/lib/commands/thor/workspace.rb +4 -3
- data/lib/configurator.rb +1 -1
- data/lib/dtk-client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjlmZmNkNDc5M2UxMjc5N2JhODE2MWJhNTVmYzc1M2RjMWJjZjk5ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTg2ZGMwMzhjZmY4MDkwM2JlZDcyODllMjkwOTcwMDEwZDg3ZDZkOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzVjZjZjY2M2ZmE1MWY5MzU2MzdmNzI0NmFlNWIzNmJlMDA0N2VkZDhiOWJk
|
10
|
+
OTJkMGIyMWQ2Y2FlYWNiNWQ1YWYzNTU4MmNmYmVlNTdlYjI2ZWU3NjUwMGY1
|
11
|
+
NTgzZjA5ODQ4YmZiMjhiZGJiMWY3MWFmOTQxNzIyNmRmMjJjMTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
:
|
743
|
-
|
744
|
-
|
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)
|
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,
|
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:
|
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
|
-
|
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-
|
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
|
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-
|
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
|
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.
|
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
|
data/lib/dtk-client/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2014-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|