dtk-client 0.10.2 → 0.10.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.license_header +15 -0
  4. data/LICENSE +202 -0
  5. data/README.md +25 -2
  6. data/Rakefile +17 -1
  7. data/bin/dtk +18 -1
  8. data/lib/cli/command/account/add_ssh_key.rb +40 -0
  9. data/lib/cli/command/account/delete_ssh_key.rb +43 -0
  10. data/lib/cli/command/account/list_ssh_keys.rb +31 -0
  11. data/lib/cli/command/account/register_catalog_user.rb +31 -0
  12. data/lib/cli/command/account/set_catalog_credentials.rb +31 -0
  13. data/lib/cli/command/account/set_password.rb +31 -0
  14. data/lib/cli/command/account.rb +31 -0
  15. data/lib/cli/command/mixin.rb +1 -1
  16. data/lib/cli/command/module/delete_from_remote.rb +36 -0
  17. data/lib/cli/command/module/install.rb +15 -5
  18. data/lib/cli/command/module/publish.rb +34 -0
  19. data/lib/cli/command/module/pull_dtkn.rb +35 -0
  20. data/lib/cli/command/module/push_dtkn.rb +34 -0
  21. data/lib/cli/command/module/stage.rb +1 -1
  22. data/lib/cli/command/module/uninstall.rb +13 -7
  23. data/lib/cli/command/module.rb +14 -1
  24. data/lib/cli/command/options.rb +2 -0
  25. data/lib/cli/command/service/converge.rb +1 -1
  26. data/lib/cli/command/service/delete.rb +1 -1
  27. data/lib/cli/command/service/exec.rb +5 -2
  28. data/lib/cli/command/service/exec_sync.rb +4 -1
  29. data/lib/cli/command/service/{list_dependent_modules.rb → list_dependencies.rb} +3 -3
  30. data/lib/cli/command/service/uninstall.rb +11 -4
  31. data/lib/cli/command/service.rb +1 -1
  32. data/lib/cli/command/token.rb +3 -0
  33. data/lib/cli/command.rb +1 -1
  34. data/lib/cli/context/attributes.rb +1 -1
  35. data/lib/cli/context/type/account.rb +42 -0
  36. data/lib/cli/context/type/module.rb +2 -1
  37. data/lib/cli/context/type/service.rb +2 -1
  38. data/lib/cli/context.rb +82 -12
  39. data/lib/cli/version.rb +18 -2
  40. data/lib/client/git_repo/adapter/git_gem.rb +62 -4
  41. data/lib/client/git_repo.rb +33 -2
  42. data/lib/client/load_source/component_info.rb +44 -0
  43. data/lib/client/load_source/service_info.rb +47 -0
  44. data/lib/client/load_source.rb +148 -0
  45. data/lib/client/{util/module_ref.rb → module_ref.rb} +19 -0
  46. data/lib/client/operation/account/add_ssh_key.rb +47 -0
  47. data/lib/client/operation/account/delete_ssh_key.rb +41 -0
  48. data/lib/client/operation/account/list_ssh_keys.rb +28 -0
  49. data/lib/client/operation/account/register_catalog_user.rb +49 -0
  50. data/lib/client/operation/account/set_catalog_credentials.rb +32 -0
  51. data/lib/client/operation/account/set_password.rb +59 -0
  52. data/lib/client/operation/account.rb +7 -4
  53. data/lib/client/operation/client_module_dir/git_repo/internal/dtkn.rb +83 -0
  54. data/lib/client/operation/client_module_dir/git_repo/internal.rb +328 -0
  55. data/lib/client/operation/client_module_dir/git_repo.rb +73 -249
  56. data/lib/client/operation/client_module_dir.rb +2 -2
  57. data/lib/client/operation/module/clone_module.rb +41 -25
  58. data/lib/client/operation/module/delete_from_remote.rb +79 -0
  59. data/lib/client/operation/module/install/common_module.rb +10 -21
  60. data/lib/client/operation/module/install/dependent_modules/component_dependency_tree/cache.rb +47 -0
  61. data/lib/client/operation/module/install/dependent_modules/component_dependency_tree/resolve_modules.rb +69 -0
  62. data/lib/client/operation/module/install/dependent_modules/component_dependency_tree.rb +143 -0
  63. data/lib/client/operation/module/install/dependent_modules/component_module.rb +103 -0
  64. data/lib/client/operation/module/install/dependent_modules/prompt_helper.rb +54 -0
  65. data/lib/client/operation/module/install/dependent_modules.rb +65 -0
  66. data/lib/client/operation/module/install/mixin.rb +42 -0
  67. data/lib/client/operation/module/install/module_ref.rb +48 -0
  68. data/lib/client/operation/module/install/print_helper.rb +129 -0
  69. data/lib/client/operation/module/install.rb +68 -25
  70. data/lib/client/operation/module/install_from_catalog.rb +23 -32
  71. data/lib/client/operation/module/list.rb +4 -1
  72. data/lib/client/operation/module/publish.rb +78 -0
  73. data/lib/client/operation/module/pull_dtkn.rb +76 -0
  74. data/lib/client/operation/module/push.rb +16 -2
  75. data/lib/client/operation/module/push_dtkn/convert_source/component_info.rb +42 -0
  76. data/lib/client/operation/module/push_dtkn/convert_source/service_info.rb +47 -0
  77. data/lib/client/operation/module/push_dtkn/convert_source.rb +155 -0
  78. data/lib/client/operation/module/push_dtkn.rb +79 -0
  79. data/lib/client/operation/module/stage.rb +3 -2
  80. data/lib/client/operation/module/uninstall.rb +36 -0
  81. data/lib/client/operation/module.rb +23 -4
  82. data/lib/client/operation/service/converge.rb +3 -2
  83. data/lib/client/operation/service/delete.rb +2 -1
  84. data/lib/client/operation/service/destroy.rb +1 -1
  85. data/lib/client/operation/service/exec.rb +4 -0
  86. data/lib/client/operation/service/{list_dependent_modules.rb → list_dependencies.rb} +1 -1
  87. data/lib/client/operation/service/stage.rb +1 -1
  88. data/lib/client/operation/service/uninstall.rb +3 -3
  89. data/lib/client/operation/service.rb +1 -1
  90. data/lib/client/service_and_component_info/transform_from/info/component.rb +57 -0
  91. data/lib/client/service_and_component_info/transform_from/info/service.rb +53 -0
  92. data/lib/client/service_and_component_info/transform_from/info.rb +84 -0
  93. data/lib/client/service_and_component_info/transform_from.rb +47 -0
  94. data/lib/client/service_and_component_info/transform_to/info/component.rb +53 -0
  95. data/lib/client/service_and_component_info/transform_to/info/service.rb +49 -0
  96. data/lib/client/service_and_component_info/transform_to/info.rb +111 -0
  97. data/lib/client/service_and_component_info/transform_to.rb +49 -0
  98. data/lib/client/service_and_component_info.rb +26 -0
  99. data/lib/client/util/console.rb +22 -0
  100. data/lib/client/util/interactive_wizard.rb +90 -0
  101. data/lib/client/util.rb +18 -2
  102. data/lib/dtk_client.rb +5 -2
  103. metadata +63 -15
  104. data/lib/client/content_generator.rb +0 -189
  105. data/lib/client/operation/module/install/external_module.rb +0 -205
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d12c019fd00d94a4be0b393fc9ee0f9f3355095
4
- data.tar.gz: ab0b919677570741e387a4ed4ca0e01479c2607d
3
+ metadata.gz: dd1abbc6f5062ad48d35ba88b53cfaf6486c0aa2
4
+ data.tar.gz: df24b3e1f53d12977293b7622b52a2ed4f5db48a
5
5
  SHA512:
6
- metadata.gz: 08c9897c885fc0af755288124c43746e0edaa6477856ae649c7b576faf282772d2a04231327d96190ca479885447c1df96dbeb6da6a8709dbe6e69c23cacd708
7
- data.tar.gz: e9c8de28290402661d9db61cbbef3574abeb02f32f5a64a6b50a2e1cdd4453ff1ac1dc80e313ee730851867803ee6c9bf5198ff47828547a5c70986e356dc188
6
+ metadata.gz: 28a5f3cf4bf0c1788abb74067e73335626d82df5077a2007bd0619b2195fc7145d6618c00702c68cdd6f9a1aa600219b94619a3add7357ddfcaa4a062b23103b
7
+ data.tar.gz: 1b4369cfcca59952127f284185c190ab71543647ac46a73d6b119cf960a705554fc866676a2a8d40da4664dddcebc129c5bbbb8573b97fa55b12cb650f4075d4
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  *.gem
2
2
  sftp-config*.json
3
3
  .remote-sync.json
4
+ .remote-sync.json.bak
4
5
  .tags
5
6
  .tags1
6
7
  Gemfile.lock
data/.license_header ADDED
@@ -0,0 +1,15 @@
1
+ Copyright (C) 2010-2016 dtk contributors
2
+
3
+ This file is part of the dtk project.
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
data/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
data/README.md CHANGED
@@ -1,2 +1,25 @@
1
- # dtk-client2
2
- DTK client
1
+ DTK Client
2
+ ==============================
3
+
4
+
5
+ #### Description
6
+
7
+
8
+ DTK Client is a Ruby based CLI interface for communication with the DTK Server.
9
+ It's main purpose is to provide an easy to use interface for importing modules, browsing modules repository and deploying assemblies and topologies.
10
+
11
+ ## License
12
+
13
+ dtk-client is copyright (C) 2010-2016 dtk contributors
14
+
15
+ Licensed under the Apache License, Version 2.0 (the "License");
16
+ you may not use this work except in compliance with the License.
17
+ You may obtain a copy of the License in the [LICENSE](LICENSE) file, or at:
18
+
19
+ http://www.apache.org/licenses/LICENSE-2.0
20
+
21
+ Unless required by applicable law or agreed to in writing, software
22
+ distributed under the License is distributed on an "AS IS" BASIS,
23
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
+ See the License for the specific language governing permissions and
25
+ limitations under the License.
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ Rake::RDocTask.new do |rd|
10
10
  rd.title = 'Your application title'
11
11
  end
12
12
 
13
- spec = eval(File.read('dtk.gemspec'))
13
+ spec = eval(File.read('dtk-client.gemspec'))
14
14
 
15
15
  Gem::PackageTask.new(spec) do |pkg|
16
16
  end
@@ -42,3 +42,19 @@ Rake::TestTask.new do |t|
42
42
  end
43
43
 
44
44
  task :default => [:test,:features]
45
+
46
+ desc "Add copyright headers"
47
+ task :headers do
48
+ require 'rubygems'
49
+ require 'copyright_header'
50
+
51
+ args = {
52
+ :license_file => '.license_header',
53
+ :add_path => 'bin/:lib/:puppet/',
54
+ :output_dir => '.',
55
+ :guess_extension => true,
56
+ }
57
+
58
+ command_line = CopyrightHeader::CommandLine.new( args )
59
+ command_line.execute
60
+ end
data/bin/dtk CHANGED
@@ -1,4 +1,21 @@
1
1
  #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (C) 2010-2016 dtk contributors
4
+ #
5
+ # This file is part of the dtk project.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
2
19
  module DTK
3
20
  require_relative '../lib/dtk_client'
4
21
  module GlobalForDSL
@@ -11,4 +28,4 @@ module DTK
11
28
  require_relative '../lib/dtk_cli'
12
29
 
13
30
  Client::CLI::Runner.run(ARGV)
14
- end
31
+ end
@@ -0,0 +1,40 @@
1
+ #
2
+ # Copyright (C) 2010-2016 dtk contributors
3
+ #
4
+ # This file is part of the dtk project.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ module DTK::Client
19
+ module CLI::Command
20
+ module Account
21
+ subcommand_def 'add-ssh-key' do |c|
22
+ c.arg Token::Arg.keypair_name
23
+ command_body c, 'add-ssh-key', 'Adds SSH key for current user' do |sc|
24
+ sc.flag Token.directory_path
25
+ sc.action do |_global_options, options, args|
26
+ directory_path = options[:directory_path]
27
+ name = args[0]
28
+ args = {
29
+ :diretory_path => directory_path,
30
+ :name => name
31
+ }
32
+
33
+ Operation::Account.add_ssh_key(args)
34
+ end
35
+ end
36
+ end
37
+
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,43 @@
1
+ #
2
+ # Copyright (C) 2010-2016 dtk contributors
3
+ #
4
+ # This file is part of the dtk project.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ module DTK::Client
19
+ module CLI::Command
20
+ module Account
21
+ subcommand_def 'delete-ssh-key' do |c|
22
+ c.arg Token::Arg.keypair_name
23
+ command_body c, 'delete-ssh-key', 'Deletes SSH key for current user' do |sc|
24
+ sc.flag Token.directory_path
25
+ sc.switch Token.skip_prompt
26
+ sc.action do |_global_options, options, args|
27
+ skip_prompt = options[:skip_prompt]
28
+ directory_path = options[:directory_path]
29
+ name = args[0]
30
+ args = {
31
+ :directory_path => directory_path,
32
+ :name => name,
33
+ :skip_prompt => skip_prompt,
34
+ :username => Configurator.client_username
35
+ }
36
+ Operation::Account.delete_ssh_key(args)
37
+ end
38
+ end
39
+ end
40
+
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright (C) 2010-2016 dtk contributors
3
+ #
4
+ # This file is part of the dtk project.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ module DTK::Client
19
+ module CLI::Command
20
+ module Account
21
+ subcommand_def 'list-ssh-keys' do |c|
22
+ command_body c, 'list-ssh-keys', 'list-ssh-keys for current user' do |sc|
23
+ sc.action do
24
+ Operation::Account.list_ssh_keys
25
+ end
26
+ end
27
+ end
28
+
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright (C) 2010-2016 dtk contributors
3
+ #
4
+ # This file is part of the dtk project.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ module DTK::Client
19
+ module CLI::Command
20
+ module Account
21
+ subcommand_def 'register-catalog-user' do |c|
22
+ command_body c, 'register-catalog-user', 'Create your catalog user' do |sc|
23
+ sc.action do
24
+ Operation::Account.register_catalog_user
25
+ end
26
+ end
27
+ end
28
+
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright (C) 2010-2016 dtk contributors
3
+ #
4
+ # This file is part of the dtk project.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ module DTK::Client
19
+ module CLI::Command
20
+ module Account
21
+ subcommand_def 'set-catalog-credentials' do |c|
22
+ command_body c, 'set-catalog-credentials', 'Sets catalog credentials' do |sc|
23
+ sc.action do
24
+ Operation::Account.set_catalog_credentials
25
+ end
26
+ end
27
+ end
28
+
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright (C) 2010-2016 dtk contributors
3
+ #
4
+ # This file is part of the dtk project.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ module DTK::Client
19
+ module CLI::Command
20
+ module Account
21
+ subcommand_def 'set-password' do |c|
22
+ command_body c, 'set-password', 'Change password for your dtk user account' do |sc|
23
+ sc.action do
24
+ Operation::Account.set_password
25
+ end
26
+ end
27
+ end
28
+
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ #
2
+ # Copyright (C) 2010-2016 dtk contributors
3
+ #
4
+ # This file is part of the dtk project.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ module DTK::Client
19
+ module CLI
20
+ module Command
21
+ module Account
22
+ include Command::Mixin
23
+
24
+ ALL_SUBCOMMANDS = ['list-ssh-keys', 'delete-ssh-key', 'add-ssh-key', 'set-password', 'set-catalog-credentials', 'register-catalog-user']
25
+ command_def :desc => 'Subcommands for interacting with current Account'
26
+ ALL_SUBCOMMANDS.each { |subcommand| require_relative("account/#{subcommand.gsub(/-/,'_')}") }
27
+ end
28
+ end
29
+ end
30
+ end
31
+
@@ -67,7 +67,7 @@ module DTK::Client::CLI
67
67
  else
68
68
  desc opts[:desc] if opts[:desc]
69
69
  command command_name do |c|
70
- subcommand_mangled_methods.each do |subcommand_mangled_method|
70
+ subcommand_mangled_methods.each do |subcommand_mangled_method|
71
71
  instance_eval { send(subcommand_mangled_method, c) }
72
72
  end
73
73
  end
@@ -0,0 +1,36 @@
1
+ #
2
+ # Copyright (C) 2010-2016 dtk contributors
3
+ #
4
+ # This file is part of the dtk project.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ module DTK::Client
19
+ module CLI::Command
20
+ module Module
21
+ subcommand_def 'delete-from-remote' do |c|
22
+ c.arg Token::Arg.module_name
23
+ command_body c, 'delete-from-remote', 'Delete module from the DTK remote catalog (DTKN)' do |sc|
24
+ sc.flag Token.version
25
+ sc.switch Token.skip_prompt
26
+
27
+ sc.action do |_global_options, options, args|
28
+ module_ref = module_ref_in_options_or_context?(:module_ref => args[0], :version => options[:version])
29
+ Operation::Module.delete_from_remote(:module_ref => module_ref, :skip_prompt => options[:skip_prompt])
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+
@@ -30,9 +30,14 @@ module DTK::Client
30
30
  version = options[:version]
31
31
  skip_prompt = options[:skip_prompt]
32
32
 
33
- # install from dtkn (later probably from other remote catalogs)
33
+ has_remote_repo = false
34
34
  if module_name = args[0]
35
- module_ref = module_ref_in_options_or_context?(:module_ref => module_name, :version => (version || 'master'))
35
+ # reached if installing from dtkn
36
+ # installs content from dtkn (later probably from other remote catalogs) onto client machine
37
+ # in so doing installes depedent modules onto teh dtk server; this step though does not install main module onto
38
+ # server (the later step Operation::Module.install does this)
39
+ has_remote_repo = true
40
+ module_ref = module_ref_in_options_or_context?(:module_ref => module_name, :version => version)
36
41
  target_repo_dir = Operation::Module.install_from_catalog(:module_ref => module_ref, :version => options[:version], :directory_path => directory_path)
37
42
  end
38
43
 
@@ -44,9 +49,14 @@ module DTK::Client
44
49
 
45
50
  install_opts = directory_path ? { :directory_path => directory_path, :version => (version || 'master') } : options
46
51
  module_ref = module_ref_in_options_or_context?(install_opts)
47
- flag = true unless options["d"].nil?
48
-
49
- Operation::Module.install(:module_ref => module_ref, :base_dsl_file_obj => @base_dsl_file_obj, :flag => flag, :skip_prompt => skip_prompt)
52
+ operation_args = {
53
+ :module_ref => module_ref,
54
+ :base_dsl_file_obj => @base_dsl_file_obj,
55
+ :has_directory_param => !options["d"].nil?,
56
+ :skip_prompt => skip_prompt,
57
+ :has_remote_repo => has_remote_repo
58
+ }
59
+ Operation::Module.install(operation_args)
50
60
  end
51
61
  end
52
62
  end