crowbar-client 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (232) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +6 -0
  3. data/LICENSE +202 -0
  4. data/README.md +49 -0
  5. data/bin/crowbar +37 -0
  6. data/lib/crowbar-client.rb +17 -0
  7. data/lib/crowbar/client.rb +82 -0
  8. data/lib/crowbar/client/app.rb +60 -0
  9. data/lib/crowbar/client/app/barclamp.rb +77 -0
  10. data/lib/crowbar/client/app/base.rb +97 -0
  11. data/lib/crowbar/client/app/batch.rb +100 -0
  12. data/lib/crowbar/client/app/entry.rb +121 -0
  13. data/lib/crowbar/client/app/host_ip.rb +65 -0
  14. data/lib/crowbar/client/app/interface.rb +63 -0
  15. data/lib/crowbar/client/app/network.rb +35 -0
  16. data/lib/crowbar/client/app/node.rb +451 -0
  17. data/lib/crowbar/client/app/proposal.rb +300 -0
  18. data/lib/crowbar/client/app/repository.rb +149 -0
  19. data/lib/crowbar/client/app/reset.rb +58 -0
  20. data/lib/crowbar/client/app/role.rb +140 -0
  21. data/lib/crowbar/client/app/virtual_ip.rb +65 -0
  22. data/lib/crowbar/client/command.rb +54 -0
  23. data/lib/crowbar/client/command/barclamp.rb +26 -0
  24. data/lib/crowbar/client/command/barclamp/list.rb +64 -0
  25. data/lib/crowbar/client/command/base.rb +55 -0
  26. data/lib/crowbar/client/command/batch.rb +29 -0
  27. data/lib/crowbar/client/command/batch/build.rb +36 -0
  28. data/lib/crowbar/client/command/batch/export.rb +36 -0
  29. data/lib/crowbar/client/command/host_ip.rb +29 -0
  30. data/lib/crowbar/client/command/host_ip/allocate.rb +50 -0
  31. data/lib/crowbar/client/command/host_ip/deallocate.rb +42 -0
  32. data/lib/crowbar/client/command/interface.rb +29 -0
  33. data/lib/crowbar/client/command/interface/disable.rb +42 -0
  34. data/lib/crowbar/client/command/interface/enable.rb +50 -0
  35. data/lib/crowbar/client/command/node.rb +74 -0
  36. data/lib/crowbar/client/command/node/allocate.rb +48 -0
  37. data/lib/crowbar/client/command/node/delete.rb +44 -0
  38. data/lib/crowbar/client/command/node/hardware.rb +48 -0
  39. data/lib/crowbar/client/command/node/identify.rb +48 -0
  40. data/lib/crowbar/client/command/node/list.rb +71 -0
  41. data/lib/crowbar/client/command/node/powercycle.rb +48 -0
  42. data/lib/crowbar/client/command/node/poweroff.rb +48 -0
  43. data/lib/crowbar/client/command/node/poweron.rb +48 -0
  44. data/lib/crowbar/client/command/node/reboot.rb +48 -0
  45. data/lib/crowbar/client/command/node/reinstall.rb +48 -0
  46. data/lib/crowbar/client/command/node/rename.rb +44 -0
  47. data/lib/crowbar/client/command/node/reset.rb +48 -0
  48. data/lib/crowbar/client/command/node/role.rb +44 -0
  49. data/lib/crowbar/client/command/node/show.rb +67 -0
  50. data/lib/crowbar/client/command/node/shutdown.rb +48 -0
  51. data/lib/crowbar/client/command/node/status.rb +71 -0
  52. data/lib/crowbar/client/command/node/transition.rb +44 -0
  53. data/lib/crowbar/client/command/proposal.rb +44 -0
  54. data/lib/crowbar/client/command/proposal/commit.rb +50 -0
  55. data/lib/crowbar/client/command/proposal/create.rb +130 -0
  56. data/lib/crowbar/client/command/proposal/delete.rb +48 -0
  57. data/lib/crowbar/client/command/proposal/dequeue.rb +48 -0
  58. data/lib/crowbar/client/command/proposal/edit.rb +129 -0
  59. data/lib/crowbar/client/command/proposal/list.rb +68 -0
  60. data/lib/crowbar/client/command/proposal/show.rb +71 -0
  61. data/lib/crowbar/client/command/repository.rb +38 -0
  62. data/lib/crowbar/client/command/repository/activate.rb +44 -0
  63. data/lib/crowbar/client/command/repository/activate_all.rb +42 -0
  64. data/lib/crowbar/client/command/repository/deactivate.rb +44 -0
  65. data/lib/crowbar/client/command/repository/deactivate_all.rb +42 -0
  66. data/lib/crowbar/client/command/repository/list.rb +71 -0
  67. data/lib/crowbar/client/command/reset.rb +29 -0
  68. data/lib/crowbar/client/command/reset/nodes.rb +36 -0
  69. data/lib/crowbar/client/command/reset/proposal.rb +36 -0
  70. data/lib/crowbar/client/command/role.rb +29 -0
  71. data/lib/crowbar/client/command/role/list.rb +70 -0
  72. data/lib/crowbar/client/command/role/show.rb +70 -0
  73. data/lib/crowbar/client/command/virtual_ip.rb +29 -0
  74. data/lib/crowbar/client/command/virtual_ip/allocate.rb +50 -0
  75. data/lib/crowbar/client/command/virtual_ip/deallocate.rb +42 -0
  76. data/lib/crowbar/client/config.rb +178 -0
  77. data/lib/crowbar/client/filter.rb +33 -0
  78. data/lib/crowbar/client/filter/array.rb +29 -0
  79. data/lib/crowbar/client/filter/base.rb +41 -0
  80. data/lib/crowbar/client/filter/hash.rb +33 -0
  81. data/lib/crowbar/client/filter/subset.rb +45 -0
  82. data/lib/crowbar/client/formatter.rb +33 -0
  83. data/lib/crowbar/client/formatter/array.rb +49 -0
  84. data/lib/crowbar/client/formatter/base.rb +47 -0
  85. data/lib/crowbar/client/formatter/hash.rb +51 -0
  86. data/lib/crowbar/client/formatter/nested.rb +134 -0
  87. data/lib/crowbar/client/mixin.rb +30 -0
  88. data/lib/crowbar/client/mixin/barclamp.rb +41 -0
  89. data/lib/crowbar/client/mixin/filter.rb +33 -0
  90. data/lib/crowbar/client/mixin/format.rb +56 -0
  91. data/lib/crowbar/client/request.rb +57 -0
  92. data/lib/crowbar/client/request/barclamp.rb +26 -0
  93. data/lib/crowbar/client/request/barclamp/list.rb +35 -0
  94. data/lib/crowbar/client/request/base.rb +71 -0
  95. data/lib/crowbar/client/request/batch.rb +29 -0
  96. data/lib/crowbar/client/request/batch/build.rb +33 -0
  97. data/lib/crowbar/client/request/batch/export.rb +33 -0
  98. data/lib/crowbar/client/request/host_ip.rb +29 -0
  99. data/lib/crowbar/client/request/host_ip/allocate.rb +50 -0
  100. data/lib/crowbar/client/request/host_ip/deallocate.rb +48 -0
  101. data/lib/crowbar/client/request/interface.rb +29 -0
  102. data/lib/crowbar/client/request/interface/disable.rb +48 -0
  103. data/lib/crowbar/client/request/interface/enable.rb +48 -0
  104. data/lib/crowbar/client/request/node.rb +47 -0
  105. data/lib/crowbar/client/request/node/action.rb +39 -0
  106. data/lib/crowbar/client/request/node/delete.rb +38 -0
  107. data/lib/crowbar/client/request/node/list.rb +37 -0
  108. data/lib/crowbar/client/request/node/rename.rb +47 -0
  109. data/lib/crowbar/client/request/node/role.rb +47 -0
  110. data/lib/crowbar/client/request/node/show.rb +38 -0
  111. data/lib/crowbar/client/request/node/status.rb +36 -0
  112. data/lib/crowbar/client/request/node/transition.rb +48 -0
  113. data/lib/crowbar/client/request/party.rb +79 -0
  114. data/lib/crowbar/client/request/proposal.rb +47 -0
  115. data/lib/crowbar/client/request/proposal/commit.rb +40 -0
  116. data/lib/crowbar/client/request/proposal/create.rb +46 -0
  117. data/lib/crowbar/client/request/proposal/delete.rb +39 -0
  118. data/lib/crowbar/client/request/proposal/dequeue.rb +40 -0
  119. data/lib/crowbar/client/request/proposal/edit.rb +47 -0
  120. data/lib/crowbar/client/request/proposal/list.rb +38 -0
  121. data/lib/crowbar/client/request/proposal/show.rb +39 -0
  122. data/lib/crowbar/client/request/proposal/template.rb +39 -0
  123. data/lib/crowbar/client/request/repository.rb +38 -0
  124. data/lib/crowbar/client/request/repository/activate.rb +46 -0
  125. data/lib/crowbar/client/request/repository/activate_all.rb +37 -0
  126. data/lib/crowbar/client/request/repository/deactivate.rb +46 -0
  127. data/lib/crowbar/client/request/repository/deactivate_all.rb +37 -0
  128. data/lib/crowbar/client/request/repository/list.rb +36 -0
  129. data/lib/crowbar/client/request/reset.rb +29 -0
  130. data/lib/crowbar/client/request/reset/nodes.rb +33 -0
  131. data/lib/crowbar/client/request/reset/proposal.rb +33 -0
  132. data/lib/crowbar/client/request/role.rb +29 -0
  133. data/lib/crowbar/client/request/role/list.rb +38 -0
  134. data/lib/crowbar/client/request/role/show.rb +39 -0
  135. data/lib/crowbar/client/request/virtual_ip.rb +29 -0
  136. data/lib/crowbar/client/request/virtual_ip/allocate.rb +50 -0
  137. data/lib/crowbar/client/request/virtual_ip/deallocate.rb +48 -0
  138. data/lib/crowbar/client/util.rb +27 -0
  139. data/lib/crowbar/client/util/editor.rb +107 -0
  140. data/lib/crowbar/client/util/runner.rb +77 -0
  141. data/lib/crowbar/client/version.rb +33 -0
  142. data/spec/crowbar/client/app_spec.rb +21 -0
  143. data/spec/crowbar/client/command/barclamp/list_spec.rb +39 -0
  144. data/spec/crowbar/client/command/batch/build_spec.rb +39 -0
  145. data/spec/crowbar/client/command/batch/export_spec.rb +39 -0
  146. data/spec/crowbar/client/command/host_ip/allocate_spec.rb +39 -0
  147. data/spec/crowbar/client/command/host_ip/deallocate_spec.rb +39 -0
  148. data/spec/crowbar/client/command/interface/disable_spec.rb +39 -0
  149. data/spec/crowbar/client/command/interface/enable_spec.rb +39 -0
  150. data/spec/crowbar/client/command/node/allocate_spec.rb +39 -0
  151. data/spec/crowbar/client/command/node/delete_spec.rb +39 -0
  152. data/spec/crowbar/client/command/node/hardware_spec.rb +39 -0
  153. data/spec/crowbar/client/command/node/identify_spec.rb +39 -0
  154. data/spec/crowbar/client/command/node/list_spec.rb +39 -0
  155. data/spec/crowbar/client/command/node/powercycle_spec.rb +39 -0
  156. data/spec/crowbar/client/command/node/poweroff_spec.rb +39 -0
  157. data/spec/crowbar/client/command/node/poweron_spec.rb +39 -0
  158. data/spec/crowbar/client/command/node/reboot_spec.rb +39 -0
  159. data/spec/crowbar/client/command/node/reinstall_spec.rb +39 -0
  160. data/spec/crowbar/client/command/node/rename_spec.rb +39 -0
  161. data/spec/crowbar/client/command/node/reset_spec.rb +39 -0
  162. data/spec/crowbar/client/command/node/role_spec.rb +39 -0
  163. data/spec/crowbar/client/command/node/show_spec.rb +39 -0
  164. data/spec/crowbar/client/command/node/shutdown_spec.rb +39 -0
  165. data/spec/crowbar/client/command/node/status_spec.rb +39 -0
  166. data/spec/crowbar/client/command/node/transition_spec.rb +39 -0
  167. data/spec/crowbar/client/command/proposal/commit_spec.rb +39 -0
  168. data/spec/crowbar/client/command/proposal/create_spec.rb +61 -0
  169. data/spec/crowbar/client/command/proposal/delete_spec.rb +39 -0
  170. data/spec/crowbar/client/command/proposal/dequeue_spec.rb +39 -0
  171. data/spec/crowbar/client/command/proposal/edit_spec.rb +62 -0
  172. data/spec/crowbar/client/command/proposal/list_spec.rb +39 -0
  173. data/spec/crowbar/client/command/proposal/show_spec.rb +39 -0
  174. data/spec/crowbar/client/command/repository/activate_all_spec.rb +39 -0
  175. data/spec/crowbar/client/command/repository/activate_spec.rb +39 -0
  176. data/spec/crowbar/client/command/repository/deactivate_all_spec.rb +39 -0
  177. data/spec/crowbar/client/command/repository/deactivate_spec.rb +39 -0
  178. data/spec/crowbar/client/command/repository/list_spec.rb +39 -0
  179. data/spec/crowbar/client/command/reset/nodes_spec.rb +39 -0
  180. data/spec/crowbar/client/command/reset/proposal_spec.rb +39 -0
  181. data/spec/crowbar/client/command/role/list_spec.rb +39 -0
  182. data/spec/crowbar/client/command/role/show_spec.rb +39 -0
  183. data/spec/crowbar/client/command/virtual_ip/allocate_spec.rb +39 -0
  184. data/spec/crowbar/client/command/virtual_ip/deallocate_spec.rb +39 -0
  185. data/spec/crowbar/client/filter/array_spec.rb +65 -0
  186. data/spec/crowbar/client/filter/hash_spec.rb +65 -0
  187. data/spec/crowbar/client/filter/subset_spec.rb +77 -0
  188. data/spec/crowbar/client/formatter/array_spec.rb +102 -0
  189. data/spec/crowbar/client/formatter/hash_spec.rb +108 -0
  190. data/spec/crowbar/client/formatter/nested_spec.rb +106 -0
  191. data/spec/crowbar/client/request/barclamp/list_spec.rb +50 -0
  192. data/spec/crowbar/client/request/batch/build_spec.rb +64 -0
  193. data/spec/crowbar/client/request/batch/export_spec.rb +64 -0
  194. data/spec/crowbar/client/request/host_ip/allocate_spec.rb +61 -0
  195. data/spec/crowbar/client/request/host_ip/deallocate_spec.rb +57 -0
  196. data/spec/crowbar/client/request/interface/disable_spec.rb +57 -0
  197. data/spec/crowbar/client/request/interface/enable_spec.rb +57 -0
  198. data/spec/crowbar/client/request/node/action_spec.rb +53 -0
  199. data/spec/crowbar/client/request/node/delete_spec.rb +52 -0
  200. data/spec/crowbar/client/request/node/list_spec.rb +50 -0
  201. data/spec/crowbar/client/request/node/rename_spec.rb +55 -0
  202. data/spec/crowbar/client/request/node/role_spec.rb +55 -0
  203. data/spec/crowbar/client/request/node/show_spec.rb +52 -0
  204. data/spec/crowbar/client/request/node/status_spec.rb +50 -0
  205. data/spec/crowbar/client/request/node/transition_spec.rb +56 -0
  206. data/spec/crowbar/client/request/party_spec.rb +24 -0
  207. data/spec/crowbar/client/request/proposal/commit_spec.rb +53 -0
  208. data/spec/crowbar/client/request/proposal/create_spec.rb +56 -0
  209. data/spec/crowbar/client/request/proposal/delete_spec.rb +53 -0
  210. data/spec/crowbar/client/request/proposal/dequeue_spec.rb +53 -0
  211. data/spec/crowbar/client/request/proposal/edit_spec.rb +56 -0
  212. data/spec/crowbar/client/request/proposal/list_spec.rb +52 -0
  213. data/spec/crowbar/client/request/proposal/show_spec.rb +53 -0
  214. data/spec/crowbar/client/request/proposal/template_spec.rb +52 -0
  215. data/spec/crowbar/client/request/repository/activate_all_spec.rb +50 -0
  216. data/spec/crowbar/client/request/repository/activate_spec.rb +56 -0
  217. data/spec/crowbar/client/request/repository/deactivate_all_spec.rb +50 -0
  218. data/spec/crowbar/client/request/repository/deactivate_spec.rb +56 -0
  219. data/spec/crowbar/client/request/repository/list_spec.rb +50 -0
  220. data/spec/crowbar/client/request/reset/nodes_spec.rb +55 -0
  221. data/spec/crowbar/client/request/reset/proposal_spec.rb +55 -0
  222. data/spec/crowbar/client/request/role/list_spec.rb +52 -0
  223. data/spec/crowbar/client/request/role/show_spec.rb +53 -0
  224. data/spec/crowbar/client/request/virtual_ip/allocate_spec.rb +61 -0
  225. data/spec/crowbar/client/request/virtual_ip/deallocate_spec.rb +57 -0
  226. data/spec/crowbar/client/util/editor_spec.rb +108 -0
  227. data/spec/crowbar/client/util/runner_spec.rb +24 -0
  228. data/spec/crowbar/client_spec.rb +21 -0
  229. data/spec/spec_helper.rb +55 -0
  230. data/spec/support/command_context.rb +37 -0
  231. data/spec/support/request_examples.rb +55 -0
  232. metadata +549 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0c18e5df2ea70b1697ba57e2c7e926aff7c572d5
4
+ data.tar.gz: d35e7aa16fc10cd125a8fcb8d59c07ccdd0e9be7
5
+ SHA512:
6
+ metadata.gz: f72caa6cec281fe163caf49b14644616b6c70bee7f7db4d20088b337b97612c647f9ab390b47ce89df9e93c5aa233bfa74cd80037af36c2a5cc7d1eafc37ba86
7
+ data.tar.gz: 5c1bcedec32a958c13445941b101c6dfa3ecb55d0c396160a7d982106310511c5e3afaf2fae310b831d7468fd48b9c622e947d7463dc3f7e1566477b75ae646e
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # Changelog
2
+
3
+
4
+ ## [1.0.0](https://github.com/crowbar/crowbar-client/releases/tag/v1.0.0) - 2015-11-11
5
+
6
+ * Initial release
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 ADDED
@@ -0,0 +1,49 @@
1
+ # Crowbar: Client
2
+
3
+ This is an experimental implementation to replace the current CLI scripts of
4
+ the crowbar barclamps. This tool is intended to be installable standalone,
5
+ that way everybody who got access to the Crowbar admin network should be able
6
+ to manage Crowbar from remote.
7
+
8
+ The [Crowbar Framework](https://github.com/crowbar/crowbar) is currently
9
+ maintained by [SUSE](http://www.suse.com/) as an [OpenStack](http://openstack.org)
10
+ installation framework but is prepared to be a much broader function tool. It
11
+ was originally developed by the [Dell CloudEdge Solutions Team](http://dell.com/openstack).
12
+
13
+ ## Badges
14
+
15
+ [![Build Status](https://secure.travis-ci.org/crowbar/crowbar-client.svg)](https://travis-ci.org/crowbar/crowbar-client)
16
+ [![Code Climate](https://codeclimate.com/github/crowbar/crowbar-client.svg)](https://codeclimate.com/github/crowbar/crowbar-client)
17
+ [![Test Coverage](https://codeclimate.com/github/crowbar/crowbar-client/badges/coverage.svg)](https://codeclimate.com/github/crowbar/crowbar-client)
18
+ [![Dependency Status](https://gemnasium.com/crowbar/crowbar-client.svg)](https://gemnasium.com/crowbar/crowbar-client)
19
+ [![Join the chat at https://gitter.im/crowbar/crowbar](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/crowbar/crowbar)
20
+
21
+ ## Install
22
+
23
+ To install this simple rubygem you can check your package manager if it is
24
+ available for you, alternativly you can just install the ruby gem if you have a
25
+ running ruby stack on your machine with this command:
26
+
27
+ ```
28
+ gem install crowbar-client
29
+ ```
30
+
31
+ ## Contributing
32
+
33
+ Fork -> Patch -> Spec -> Push -> Pull Request
34
+
35
+ ## Contact
36
+
37
+ To get in contact with the developers you have multiple options, all of them
38
+ are listed below:
39
+
40
+ * [Google Mailinglist](https://groups.google.com/forum/#!forum/crowbar)
41
+ * [Gitter Chat](https://gitter.im/crowbar/crowbar)
42
+ * [Freenode Webchat](http://webchat.freenode.net/?channels=%23crowbar)
43
+
44
+ ## Legals
45
+
46
+ Unless required by applicable law or agreed to in writing, software distributed
47
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
48
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
49
+ specific language governing permissions and limitations under the License.
data/bin/crowbar ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright 2015, SUSE Linux GmbH
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.
16
+ #
17
+
18
+ $LOAD_PATH.push File.expand_path("../../lib", __FILE__)
19
+
20
+ Signal.trap("INT") do
21
+ abort
22
+ end
23
+
24
+ begin
25
+ require "crowbar/client"
26
+ rescue LoadError
27
+ require "rubygems"
28
+ require "crowbar/client"
29
+ end
30
+
31
+ begin
32
+ Crowbar::Client::Util::Runner.new(
33
+ ARGV.dup
34
+ ).execute!
35
+ rescue Interrupt
36
+ abort "Quitting..."
37
+ end
@@ -0,0 +1,17 @@
1
+ #
2
+ # Copyright 2015, SUSE Linux GmbH
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ require_relative "crowbar/client"
@@ -0,0 +1,82 @@
1
+ #
2
+ # Copyright 2015, SUSE Linux GmbH
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ ENV["CURRENT_GEMFILE"] ||= File.expand_path("../../../Gemfile", __FILE__)
18
+
19
+ if File.exist? ENV["CURRENT_GEMFILE"]
20
+ require "bundler"
21
+ Bundler.setup(:default)
22
+ end
23
+
24
+ require "active_support/all"
25
+
26
+ module Crowbar
27
+ module Client
28
+ class SimpleCatchableError < StandardError
29
+ end
30
+
31
+ class BadFormatterError < SimpleCatchableError
32
+ end
33
+
34
+ class BadFilterError < SimpleCatchableError
35
+ end
36
+
37
+ class InvalidFormatError < SimpleCatchableError
38
+ end
39
+
40
+ class EditorAbortError < SimpleCatchableError
41
+ end
42
+
43
+ class EditorStartupError < SimpleCatchableError
44
+ end
45
+
46
+ class InvalidJsonError < SimpleCatchableError
47
+ end
48
+
49
+ class UnavailableBarclampError < SimpleCatchableError
50
+ def initialize(barclamp)
51
+ super("Barclamp #{barclamp} is not available")
52
+ end
53
+ end
54
+
55
+ autoload :App,
56
+ File.expand_path("../client/app", __FILE__)
57
+
58
+ autoload :Command,
59
+ File.expand_path("../client/command", __FILE__)
60
+
61
+ autoload :Config,
62
+ File.expand_path("../client/config", __FILE__)
63
+
64
+ autoload :Filter,
65
+ File.expand_path("../client/filter", __FILE__)
66
+
67
+ autoload :Formatter,
68
+ File.expand_path("../client/formatter", __FILE__)
69
+
70
+ autoload :Mixin,
71
+ File.expand_path("../client/mixin", __FILE__)
72
+
73
+ autoload :Request,
74
+ File.expand_path("../client/request", __FILE__)
75
+
76
+ autoload :Util,
77
+ File.expand_path("../client/util", __FILE__)
78
+
79
+ autoload :Version,
80
+ File.expand_path("../client/version", __FILE__)
81
+ end
82
+ end
@@ -0,0 +1,60 @@
1
+ #
2
+ # Copyright 2015, SUSE Linux GmbH
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ module Crowbar
18
+ module Client
19
+ module App
20
+ autoload :Barclamp,
21
+ File.expand_path("../app/barclamp", __FILE__)
22
+
23
+ autoload :Base,
24
+ File.expand_path("../app/base", __FILE__)
25
+
26
+ autoload :Batch,
27
+ File.expand_path("../app/batch", __FILE__)
28
+
29
+ autoload :Entry,
30
+ File.expand_path("../app/entry", __FILE__)
31
+
32
+ autoload :HostIp,
33
+ File.expand_path("../app/host_ip", __FILE__)
34
+
35
+ autoload :Interface,
36
+ File.expand_path("../app/interface", __FILE__)
37
+
38
+ autoload :Network,
39
+ File.expand_path("../app/network", __FILE__)
40
+
41
+ autoload :Node,
42
+ File.expand_path("../app/node", __FILE__)
43
+
44
+ autoload :Proposal,
45
+ File.expand_path("../app/proposal", __FILE__)
46
+
47
+ autoload :Repository,
48
+ File.expand_path("../app/repository", __FILE__)
49
+
50
+ autoload :Reset,
51
+ File.expand_path("../app/reset", __FILE__)
52
+
53
+ autoload :Role,
54
+ File.expand_path("../app/role", __FILE__)
55
+
56
+ autoload :VirtualIp,
57
+ File.expand_path("../app/virtual_ip", __FILE__)
58
+ end
59
+ end
60
+ end