dtk-client 0.5.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/Gemfile +5 -0
- data/Gemfile_dev +12 -0
- data/README.md +78 -0
- data/bin/dtk +54 -0
- data/bin/dtk-shell +15 -0
- data/dtk-client.gemspec +49 -0
- data/lib/auxiliary.rb +13 -0
- data/lib/bundler_monkey_patch.rb +9 -0
- data/lib/client.rb +48 -0
- data/lib/command_helper.rb +16 -0
- data/lib/command_helpers/git_repo.rb +391 -0
- data/lib/command_helpers/jenkins_client/config_xml.rb +271 -0
- data/lib/command_helpers/jenkins_client.rb +91 -0
- data/lib/command_helpers/service_importer.rb +99 -0
- data/lib/command_helpers/service_link.rb +18 -0
- data/lib/command_helpers/ssh_processing.rb +43 -0
- data/lib/commands/common/thor/assembly_workspace.rb +1089 -0
- data/lib/commands/common/thor/clone.rb +39 -0
- data/lib/commands/common/thor/common.rb +34 -0
- data/lib/commands/common/thor/edit.rb +168 -0
- data/lib/commands/common/thor/list_diffs.rb +84 -0
- data/lib/commands/common/thor/pull_clone_changes.rb +11 -0
- data/lib/commands/common/thor/pull_from_remote.rb +99 -0
- data/lib/commands/common/thor/purge_clone.rb +26 -0
- data/lib/commands/common/thor/push_clone_changes.rb +45 -0
- data/lib/commands/common/thor/push_to_remote.rb +45 -0
- data/lib/commands/common/thor/reparse.rb +36 -0
- data/lib/commands/common/thor/set_required_params.rb +29 -0
- data/lib/commands/common/thor/task_status.rb +81 -0
- data/lib/commands/thor/account.rb +213 -0
- data/lib/commands/thor/assembly.rb +329 -0
- data/lib/commands/thor/attribute.rb +62 -0
- data/lib/commands/thor/component.rb +52 -0
- data/lib/commands/thor/component_module.rb +829 -0
- data/lib/commands/thor/component_template.rb +153 -0
- data/lib/commands/thor/dependency.rb +18 -0
- data/lib/commands/thor/developer.rb +105 -0
- data/lib/commands/thor/dtk.rb +117 -0
- data/lib/commands/thor/library.rb +107 -0
- data/lib/commands/thor/node.rb +411 -0
- data/lib/commands/thor/node_group.rb +211 -0
- data/lib/commands/thor/node_template.rb +88 -0
- data/lib/commands/thor/project.rb +17 -0
- data/lib/commands/thor/provider.rb +155 -0
- data/lib/commands/thor/repo.rb +35 -0
- data/lib/commands/thor/service.rb +656 -0
- data/lib/commands/thor/service_module.rb +806 -0
- data/lib/commands/thor/state_change.rb +10 -0
- data/lib/commands/thor/target.rb +94 -0
- data/lib/commands/thor/task.rb +100 -0
- data/lib/commands/thor/utils.rb +4 -0
- data/lib/commands/thor/workspace.rb +437 -0
- data/lib/commands.rb +40 -0
- data/lib/config/cacert.pem +3785 -0
- data/lib/config/client.conf.header +18 -0
- data/lib/config/configuration.rb +82 -0
- data/lib/config/default.conf +14 -0
- data/lib/config/disk_cacher.rb +60 -0
- data/lib/configurator.rb +92 -0
- data/lib/context_router.rb +23 -0
- data/lib/core.rb +460 -0
- data/lib/domain/git_adapter.rb +221 -0
- data/lib/domain/response.rb +234 -0
- data/lib/dtk-client/version.rb +3 -0
- data/lib/dtk_constants.rb +23 -0
- data/lib/dtk_logger.rb +96 -0
- data/lib/error.rb +74 -0
- data/lib/git-logs/git.log +0 -0
- data/lib/parser/adapters/option_parser.rb +53 -0
- data/lib/parser/adapters/thor/common_option_defs.rb +12 -0
- data/lib/parser/adapters/thor.rb +509 -0
- data/lib/require_first.rb +87 -0
- data/lib/search_hash.rb +27 -0
- data/lib/shell/context.rb +975 -0
- data/lib/shell/context_aux.rb +29 -0
- data/lib/shell/domain.rb +447 -0
- data/lib/shell/header_shell.rb +27 -0
- data/lib/shell/help_monkey_patch.rb +221 -0
- data/lib/shell/interactive_wizard.rb +233 -0
- data/lib/shell/parse_monkey_patch.rb +22 -0
- data/lib/shell/status_monitor.rb +105 -0
- data/lib/shell.rb +219 -0
- data/lib/util/console.rb +143 -0
- data/lib/util/dtk_puppet.rb +46 -0
- data/lib/util/os_util.rb +265 -0
- data/lib/view_processor/augmented_simple_list.rb +27 -0
- data/lib/view_processor/hash_pretty_print.rb +106 -0
- data/lib/view_processor/simple_list.rb +139 -0
- data/lib/view_processor/table_print.rb +277 -0
- data/lib/view_processor.rb +112 -0
- data/puppet/manifests/init.pp +72 -0
- data/puppet/manifests/params.pp +16 -0
- data/puppet/r8meta.puppet.yml +18 -0
- data/puppet/templates/bash_profile.erb +2 -0
- data/puppet/templates/client.conf.erb +1 -0
- data/puppet/templates/dtkclient.erb +2 -0
- data/spec/assembly_spec.rb +50 -0
- data/spec/assembly_template_spec.rb +51 -0
- data/spec/component_template_spec.rb +40 -0
- data/spec/dependency_spec.rb +6 -0
- data/spec/dtk_shell_spec.rb +13 -0
- data/spec/dtk_spec.rb +33 -0
- data/spec/lib/spec_helper.rb +10 -0
- data/spec/lib/spec_thor.rb +105 -0
- data/spec/module_spec.rb +35 -0
- data/spec/node_spec.rb +43 -0
- data/spec/node_template_spec.rb +25 -0
- data/spec/project_spec.rb +6 -0
- data/spec/repo_spec.rb +7 -0
- data/spec/response_spec.rb +52 -0
- data/spec/service_spec.rb +41 -0
- data/spec/state_change_spec.rb +7 -0
- data/spec/table_print_spec.rb +48 -0
- data/spec/target_spec.rb +57 -0
- data/spec/task_spec.rb +28 -0
- data/views/assembly/augmented_simple_list.rb +12 -0
- data/views/assembly_template/augmented_simple_list.rb +12 -0
- data/views/list_task/augmented_simple_list.rb +12 -0
- metadata +351 -0
@@ -0,0 +1,52 @@
|
|
1
|
+
module DTK::Client
|
2
|
+
class Component < CommandBaseThor
|
3
|
+
|
4
|
+
def self.valid_children()
|
5
|
+
[:attribute]
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.valid_child?(name_of_sub_context)
|
9
|
+
return Component.valid_children().include?(name_of_sub_context.to_sym)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.validation_list(context_params)
|
13
|
+
if context_params.is_there_identifier?("component-module")
|
14
|
+
component_module_id = context_params.retrieve_arguments([:component_module_id!])
|
15
|
+
res = get_cached_response(:component_template, "component_module/info_about", { :component_module_id => component_module_id, :about => :components})
|
16
|
+
else
|
17
|
+
assembly_or_worspace_id, node_id, node_name = context_params.retrieve_arguments([[:service_id, :workspace_id], :node_id!, :node_name!])
|
18
|
+
|
19
|
+
post_body = {
|
20
|
+
:assembly_id => assembly_or_worspace_id,
|
21
|
+
:node_id => node_id,
|
22
|
+
:subtype => 'instance',
|
23
|
+
:about => 'components',
|
24
|
+
:filter => nil
|
25
|
+
}
|
26
|
+
|
27
|
+
if assembly_or_worspace_id
|
28
|
+
response = get_cached_response(:service_node_component, "assembly/info_about", post_body)
|
29
|
+
else
|
30
|
+
response = get_cached_response(:node_component, "node/info_about", post_body)
|
31
|
+
end
|
32
|
+
|
33
|
+
modified_response = response.clone_me()
|
34
|
+
modified_response['data'].each { |e| e['display_name'] = e['display_name'].split('/').last }
|
35
|
+
|
36
|
+
return modified_response
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
desc "SERVICE-NAME/ID set ATTRIBUTE-PATTERN VALUE", "Set target component attributes"
|
41
|
+
def set(context_params)
|
42
|
+
assembly_id, node_id, component_id, pattern, value = context_params.retrieve_arguments([:service_id, :node_id, :component_id, :option_1,:option_2],method_argument_names)
|
43
|
+
post_body = {
|
44
|
+
:assembly_id => assembly_id,
|
45
|
+
:pattern => pattern,
|
46
|
+
:value => value
|
47
|
+
}
|
48
|
+
post rest_url("assembly/set_attributes"), post_body
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|