Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit for serengeti webservice and cli

  • Loading branch information...
commit a7b1abaee547a48677b4bcd2a7c2c716ab9e2633 0 parents
Serengeti Engineer authored
Showing with 22,721 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +325 −0 LICENSE
  3. +10 −0 NOTICE
  4. +52 −0 README.md
  5. +805 −0 cli/README.md
  6. +3 −0  cli/cli.properties
  7. +137 −0 cli/pom.xml
  8. +48 −0 cli/sample.spec
  9. +71 −0 cli/src/main/java/com/vmware/bdd/cli/commands/CliBannerProvider.java
  10. +33 −0 cli/src/main/java/com/vmware/bdd/cli/commands/CliHistoryFileProvider.java
  11. +34 −0 cli/src/main/java/com/vmware/bdd/cli/commands/CliPromptProvider.java
  12. +683 −0 cli/src/main/java/com/vmware/bdd/cli/commands/ClusterCommands.java
  13. +277 −0 cli/src/main/java/com/vmware/bdd/cli/commands/CommandsUtils.java
  14. +42 −0 cli/src/main/java/com/vmware/bdd/cli/commands/ConnectionCommands.java
  15. +172 −0 cli/src/main/java/com/vmware/bdd/cli/commands/Constants.java
  16. +205 −0 cli/src/main/java/com/vmware/bdd/cli/commands/DatastoreCommands.java
  17. +92 −0 cli/src/main/java/com/vmware/bdd/cli/commands/DistroCommands.java
  18. +506 −0 cli/src/main/java/com/vmware/bdd/cli/commands/NetworkCommands.java
  19. +50 −0 cli/src/main/java/com/vmware/bdd/cli/commands/NodeCommands.java
  20. +174 −0 cli/src/main/java/com/vmware/bdd/cli/commands/ResourcePoolCommands.java
  21. +23 −0 cli/src/main/java/com/vmware/bdd/cli/rest/CliRestException.java
  22. +172 −0 cli/src/main/java/com/vmware/bdd/cli/rest/ClusterRestClient.java
  23. +57 −0 cli/src/main/java/com/vmware/bdd/cli/rest/DatastoreRestClient.java
  24. +42 −0 cli/src/main/java/com/vmware/bdd/cli/rest/DistroRestClient.java
  25. +76 −0 cli/src/main/java/com/vmware/bdd/cli/rest/NetworkRestClient.java
  26. +35 −0 cli/src/main/java/com/vmware/bdd/cli/rest/NodeRestClient.java
  27. +30 −0 cli/src/main/java/com/vmware/bdd/cli/rest/PrettyOutput.java
  28. +57 −0 cli/src/main/java/com/vmware/bdd/cli/rest/ResourcePoolRestClient.java
  29. +477 −0 cli/src/main/java/com/vmware/bdd/cli/rest/RestClient.java
  30. +53 −0 cli/src/main/java/com/vmware/bdd/cli/rest/RestErrorHandler.java
  31. +22 −0 cli/src/main/resources/META-INF/spring/applicationContext-beans.xml
  32. +11 −0 cli/src/main/resources/META-INF/spring/spring-shell-plugin.xml
  33. +25 −0 cli/src/site/site.xml
  34. +375 −0 cli/src/test/java/com/vmware/bdd/cli/command/tests/ClusterCommandsTest.java
  35. +152 −0 cli/src/test/java/com/vmware/bdd/cli/command/tests/CommandsUtilsTest.java
  36. +160 −0 cli/src/test/java/com/vmware/bdd/cli/command/tests/DatastoreCommandsTest.java
  37. +86 −0 cli/src/test/java/com/vmware/bdd/cli/command/tests/DistroCommandsTest.java
  38. +74 −0 cli/src/test/java/com/vmware/bdd/cli/command/tests/MockRestServer.java
  39. +310 −0 cli/src/test/java/com/vmware/bdd/cli/command/tests/NetworkCommandsTest.java
  40. +82 −0 cli/src/test/java/com/vmware/bdd/cli/command/tests/NetworkRestClientTest.java
  41. +94 −0 cli/src/test/java/com/vmware/bdd/cli/command/tests/RestClientTest.java
  42. +176 −0 cli/src/test/java/com/vmware/bdd/cli/command/tests/RpCommandsTest.java
  43. +6 −0 cli/src/test/resources/log4j.properties
  44. +28 −0 common/pom.xml
  45. +3 −0  common/src/main/java/META-INF/MANIFEST.MF
  46. +51 −0 common/src/main/java/com/vmware/bdd/apitypes/BddErrorMessage.java
  47. +180 −0 common/src/main/java/com/vmware/bdd/apitypes/ClusterCreate.java
  48. +167 −0 common/src/main/java/com/vmware/bdd/apitypes/ClusterRead.java
  49. +28 −0 common/src/main/java/com/vmware/bdd/apitypes/Datastore.java
  50. +59 −0 common/src/main/java/com/vmware/bdd/apitypes/DatastoreAdd.java
  51. +95 −0 common/src/main/java/com/vmware/bdd/apitypes/DatastoreRead.java
  52. +76 −0 common/src/main/java/com/vmware/bdd/apitypes/DatastoreReadDetail.java
  53. +35 −0 common/src/main/java/com/vmware/bdd/apitypes/DistroRead.java
  54. +87 −0 common/src/main/java/com/vmware/bdd/apitypes/IpAllocEntryRead.java
  55. +59 −0 common/src/main/java/com/vmware/bdd/apitypes/IpBlock.java
  56. +177 −0 common/src/main/java/com/vmware/bdd/apitypes/NetworkAdd.java
  57. +143 −0 common/src/main/java/com/vmware/bdd/apitypes/NetworkRead.java
  58. +55 −0 common/src/main/java/com/vmware/bdd/apitypes/NodeGroup.java
  59. +162 −0 common/src/main/java/com/vmware/bdd/apitypes/NodeGroupCreate.java
  60. +115 −0 common/src/main/java/com/vmware/bdd/apitypes/NodeGroupRead.java
  61. +113 −0 common/src/main/java/com/vmware/bdd/apitypes/NodeRead.java
  62. +48 −0 common/src/main/java/com/vmware/bdd/apitypes/ResourcePoolAdd.java
  63. +100 −0 common/src/main/java/com/vmware/bdd/apitypes/ResourcePoolRead.java
  64. +69 −0 common/src/main/java/com/vmware/bdd/apitypes/StorageRead.java
  65. +84 −0 common/src/main/java/com/vmware/bdd/apitypes/TaskRead.java
  66. +70 −0 common/src/main/java/com/vmware/bdd/spectypes/GroupType.java
  67. +56 −0 common/src/main/java/com/vmware/bdd/spectypes/HadoopDistroMap.java
  68. +46 −0 common/src/main/java/com/vmware/bdd/spectypes/HadoopRole.java
  69. +73 −0 common/src/main/java/com/vmware/bdd/spectypes/VcCluster.java
  70. +175 −0 common/src/test/java/com/vmware/bdd/apitypes/BeanToJsonTest.java
  71. +32 −0 distribute/.chef/knife.rb
  72. +75 −0 distribute/agent/get_json_value.py
  73. +44 −0 distribute/agent/machine_id_guest_var
  74. +28 −0 distribute/agent/mount_swap_disk.sh
  75. +235 −0 distribute/agent/setup-ip.py
  76. +53 −0 distribute/etc/AGENT_README
  77. +20 −0 distribute/etc/distro-manifest
  78. +129 −0 distribute/etc/schema.sql
  79. +28 −0 distribute/etc/serengeti-agent.sh
  80. +165 −0 distribute/etc/tomcat
  81. +12 −0 distribute/sbin/LICENSE
  82. +24 −0 distribute/sbin/ironfan_proxy.sh
  83. +32 −0 distribute/sbin/kill_task.sh
  84. +3 −0  distribute/sbin/rack_host.desc.sample
  85. +7 −0 distribute/sbin/serengeti-chef-init.sh
  86. +240 −0 distribute/sbin/serengeti-firstboot.rb
  87. +27 −0 distribute/sbin/serengeti-knife-config
  88. +11 −0 distribute/sbin/serengeti-start-services.sh
  89. +24 −0 distribute/sbin/serengeti-stop-services.sh
  90. +189 −0 distribute/sbin/serengeti-subsequentboot.rb
  91. +94 −0 distribute/sbin/topology-generator.rb
  92. +15 −0 distribute/sbin/topology.readme
  93. +23 −0 distribute/sbin/topology.sh
  94. BIN  doc/ws-architecture.png
  95. +27 −0 maven-settings.xml
  96. +220 −0 pom.xml
  97. +8 −0 server/README
  98. +54 −0 server/serengeti/WebContent/WEB-INF/applicationContext.xml
  99. +32 −0 server/serengeti/WebContent/WEB-INF/restapi-servlet.xml
  100. +37 −0 server/serengeti/WebContent/WEB-INF/web.xml
  101. +130 −0 server/serengeti/pom.xml
  102. +500 −0 server/serengeti/src/main/java/com/vmware/bdd/dal/DAL.java
  103. +85 −0 server/serengeti/src/main/java/com/vmware/bdd/entity/CloudProviderConfigEntity.java
  104. +263 −0 server/serengeti/src/main/java/com/vmware/bdd/entity/ClusterEntity.java
  105. +48 −0 server/serengeti/src/main/java/com/vmware/bdd/entity/EntityBase.java
  106. +204 −0 server/serengeti/src/main/java/com/vmware/bdd/entity/HadoopNodeEntity.java
  107. +545 −0 server/serengeti/src/main/java/com/vmware/bdd/entity/IpBlockEntity.java
  108. +578 −0 server/serengeti/src/main/java/com/vmware/bdd/entity/NetworkEntity.java
  109. +340 −0 server/serengeti/src/main/java/com/vmware/bdd/entity/NodeGroupEntity.java
  110. +23 −0 server/serengeti/src/main/java/com/vmware/bdd/entity/Saveable.java
  111. +317 −0 server/serengeti/src/main/java/com/vmware/bdd/entity/TaskEntity.java
  112. +113 −0 server/serengeti/src/main/java/com/vmware/bdd/entity/VcDataStoreEntity.java
  113. +167 −0 server/serengeti/src/main/java/com/vmware/bdd/entity/VcResourcePoolEntity.java
  114. +131 −0 server/serengeti/src/main/java/com/vmware/bdd/exception/BddException.java
  115. +69 −0 server/serengeti/src/main/java/com/vmware/bdd/exception/ClusterConfigException.java
  116. +69 −0 server/serengeti/src/main/java/com/vmware/bdd/exception/ClusterManagerException.java
  117. +26 −0 server/serengeti/src/main/java/com/vmware/bdd/exception/DalException.java
  118. +55 −0 server/serengeti/src/main/java/com/vmware/bdd/exception/NetworkException.java
  119. +29 −0 server/serengeti/src/main/java/com/vmware/bdd/exception/TaskException.java
  120. +37 −0 server/serengeti/src/main/java/com/vmware/bdd/exception/TemplateClusterException.java
  121. +32 −0 server/serengeti/src/main/java/com/vmware/bdd/exception/TxRetryException.java
  122. +33 −0 server/serengeti/src/main/java/com/vmware/bdd/exception/UniqueConstraintViolationException.java
  123. +53 −0 server/serengeti/src/main/java/com/vmware/bdd/exception/VcProviderException.java
  124. +23 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/CloudProviderManager.java
  125. +557 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/ClusterConfigManager.java
  126. +424 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/ClusterManager.java
  127. +218 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/DistroManager.java
  128. +352 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/NetworkManager.java
  129. +176 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/TaskManager.java
  130. +236 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/VcDataStoreManager.java
  131. +205 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/VcProviderManager.java
  132. +228 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/VcResourcePoolManager.java
  133. +89 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/task/CreateClusterListener.java
  134. +91 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/task/DeleteClusterListener.java
  135. +87 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/task/LegacyTaskCleanner.java
  136. +128 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/task/MessageProcessor.java
  137. +87 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/task/StartClusterListener.java
  138. +87 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/task/StopClusterListener.java
  139. +99 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/task/StreamReaper.java
  140. +253 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/task/Task.java
  141. +42 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/task/TaskListener.java
  142. +45 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/task/TracedRunnable.java
  143. +87 −0 server/serengeti/src/main/java/com/vmware/bdd/manager/task/UpdateClusterListener.java
  144. +421 −0 server/serengeti/src/main/java/com/vmware/bdd/rest/RestResource.java
  145. +177 −0 server/serengeti/src/main/java/com/vmware/bdd/specpolicy/CommonClusterExpandPolicy.java
  146. +124 −0 server/serengeti/src/main/java/com/vmware/bdd/specpolicy/FillRequiredHadoopGroups.java
  147. +172 −0 server/serengeti/src/main/java/com/vmware/bdd/specpolicy/TemplateClusterSpec.java
  148. +60 −0 server/serengeti/src/main/java/com/vmware/bdd/utils/AuAssert.java
  149. +189 −0 server/serengeti/src/main/java/com/vmware/bdd/utils/BddMessageUtil.java
  150. +60 −0 server/serengeti/src/main/java/com/vmware/bdd/utils/ClusterCmdUtil.java
  151. +70 −0 server/serengeti/src/main/java/com/vmware/bdd/utils/ConfigInfo.java
  152. +231 −0 server/serengeti/src/main/java/com/vmware/bdd/utils/Configuration.java
  153. +33 −0 server/serengeti/src/main/java/com/vmware/bdd/utils/Functor.java
  154. +181 −0 server/serengeti/src/main/java/com/vmware/bdd/utils/IpAddressUtil.java
  155. +246 −0 server/serengeti/src/main/java/com/vmware/bdd/utils/RabbitMQConsumer.java
  156. +30 −0 server/serengeti/src/main/resources/hibernate.cfg.xml
  157. +21 −0 server/serengeti/src/main/resources/log4j.properties
  158. +54 −0 server/serengeti/src/main/resources/serengeti-errcode.properties
  159. +66 −0 server/serengeti/src/main/resources/serengeti-errmsg.properties
  160. +58 −0 server/serengeti/src/main/resources/serengeti.properties
  161. +36 −0 server/serengeti/src/main/resources/template-cluster-spec.json
  162. +165 −0 server/serengeti/src/test/java/com/vmware/bdd/dal/TestDAL.java
  163. +336 −0 server/serengeti/src/test/java/com/vmware/bdd/dal/TestIpBlockEntity.java
  164. +276 −0 server/serengeti/src/test/java/com/vmware/bdd/dal/TestNetworkEntity.java
  165. +521 −0 server/serengeti/src/test/java/com/vmware/bdd/manager/TestClusterConfigManager.java
  166. +468 −0 server/serengeti/src/test/java/com/vmware/bdd/manager/TestClusterManager.java
  167. +61 −0 server/serengeti/src/test/java/com/vmware/bdd/manager/TestListener.java
  168. +140 −0 server/serengeti/src/test/java/com/vmware/bdd/manager/TestTaskManager.java
  169. +260 −0 server/serengeti/src/test/java/com/vmware/bdd/manager/TestVcProviderManager.java
  170. +131 −0 server/serengeti/src/test/java/com/vmware/bdd/utils/TestIpAddressUtil.java
  171. +31 −0 server/serengeti/src/test/resources/hibernate.cfg.xml
  172. +5 −0 server/serengeti/src/test/resources/log4j.properties
  173. +137 −0 server/serengeti/src/test/resources/sampleMsg.json
  174. +40 −0 server/serengeti/src/test/resources/serengeti.properties
4 .gitignore
@@ -0,0 +1,4 @@
+.classpath
+.project
+**.settings
+**target
325 LICENSE
@@ -0,0 +1,325 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+=======================================================================
+
+Serengeti 0.5:
+
+Serengeti 0.5 includes a number of subcomponents with
+separate copyright notices and license terms. The product that
+includes this file does not necessarily use all the open source
+subcomponents referred to below. Your use of the source
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses.
+
+SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES
+
+ >>> rubygem-fog-1.3.1
+
+
+SECTION 2: Apache License, V2.0
+
+ >>> ironfan-homebase-none
+ >>> rubygem-ironfan-3.1.4
+
+BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES are applicable to the following component(s).
+
+
+>>> rubygem-fog-1.3.1
+
+== Copyright
+
+(The MIT License)
+
+Copyright (c) 2010 {geemus (Wesley Beary)}[http://github.com/geemus]
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+--------------- SECTION 2: Apache License, V2.0 ----------
+
+Apache License, V2.0 is applicable to the following component(s).
+
+
+>>> ironfan-homebase-none
+
+License: Apache 2.0
+
+
+>>> rubygem-ironfan-3.1.4
+
+Author:: Philip (flip) Kromer (<flip@infochimps.com>)
+Copyright:: Copyright (c) 2011 Infochimps, Inc
+License:: Apache License, Version 2.0
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+
+
+
+===========================================================================
+
+To the extent any open source components are licensed under the
+GPL and/or LGPL, or other similar licenses that require the
+source code and/or modifications to source code to be made
+available (as would be noted above), you may obtain a copy of
+the source code corresponding to the binaries for such open
+source components and modifications thereto, if any, (the
+"Source Files"), by downloading the Source Files from VMware's website at
+http://www.vmware.com/download/open_source.html, or by sending a request, with
+your name and address to: VMware, Inc., 3401 Hillview Avenue,
+Palo Alto, CA 94304,United States of America. All such
+requests should clearly specify: OPEN SOURCE FILES REQUEST,
+Attention General Counsel. VMware shall mail a copy of the
+Source Files to you on a CD or equivalent physical medium. This
+offer to obtain a copy of the Source Files is valid for three
+years from the date you acquired this Software product. Alternatively,
+the Source Files may accompany the VMware product.
+
+[VHELPER10KV060112]
10 NOTICE
@@ -0,0 +1,10 @@
+Serengeti 0.5
+Copyright (c) 2012 VMware, Inc. All Rights Reserved.
+
+This product is licensed to you under the Apache License, Version 2.0 (the "License").
+You may not use this product except in compliance with the License.
+
+This product may include a number of subcomponents with
+separate copyright notices and license terms. Your use of the source
+code for the these subcomponents is subject to the terms and
+conditions of the subcomponent's license, as noted in the LICENSE file.
52 README.md
@@ -0,0 +1,52 @@
+# serengeti-ws: Serengeti's Web service and CLI
+Serengeti helps you deploy Hadoop clusters on vSphere fast and easy. It's a management service, which makes user start with Hadoop very easy.
+This repo holds Serengeti Web Service and CLI.
+
+## Getting Started
+To jump into using Serengeti, follow our Installation Instructions.
+
+## Serengeti Web Service
+Serengeti Web Service provides RESTful API for VC resources managment and hadoop cluster spec management. It works as a proxy to invoke Serengeti provision engine and return fine-grained process execution status to caller.
+
+### Web service architecture
+![Web service architecture (doc/ws-architecture.png)](https://github.com/vmware-serengeti/serengeti-ws/raw/master/doc/ws-architecture.png "web service architecture")
+
+### Web service APIs
+<table>
+<tr><td>Method</td><td>URL Template</td><td>Request</td><td>Response</td><td>Description</td></tr>
+<tr><td>GET</td><td>/hello</td><td>void</td><td>void</td><td></td></tr>
+<tr><td>GET</td><td>/tasks</td><td>void</td><td>List of TaskRead</td><td>List all tasks</td></tr>
+<tr><td>GET</td><td>/task/{taskId}</td><td>taskId</td><td>TaskRead</td><td>Get task by task id</td></tr>
+<tr><td>POST</td><td>/clusters</td><td>ClusterCreate</td><td>Redirect to /task/{taskId}</td><td>Create cluster</td></tr>
+<tr><td>GET</td><td>/clusters</td><td>void</td><td>List of ClusterRead</td><td>List all clusters</td></tr>
+<tr><td>GET</td><td>/cluster/{clusterName}</td><td>clusterName</td><td>ClusterRead</td><td>Get cluster by name</td></tr>
+<tr><td>PUT</td><td>/cluster/{clusterName}</td><td>clusterName; state=start/stop/resume</td><td>Redirect to /task/{taskId}</td><td>Operate a cluster: start; stop or resume a failed creation</td></tr>
+<tr><td>PUT</td><td>/cluster/{clusterName}/nodegroup/{groupName}</td><td>clusterName; groupName; instanceNum</td><td>Redirect to /task/{taskId}</td><td>Resize cluster with a new instance number</td></tr>
+<tr><td>DELETE</td><td>/cluster/{clusterName}</td><td>clusterName</td><td>Redirect to /task/{taskId}</td><td>Delete a cluster by name</td></tr>
+<tr><td>POST</td><td>/resourcepools</td><td>ResourcePoolAdd</td><td>void</td><td>Add a resource pool</td></tr>
+<tr><td>GET</td><td>/resourcepools</td><td>void</td><td>List of ResourcePoolRead</td><td>List all resource pools</td></tr>
+<tr><td>GET</td><td>/resourcepool/{rpName}</td><td>rpName</td><td>ResourcePoolRead</td><td>Get resource pool by name</td></tr>
+<tr><td>DELETE</td><td>/resourcepool/{rpName}</td><td>rpName</td><td>void</td><td>Delete a resource pool by name</td></tr>
+<tr><td>POST</td><td>/datastores</td><td>DatastoreAdd</td><td>void</td><td>Add a datastore</td></tr>
+<tr><td>GET</td><td>/datastores</td><td>void</td><td>List of DatastoreRead</td><td>List all datastores</td></tr>
+<tr><td>GET</td><td>/datastore/{dsName}</td><td>dsName</td><td>DatastoreRead</td><td>Get datastore by name</td></tr>
+<tr><td>DELETE</td><td>/datastore/{dsName}</td><td>dsName</td><td>void</td><td>Delete a datastore by name</td></tr>
+<tr><td>POST</td><td>/networks</td><td>NetworkAdd</td><td>void</td><td>Add a network</td></tr>
+<tr><td>GET</td><td>/networks</td><td>details=true/false</td><td>List of NetworkRead</td><td>List all networks</td></tr>
+<tr><td>GET</td><td>/network/{networkName}</td><td>networkName; details=true/false</td><td>NetworkRead</td><td>Get a network by name</td></tr>
+<tr><td>DELETE</td><td>/network/{networkName}</td><td>networkName</td><td>void</td><td>Delete a network by name</td></tr>
+<tr><td>GET</td><td>/distros</td><td>void</td><td>List of DistroRead</td><td>List all distros</td></tr>
+<tr><td>GET</td><td>/distro/{distroName}</td><td>distroName</td><td>DistroRead</td><td>Get a distro by name</td></tr>
+</table>
+
+## Serengeti CLI
+CLI is built upon Spring Shell. It supports shell mode, command line mode, and execution of script file. After compiling, you can find the jar file under cli/target directory.
+
+- Shell mode: java -jar serengeti-cli-0.1.jar. It supports tab key based command hint and completion. It supports history by up/down arrows.
+
+- Command line mode: java -jar serengeti-cli-0.1.jar "command1;command2..."
+
+- Execution of script file: in shell mode or command line mode, execute "script --file scriptFileName". The shell history file named cli.log will help to generate the script file.
+
+More details can be found at cli/README.md. A sample cluster creation specification file can be found at cli/sample.spec.
+
805 cli/README.md
@@ -0,0 +1,805 @@
+# COMMAND LINE INTERFACE (CLI) INTRODUCTION
+## 1. Terminology
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>Node: A
+VM in the cluster</span></p>
+
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>NodeGroup:
+A group of VMs with same functionality and spec</span></p>
+
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>Cluster:
+A group of NodeGroups working together</span></p>
+
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>Distro:
+A Hadoop distribution version</span></p>
+
+
+## 2. Usage
+CLI supports shell mode, command line mode, and execution of script file. After compile, you can find the jar file under cli/target directory.
+- Shell mode: java -jar serengeti-cli-0.1.jar. It supports tab key based command hint and completion. It supports history by up/down arrows.
+- Command line mode: java -jar serengeti-cli-0.1.jar "command1;command2..."
+- Execution of script file: in shell mode or command line mode, execute "script --file scriptFileName". The shell history file named cli.log will help to generate the script file.
+
+## 3. Command Syntax
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>CLI
+commands are built on spring
+shell(https://github.com/SpringSource/spring-shell), so its syntax follows
+spring shell command syntax below:</span></p>
+
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>Command
+::= serengeti &lt;command-category&gt; &lt;command-name&gt; &lt;required-command-key-values&gt;*
+[&lt;optional-command-key-values&gt;]*</span></p>
+
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>required-command-key-values
+::= &lt;command-key-value-fullsize&gt;</span></p>
+
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>optional-command-key-values
+::= &lt;command-key-value-fullsize&gt;</span></p>
+
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>required-command-key-values-fullsize
+::= &lt;command-key-value-fullsize&gt;</span></p>
+
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>optional-command-key-value-fullsize
+::= &lt;command-key-value-fullsize&gt;</span></p>
+
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>command-key-value-fullsize
+::= '--'&lt;command-key-full&gt; [&lt;value&gt;]</span></p>
+
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>-
+Command-category is the type of object that the command will operate on.</span></p>
+
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>-
+Command-name is the operation to do.</span></p>
+
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>-
+Required-command-key-values are parameters that required for the operation.</span></p>
+
+<p class=MsoNormal><span style='font-family:"Times New Roman","serif"'>-
+Optional-command-key-values are parameters that are optional for the operation.</span></p>
+
+## 4. Command Help
+- Shell level Help: user can get shell level help by using "help" in command line mode or help command in shell mode. A list of objects will be displayed with operations and short descriptions.
+- Command category level help: to get help for a particular class of object, user can enter help followed by an object. CLI will display all operations defined for the object.
+- Command level help: to get help for a particular operation, user can enter help followed by an object and an operation. This will display all parameters.
+
+## 5. Command List
+<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 width=800
+ style='width:6.5in;border-collapse:collapse;border:none'>
+ <tr>
+ <td width=67 valign=top style='width:.7in;border:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>command-category</span></p>
+ </td>
+ <td width=66 valign=top style='width:49.5pt;border:solid windowtext 1.0pt;
+ border-left:none;padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>command-name</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border:solid windowtext 1.0pt;
+ border-left:none;padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Parameters</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border:solid windowtext 1.0pt;
+ border-left:none;padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>descriptions</span></p>
+ </td>
+ </tr>
+ <tr>
+ <td width=67 valign=top style='width:.7in;border:solid windowtext 1.0pt;
+ border-top:none;padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>connect</span></p>
+ </td>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>&nbsp;</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--host
+ &lt;Serengeti server host&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>None</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Connect
+ a Serengeti server.</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Remark</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>The
+ Serengeti host with optional port number, e.g. hostname:port .</span></p>
+ </td>
+ </tr>
+ <tr>
+ <td width=67 rowspan=3 valign=top style='width:.7in;border:solid windowtext 1.0pt;
+ border-top:none;padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>resource
+ pool</span></p>
+ </td>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>add</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;resource pool name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--vcrp
+ &lt; VC rp name &gt; </span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--vccluster
+ &lt; vsphere cluster name &gt; </span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>None</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Add
+ a new resource pool.</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Remark</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>User
+ must add a resource pool before create a cluster.</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>&nbsp;</span></p>
+ </td>
+ </tr>
+ <tr>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>list</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>None</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;resource pool name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--detail
+ &lt;flag to show node information&gt;</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>
+ Show resource pool information.</span></p>
+ </td>
+ </tr>
+ <tr>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>delete</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;resource pool name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>None</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Delete
+ an unused resource pool.</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Remark</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>User
+ cannot delete a resource pool which is in use.</span></p>
+ </td>
+ </tr>
+ <tr>
+ <td width=67 rowspan=3 valign=top style='width:.7in;border:solid windowtext 1.0pt;
+ border-top:none;padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>datastore</span></p>
+ </td>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>add</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;data store name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--spec
+ &lt;</span><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>datastore
+ name(s) in the vsphere&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--type
+ &lt;specify the type for storage: SHARED or LOCAL&gt;</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Add
+ new datastore(s) .</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Remark</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>When
+ the spec parameter include some datastore names, users need to use &quot;,&quot; to separate them. Users may also specify
+ multiple data stores by a wildcard.</span></p>
+ </td>
+ </tr>
+ <tr>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>list</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>None</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;data store name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--detail
+ &lt; flag to show datastore detail information &gt;</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Show
+ datastore information.</span></p>
+ </td>
+ </tr>
+ <tr>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>delete</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;data store name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>None</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Delete
+ an unused datastore .</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>&nbsp;</span></p>
+ </td>
+ </tr>
+ <tr>
+ <td width=67 rowspan=3 valign=top style='width:.7in;border:solid windowtext 1.0pt;
+ border-top:none;padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>network</span></p>
+ </td>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>add</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;network name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--portGroup&lt;vsphere
+ port group name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><i><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Combination
+ 1</span></i></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--</span><span
+ style='font-size:10.0pt;font-family:"Times New Roman","serif"'> </span><span
+ style='font-size:9.0pt;font-family:"Times New Roman","serif"'>dhcp &lt; </span><span
+ style='font-size:9.0pt;font-family:"Times New Roman","serif"'>mark as<span
+ style='color:#313131'> </span>dhcp type</span><span style='font-size:9.0pt;
+ font-family:"Times New Roman","serif"'>&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><i><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Combination
+ 2</span></i></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--</span><span
+ style='font-size:10.0pt;font-family:"Times New Roman","serif"'> </span><span
+ style='font-size:9.0pt;font-family:"Times New Roman","serif"'>ip &lt;ip range
+ information&gt; </span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--</span><span
+ style='font-size:10.0pt;font-family:"Times New Roman","serif"'> </span><span
+ style='font-size:9.0pt;font-family:"Times New Roman","serif"'>dns&lt;</span><span
+ style='font-size:10.0pt;font-family:"Times New Roman","serif"'> </span><span
+ style='font-size:9.0pt;font-family:"Times New Roman","serif"'>first dns
+ information &gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--</span><span
+ style='font-size:10.0pt;font-family:"Times New Roman","serif"'> </span><span
+ style='font-size:9.0pt;font-family:"Times New Roman","serif"'>secondDNS &lt;second
+ dns information&gt; </span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--</span><span
+ style='font-size:10.0pt;font-family:"Times New Roman","serif"'> </span><span
+ style='font-size:9.0pt;font-family:"Times New Roman","serif"'>gateway
+ &lt;gateway information&gt; </span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--</span><span
+ style='font-size:10.0pt;font-family:"Times New Roman","serif"'> </span><span
+ style='font-size:9.0pt;font-family:"Times New Roman","serif"'>mask&lt;mask
+ information&gt; </span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Add
+ a network to Serengeti.</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Remark</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Users
+ must enter either ip range or dhcp, but not both.</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Example</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>network
+ add --name ipNetwork --ip 192.168.1.1-100,192.168.1.256-300 --portGroup pg1
+ --dns 202.112.0.1 --gateway 192.168.1.255 --mask 255.255.255.1</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>network
+ add --name dhcpNetwork --dhcp</span></p>
+ </td>
+ </tr>
+ <tr style='height:31.05pt'>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt;height:31.05pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>list</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt;height:31.05pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>None</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;network name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--detail
+ &lt;flag to show network detail information &gt;</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt;height:31.05pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Show network information.</span></a></p>
+ </td>
+ </tr>
+ <tr>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>delete</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;network name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>None</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Delete
+ an unused network.</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Remark</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>User
+ cannot delete a network which is in use.</span></p>
+ </td>
+ </tr>
+ <tr>
+ <td width=67 rowspan=6 valign=top style='width:.7in;border:solid windowtext 1.0pt;
+ border-top:none;padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>cluster</span></p>
+ </td>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>create</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;cluster name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--distro
+ &lt; hadoop distro name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--specFile
+ &lt;spec file pathname&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--rpNames
+ &lt;</span><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>
+ </span><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>resource
+ pools for the cluster &gt; </span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--dsNames
+ &lt;</span><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>
+ </span><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>datastores
+ for the cluster&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--networkName
+ &lt;network name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--resume
+ &lt;</span><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>
+ </span><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>flag
+ to resume cluster creation &gt;</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Create
+ a Hadoop cluster</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Remark</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>The
+ specFile is defined in jason format.</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Example</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>cluster
+ create --name testCluster</span></p>
+ </td>
+ </tr>
+ <tr>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>delete</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;cluster name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>None</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Delete
+ an unused cluster.</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>&nbsp;</span></p>
+ </td>
+ </tr>
+ <tr>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>resize</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;cluster name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--nodeGroup
+ &lt;</span><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>
+ </span><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>node
+ group name&gt; </span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--instanceNum
+ &lt;instance number&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>None</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Change
+ the number of nodes in a node group.</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Parameter
+ Definition</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>instance
+ number ::= &lt;final number&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Remark</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>The
+ instanceNum should be larger than the existing instance numbers in the node
+ group.</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Example</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>cluster
+ resize --name testCluster --nodeGroup slave -- instanceNum 10</span></p>
+ </td>
+ </tr>
+ <tr style='height:47.2pt'>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt;height:47.2pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>start</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt;height:47.2pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;cluster name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>None</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt;height:47.2pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Start
+ VMs in a cluster.</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>&nbsp;</span></p>
+ </td>
+ </tr>
+ <tr>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>stop</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;cluster name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>None</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Stop
+ VMs in a cluster.</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>&nbsp;</span></p>
+ </td>
+ </tr>
+ <tr>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>list</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>None</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;cluster name&gt;</a></span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--detail
+ &lt;flag to show node information&gt;</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Show
+ cluster information.</span></p>
+ </td>
+ </tr>
+ <tr style='height:31.0pt'>
+ <td width=67 valign=top style='width:.7in;border:solid windowtext 1.0pt;
+ border-top:none;padding:0in 5.4pt 0in 5.4pt;height:31.0pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>distro</span></p>
+ </td>
+ <td width=66 valign=top style='width:49.5pt;border-top:none;border-left:none;
+ border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt;height:31.0pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>list</span></p>
+ </td>
+ <td width=216 valign=top style='width:2.25in;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt;height:31.0pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Mandatory</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>None</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Options</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--name
+ &lt;distro name&gt;</span></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>--detail
+ &lt;</span><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>
+ </span><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>flag
+ to show distro detail information&gt;</span></p>
+ </td>
+ <td width=275 valign=top style='width:206.1pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0in 5.4pt 0in 5.4pt;height:31.0pt'>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><b><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Function</span></b></p>
+ <p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:
+ normal'><span style='font-size:9.0pt;font-family:"Times New Roman","serif"'>Show
+ distro information.</span></p>
+ </td>
+ </tr>
+</table>
3  cli/cli.properties
@@ -0,0 +1,3 @@
+#update host information
+#Mon May 21 11:27:46 CST 2012
+host=10.141.7.45\:8080
137 cli/pom.xml
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.vmware.bdd.cli.commands</groupId>
+ <artifactId>serengeti-cli</artifactId>
+ <version>${serengeti.version}</version>
+ <packaging>jar</packaging>
+ <name>vHadoop CLI</name>
+ <url>http://maven.apache.org</url>
+
+ <parent>
+ <groupId>com.vmware.bdd</groupId>
+ <artifactId>serengeti-master</artifactId>
+ <version>${serengeti.version}</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <properties>
+ <spring.shell.version>1.0.0.BUILD-SNAPSHOT</spring.shell.version>
+ <jar.mainclass>org.springframework.shell.Bootstrap</jar.mainclass>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.vmware.bdd</groupId>
+ <artifactId>common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- External modules -->
+ <dependency>
+ <groupId>org.springframework.shell</groupId>
+ <artifactId>spring-shell</artifactId>
+ <version>${spring.shell.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test-mvc</artifactId>
+ <version>1.0.0.BUILD-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <excludeGroupIds>junit,org.testng</excludeGroupIds>
+ <outputDirectory>${project.build.directory}/lib</outputDirectory>
+ <overWriteReleases>true</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <overWriteIfNewer>true</overWriteIfNewer>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ <useUniqueVersions>false</useUniqueVersions>
+ <classpathPrefix>lib/</classpathPrefix>
+ <mainClass>${jar.mainclass}</mainClass>
+ </manifest>
+ <manifestEntries>
+ <version>${project.version}</version>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!-- jline 1.0.S2-B is here
+ http://shrub.appspot.com/spring-roo-repository.springsource.org/release/net/sourceforge/jline/jline/1.0.S2-B/
+ -->
+ <repositories>
+ <repository>
+ <id>spring-roo-repository</id>
+ <name>Spring Roo Maven Repository</name>
+ <url>http://spring-roo-repository.springsource.org/release</url>
+ </repository>
+ <repository>
+ <id>spring-maven-snapshot</id>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>always</updatePolicy>
+ </snapshots>
+ <name>Springframework Maven SNAPSHOT Repository</name>
+ <url>http://maven.springframework.org/snapshot</url>
+ </repository>
+
+ <repository>
+ <id>spring-maven-milestone</id>
+ <name>Springframework Maven Milestone Repository</name>
+ <url>http://maven.springframework.org/milestone</url>
+ </repository>
+ </repositories>
+</project>
48 cli/sample.spec
@@ -0,0 +1,48 @@
+[
+ {
+ "name": "master",
+ "roles": [
+ "hadoop_namenode",
+ "hadoop_jobtracker"
+ ],
+ "instanceNum": 1,
+ "instanceType": "LARGE",
+ "cpuNum": 6,
+ "memCapacityMB": 2048,
+ "haFlag": false
+ },
+ {
+ "name": "worker",
+ "roles": [
+ "hadoop_tasktracker",
+ "hadoop_datanode"
+ ],
+ "instanceNum": 4,
+ "cpuNum": 2,
+ "memCapacityMB": 1024,
+ "storage": {
+ "type": "LOCAL",
+ "sizeGB": 10
+ },
+ "rpNames": [
+ "rp1",
+ "rp2"
+ ]
+ },
+ {
+ "name": "client",
+ "roles": [
+ "hadoop_client",
+ "hive",
+ "pig"
+ ],
+ "cpuNum": 1,
+ "storage": {
+ "type": "LOCAL",
+ "sizeGB": 10
+ },
+ "rpNames": [
+ "rp3"
+ ]
+ }
+]
71 cli/src/main/java/com/vmware/bdd/cli/commands/CliBannerProvider.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ * Portions copyright(c) 2012 VMware, Inc. All rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.vmware.bdd.cli.commands;
+
+import org.springframework.core.Ordered;
+import org.springframework.core.annotation.Order;
+import org.springframework.roo.shell.CliCommand;
+import org.springframework.roo.shell.CommandMarker;
+import org.springframework.roo.support.util.StringUtils;
+import org.springframework.shell.plugin.support.DefaultBannerProvider;
+import org.springframework.stereotype.Component;
+
+/**
+ * The class to set cli banners through spring shell
+ */
+@Component
+@Order(Ordered.HIGHEST_PRECEDENCE)
+public class CliBannerProvider extends DefaultBannerProvider implements CommandMarker {
+
+ /* (non-Javadoc)
+ * @see org.springframework.shell.plugin.BannerProvider#getBanner()
+ */
+ @CliCommand(value = { "version" }, help = "Displays current CLI version")
+ public String getBanner() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("=================================================" + StringUtils.LINE_SEPARATOR);
+ buf.append("* _____ _ _ *" + StringUtils.LINE_SEPARATOR);
+ buf.append("* / ____| ___ _ __ ___ _ __ __ _ ___| |_(_) *" + StringUtils.LINE_SEPARATOR);
+ buf.append("* \\____ \\ / _ \\ '__/ _ \\ '_ \\ / _` |/ _ \\ __| | *" + StringUtils.LINE_SEPARATOR);
+ buf.append("* ____) | __/ | | __/ | | | (_| | __/ |_| | *" + StringUtils.LINE_SEPARATOR);
+ buf.append("* |_____/ \\___|_| \\___|_| |_|\\__, |\\___|\\__|_| *" + StringUtils.LINE_SEPARATOR);
+ buf.append("* |___/ *" + StringUtils.LINE_SEPARATOR);
+ buf.append("* *" + StringUtils.LINE_SEPARATOR);
+ buf.append("=================================================" + StringUtils.LINE_SEPARATOR);
+ buf.append("Verson:" + this.getVersion());
+ return buf.toString();
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.springframework.shell.plugin.BannerProvider#getVersion()
+ */
+ public String getVersion() {
+ return "0.5.0";
+ }
+
+ /* (non-Javadoc)
+ * @see org.springframework.shell.plugin.BannerProvider#getWelcomMessage()
+ */
+ public String getWelcomeMessage() {
+ return "Welcome to Serengeti CLI";
+ }
+
+ public String name() {
+ return "Serengeti CLI";
+ }
+}
33 cli/src/main/java/com/vmware/bdd/cli/commands/CliHistoryFileProvider.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ * Portions copyright(c) 2012 VMware, Inc. All rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.vmware.bdd.cli.commands;
+
+import org.springframework.core.Ordered;
+import org.springframework.core.annotation.Order;
+import org.springframework.shell.plugin.support.DefaultHistoryFileNameProvider;
+import org.springframework.stereotype.Component;
+
+@Component
+@Order(Ordered.HIGHEST_PRECEDENCE)
+public class CliHistoryFileProvider extends DefaultHistoryFileNameProvider {
+
+ public String getHistoryFileName() {
+ return "cli.log";
+ }
+
+}
34 cli/src/main/java/com/vmware/bdd/cli/commands/CliPromptProvider.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2011-2012 the original author or authors.
+ * Portions copyright(c) 2012 VMware, Inc. All rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.vmware.bdd.cli.commands;
+
+import org.springframework.core.Ordered;
+import org.springframework.core.annotation.Order;
+import org.springframework.shell.plugin.support.DefaultPromptProvider;
+import org.springframework.stereotype.Component;
+
+@Component
+@Order(Ordered.HIGHEST_PRECEDENCE)
+public class CliPromptProvider extends DefaultPromptProvider {
+ /* (non-Javadoc)
+ * @see org.springframework.shell.plugin.PromptProvider#getPromptText()
+ */
+ public String getPromptText() {
+ return "serengeti>";
+ }
+
+}
683 cli/src/main/java/com/vmware/bdd/cli/commands/ClusterCommands.java
@@ -0,0 +1,683 @@
+/*****************************************************************************
+ * Copyright (c) 2012 VMware, Inc. All Rights Reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ****************************************************************************/
+package com.vmware.bdd.cli.commands;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import jline.ConsoleReader;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.roo.shell.CliAvailabilityIndicator;
+import org.springframework.roo.shell.CliCommand;
+import org.springframework.roo.shell.CliOption;
+import org.springframework.roo.shell.CommandMarker;
+import org.springframework.stereotype.Component;
+
+import com.vmware.bdd.apitypes.ClusterCreate;
+import com.vmware.bdd.apitypes.ClusterRead;
+import com.vmware.bdd.apitypes.DistroRead;
+import com.vmware.bdd.apitypes.NetworkRead;
+import com.vmware.bdd.apitypes.NodeGroupCreate;
+import com.vmware.bdd.apitypes.NodeGroupRead;
+import com.vmware.bdd.apitypes.NodeRead;
+import com.vmware.bdd.cli.rest.CliRestException;
+import com.vmware.bdd.cli.rest.ClusterRestClient;
+import com.vmware.bdd.cli.rest.DistroRestClient;
+import com.vmware.bdd.cli.rest.NetworkRestClient;
+
+@Component
+public class ClusterCommands implements CommandMarker {
+ @Autowired
+ private DistroRestClient distroRestClient;
+
+ @Autowired
+ private NetworkRestClient networkRestClient;
+
+ @Autowired
+ private ClusterRestClient restClient;
+
+ //define role of the node group .
+ private enum NodeGroupRole {
+ MASTER, WORKER, CLIENT, NONE
+ }
+
+ @CliAvailabilityIndicator({ "cluster help" })
+ public boolean isCommandAvailable() {
+ return true;
+ }
+
+ @CliCommand(value = "cluster create", help = "Create a default vhadoop cluster")
+ public void createCluster(
+ @CliOption(key = { "name" }, mandatory = true, help = "The cluster name") final String name,
+ @CliOption(key = { "distro" }, mandatory = false, help = "Hadoop Distro") final String distro,
+ @CliOption(key = { "specFile" }, mandatory = false, help = "The spec file name path") final String specFilePath,
+ @CliOption(key = { "rpNames" }, mandatory = false, help = "Resource Pools for the cluster: use \",\" among names.") final String rpNames,
+ @CliOption(key = { "dsNames" }, mandatory = false, help = "Datastores for the cluster: use \",\" among names.") final String dsNames,
+ @CliOption(key = { "networkName" }, mandatory = false, help = "Network Name") final String networkName,
+ @CliOption(key = { "resume" }, mandatory = false, specifiedDefaultValue = "true", unspecifiedDefaultValue = "false", help = "flag to resume cluster creation") final boolean resume) {
+ //validate the name
+ if (name.indexOf("-") != -1) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_CREATE, Constants.OUTPUT_OP_RESULT_FAIL,
+ Constants.PARAM_CLUSTER
+ + Constants.PARAM_NOT_CONTAIN_HORIZONTAL_LINE);
+
+ return;
+ }
+
+ //process resume
+ if (resume) {
+ resumeCreateCluster(name);
+ return;
+ }
+
+ // build ClusterCreate object
+ ClusterCreate clusterCreate = new ClusterCreate();
+ clusterCreate.setName(name);
+ if (distro != null) {
+ List<String> distroNames = getDistroNames();
+ if (validName(distro, distroNames)) {
+ clusterCreate.setDistro(distro);
+ } else {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,
+ name, Constants.OUTPUT_OP_CREATE,
+ Constants.OUTPUT_OP_RESULT_FAIL, Constants.PARAM_DISTRO
+ + Constants.PARAM_NOT_SUPPORTED + distroNames);
+ return;
+ }
+ }
+
+ if (rpNames != null) {
+ List<String> rpNamesList = CommandsUtils.inputsConvert(rpNames);
+ if (rpNamesList.isEmpty()) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,
+ name, Constants.OUTPUT_OP_CREATE,
+ Constants.OUTPUT_OP_RESULT_FAIL,
+ Constants.INPUT_RPNAMES_PARAM + Constants.MULTI_INPUTS_CHECK);
+ return;
+ } else {
+ clusterCreate.setRpNames(rpNamesList);
+ }
+ }
+ if (dsNames != null) {
+ List<String> dsNamesList = CommandsUtils.inputsConvert(dsNames);
+ if (dsNamesList.isEmpty()) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,
+ name, Constants.OUTPUT_OP_CREATE,
+ Constants.OUTPUT_OP_RESULT_FAIL,
+ Constants.INPUT_DSNAMES_PARAM + Constants.MULTI_INPUTS_CHECK);
+ return;
+ } else {
+ clusterCreate.setDsNames(dsNamesList);
+ }
+ }
+ try {
+ if (specFilePath != null) {
+ clusterCreate.setNodeGroupCreates(CommandsUtils
+ .getObjectByJsonString(NodeGroupCreate[].class,
+ CommandsUtils.dataFromFile(specFilePath)));
+ }
+ } catch (Exception e) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_CREATE, Constants.OUTPUT_OP_RESULT_FAIL,
+ e.getMessage());
+ return;
+ }
+
+ List<String> networkNames = getNetworkNames();
+
+ if (networkNames.isEmpty()) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_CREATE, Constants.OUTPUT_OP_RESULT_FAIL,
+ Constants.PARAM_NETWORK_NAME + Constants.PARAM_NOT_EXISTED);
+ return;
+ } else {
+ if (networkName != null) {
+ if (validName(networkName, networkNames)) {
+ clusterCreate.setNetworkName(networkName);
+ } else {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,
+ name, Constants.OUTPUT_OP_CREATE,
+ Constants.OUTPUT_OP_RESULT_FAIL,
+ Constants.PARAM_NETWORK_NAME
+ + Constants.PARAM_NOT_SUPPORTED + networkNames);
+ return;
+ }
+ } else {
+ if (networkNames.size() == 1) {
+ clusterCreate.setNetworkName(networkNames.get(0));
+ } else {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,
+ name, Constants.OUTPUT_OP_CREATE,
+ Constants.OUTPUT_OP_RESULT_FAIL,
+ Constants.PARAM_NETWORK_NAME
+ + Constants.PARAM_NOT_SPECIFIED);
+ return;
+ }
+ }
+ }
+
+ // Validate that the specified file is correct json format and proper value.
+ if (specFilePath != null) {
+ if (!validateClusterCreate(clusterCreate)) {
+ return;
+ }
+ }
+
+ // rest invocation
+ try {
+ restClient.create(clusterCreate);
+ CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_RESULT_CREAT);
+ } catch (CliRestException e) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_CREATE, Constants.OUTPUT_OP_RESULT_FAIL,
+ e.getMessage());
+ }
+ }
+
+ @CliCommand(value = "cluster list", help = "Get cluster information")
+ public void getCluster(
+ @CliOption(key = { "name" }, mandatory = false, help = "The cluster name") final String name,
+ @CliOption(key = { "detail" }, mandatory = false, specifiedDefaultValue = "true", unspecifiedDefaultValue = "false", help = "flag to show node information") final boolean detail) {
+
+ // rest invocation
+ try {
+ if (name == null) {
+ ClusterRead[] clusters = restClient.getAll();
+ if (clusters != null) {
+ prettyOutputClustersInfo(clusters, detail);
+ }
+ } else {
+ ClusterRead cluster = restClient.get(name);
+ if (cluster != null) {
+ prettyOutputClusterInfo(cluster, detail);
+ }
+ }
+ } catch (CliRestException e) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_LIST, Constants.OUTPUT_OP_RESULT_FAIL,
+ e.getMessage());
+ }
+ }
+
+ @CliCommand(value = "cluster delete", help = "Delete a cluster")
+ public void deleteCluster(
+ @CliOption(key = { "name" }, mandatory = true, help = "The cluster name") final String name) {
+
+ //rest invocation
+ try {
+ restClient.delete(name);
+ CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_RESULT_DELETE);
+ } catch (CliRestException e) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_DELETE, Constants.OUTPUT_OP_RESULT_FAIL,
+ e.getMessage());
+ }
+ }
+
+ @CliCommand(value = "cluster start", help = "Start a cluster")
+ public void startCluster(
+ @CliOption(key = { "name" }, mandatory = true, help = "The cluster name") final String name) {
+
+ Map<String, String> queryStrings = new HashMap<String, String>();
+ queryStrings
+ .put(Constants.QUERY_ACTION_KEY, Constants.QUERY_ACTION_START);
+
+ //rest invocation
+ try {
+ restClient.actionOps(name, queryStrings);
+ CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_RESULT_START);
+ } catch (CliRestException e) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_START, Constants.OUTPUT_OP_RESULT_FAIL,
+ e.getMessage());
+ }
+ }
+
+ @CliCommand(value = "cluster stop", help = "Stop a cluster")
+ public void stopCluster(
+ @CliOption(key = { "name" }, mandatory = true, help = "The cluster name") final String name) {
+ Map<String, String> queryStrings = new HashMap<String, String>();
+ queryStrings.put(Constants.QUERY_ACTION_KEY, Constants.QUERY_ACTION_STOP);
+
+ //rest invocation
+ try {
+ restClient.actionOps(name, queryStrings);
+ CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_RESULT_STOP);
+ } catch (CliRestException e) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_STOP, Constants.OUTPUT_OP_RESULT_FAIL,
+ e.getMessage());
+ }
+ }
+
+ @CliCommand(value = "cluster resize", help = "Resize a cluster")
+ public void resizeCluster(
+ @CliOption(key = { "name" }, mandatory = true, help = "The cluster name") final String name,
+ @CliOption(key = { "nodeGroup" }, mandatory = true, help = "The node group name") final String nodeGroup,
+ @CliOption(key = { "instanceNum" }, mandatory = true, help = "The resized number of instances. It should be larger that existing one") final int instanceNum) {
+
+ if (instanceNum > 1) {
+ try {
+ restClient.resize(name, nodeGroup, instanceNum);
+ CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_CLUSTER,
+ name, Constants.OUTPUT_OP_RESULT_RESIZE);
+ } catch (CliRestException e) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,
+ name, Constants.OUTPUT_OP_RESIZE,
+ Constants.OUTPUT_OP_RESULT_FAIL, e.getMessage());
+ }
+ } else {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_RESIZE, Constants.OUTPUT_OP_RESULT_FAIL,
+ Constants.INVALID_VALUE + " instanceNum=" + instanceNum);
+ }
+ }
+
+ private void resumeCreateCluster(final String name) {
+ Map<String, String> queryStrings = new HashMap<String, String>();
+ queryStrings.put(Constants.QUERY_ACTION_KEY,
+ Constants.QUERY_ACTION_RESUME);
+
+ try {
+ restClient.actionOps(name, queryStrings);
+ CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_RESULT_RESUME);
+ } catch (CliRestException e) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER, name,
+ Constants.OUTPUT_OP_RESUME, Constants.OUTPUT_OP_RESULT_FAIL,
+ e.getMessage());
+ }
+ }
+
+ private List<String> getNetworkNames() {
+
+ List<String> networkNames = new ArrayList<String>(0);
+
+ NetworkRead[] networks = networkRestClient.getAll(false);
+
+ if (networks != null) {
+ for (NetworkRead network : networks)
+ networkNames.add(network.getName());
+ }
+ return networkNames;
+ }
+
+ private List<String> getDistroNames() {
+
+ List<String> distroNames = new ArrayList<String>(0);
+
+ DistroRead[] distros = distroRestClient.getAll();
+
+ if (distros != null) {
+ for (DistroRead distro : distros)
+ distroNames.add(distro.getName());
+ }
+ return distroNames;
+ }
+
+ private boolean validName(String inputName, List<String> validNames) {
+ for (String name: validNames) {
+ if (name.equals(inputName)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void prettyOutputClusterInfo(ClusterRead cluster, boolean detail) {
+ //cluster Name
+ System.out.printf("name: %s, distro: %s, status: %s", cluster.getName(),
+ cluster.getDistro(), cluster.getStatus());
+ System.out.println();
+ LinkedHashMap<String, List<String>> ngColumnNamesWithGetMethodNames =
+ new LinkedHashMap<String, List<String>>();
+ List<NodeGroupRead> nodegroups = cluster.getNodeGroups();
+ if (nodegroups != null) {
+ ngColumnNamesWithGetMethodNames.put(
+ Constants.FORMAT_TABLE_COLUMN_NAME, Arrays.asList("getName"));
+ ngColumnNamesWithGetMethodNames.put(
+ Constants.FORMAT_TABLE_COLUMN_ROLES, Arrays.asList("getRoles"));
+ ngColumnNamesWithGetMethodNames.put(
+ Constants.FORMAT_TABLE_COLUMN_INSTANCE,
+ Arrays.asList("getInstanceNum"));
+ ngColumnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_CPU,
+ Arrays.asList("getCpuNum"));
+ ngColumnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_MEM,
+ Arrays.asList("getMemCapacityMB"));
+ ngColumnNamesWithGetMethodNames.put(
+ Constants.FORMAT_TABLE_COLUMN_TYPE,
+ Arrays.asList("getStorage", "getType"));
+ ngColumnNamesWithGetMethodNames.put(
+ Constants.FORMAT_TABLE_COLUMN_SIZE,
+ Arrays.asList("getStorage", "getSizeGB"));
+
+ try {
+ if (detail) {
+ LinkedHashMap<String, List<String>> nColumnNamesWithGetMethodNames =
+ new LinkedHashMap<String, List<String>>();
+ nColumnNamesWithGetMethodNames.put(
+ Constants.FORMAT_TABLE_COLUMN_NAME,
+ Arrays.asList("getName"));
+ nColumnNamesWithGetMethodNames.put(
+ Constants.FORMAT_TABLE_COLUMN_HOST,
+ Arrays.asList("getHostName"));
+ nColumnNamesWithGetMethodNames.put(
+ Constants.FORMAT_TABLE_COLUMN_IP, Arrays.asList("getIp"));
+ nColumnNamesWithGetMethodNames.put(
+ Constants.FORMAT_TABLE_COLUMN_STATUS,
+ Arrays.asList("getStatus"));
+
+ for (NodeGroupRead nodegroup : nodegroups) {
+ CommandsUtils.printInTableFormat(
+ ngColumnNamesWithGetMethodNames,
+ new NodeGroupRead[] { nodegroup },
+ Constants.OUTPUT_INDENT);
+ List<NodeRead> nodes = nodegroup.getInstances();
+ if (nodes != null) {
+ System.out.println();
+ CommandsUtils.printInTableFormat(
+ nColumnNamesWithGetMethodNames, nodes.toArray(),
+ new StringBuilder().append(Constants.OUTPUT_INDENT)
+ .append(Constants.OUTPUT_INDENT).toString());
+ }
+ System.out.println();
+ }
+ } else
+ CommandsUtils.printInTableFormat(
+ ngColumnNamesWithGetMethodNames, nodegroups.toArray(),
+ Constants.OUTPUT_INDENT);
+ } catch (Exception e) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,
+ cluster.getName(), Constants.OUTPUT_OP_LIST,
+ Constants.OUTPUT_OP_RESULT_FAIL, e.getMessage());
+ }
+ }
+ }
+
+ private void prettyOutputClustersInfo(ClusterRead[] clusters, boolean detail) {
+ for (ClusterRead cluster : clusters) {
+ prettyOutputClusterInfo(cluster, detail);
+ System.out.println();
+ }
+ }
+
+ /**
+ * Validate nodeGroupCreates member formats and values in the ClusterCreate.
+ */
+ private boolean validateClusterCreate(ClusterCreate clusterCreate) {
+ // validation status
+ boolean validated = true;
+ // show warning message
+ boolean warning = false;
+ //role count
+ int masterCount = 0, workerCount = 0, clientCount = 0;
+ //Find NodeGroupCreate array from current ClusterCreate instance.
+ NodeGroupCreate[] nodeGroupCreates = clusterCreate.getNodeGroupCreates();
+ if (nodeGroupCreates == null || nodeGroupCreates.length == 0) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,
+ clusterCreate.getName(), Constants.OUTPUT_OP_CREATE,
+ Constants.OUTPUT_OP_RESULT_FAIL, Constants.MULTI_INPUTS_CHECK);
+ return !validated;
+ } else {
+ //used for collecting failed message.
+ List<String> failedMsgList = new LinkedList<String>();
+ //find distro roles.
+ List<String> distroRoles = findDistroRoles(clusterCreate);
+ if (distroRoles == null) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,
+ clusterCreate.getName(), Constants.OUTPUT_OP_CREATE,
+ Constants.OUTPUT_OP_RESULT_FAIL,
+ Constants.PARAM_NO_DISTRO_AVAILABLE);
+ return !validated;
+ }
+ if (nodeGroupCreates.length < 2 || nodeGroupCreates.length > 3) {
+ warning = true;
+ }
+ for (NodeGroupCreate nodeGroupCreate : nodeGroupCreates) {
+ //check node group's instanceNum
+ if (!checkInstanceNum(nodeGroupCreate, failedMsgList)) {
+ validated = false;
+ }
+ //check node group's roles
+ if (!checkNodeGroupRoles(nodeGroupCreate, distroRoles,
+ failedMsgList)) {
+ validated = false;
+ }
+ // get node group role .
+ NodeGroupRole role = getNodeGroupRole(nodeGroupCreate);
+ switch (role) {
+ case MASTER:
+ masterCount++;
+ if (nodeGroupCreate.getInstanceNum() >= 0
+ && nodeGroupCreate.getInstanceNum() != 1) {
+ validated = false;
+ collectInstanceNumInvalidateMsg(nodeGroupCreate,
+ failedMsgList);
+ }
+ break;
+ case WORKER:
+ workerCount++;
+ if (nodeGroupCreate.getInstanceNum() == 0) {
+ validated = false;
+ collectInstanceNumInvalidateMsg(nodeGroupCreate,
+ failedMsgList);
+ } else if (nodeGroupCreate.isHaFlag()) {
+ warning = true;
+ }
+ break;
+ case CLIENT:
+ clientCount++;
+ if (nodeGroupCreate.getInstanceNum() == 0
+ || nodeGroupCreate.isHaFlag()) {
+ warning = true;
+ }
+ break;
+ case NONE:
+ warning = true;
+ break;
+ default:
+ }
+ }
+ if (masterCount != 1 || workerCount != 1 || clientCount > 1) {
+ warning = true;
+ }
+ if (!validated) {
+ showFailedMsg(clusterCreate.getName(), failedMsgList);
+ } else if (warning) {
+ // If warning is true,show waring message.
+ showWarningMsg();
+ // When exist warning message,whether to proceed
+ if (!isContinue(clusterCreate)) {
+ validated = false;
+ }
+ }
+ return validated;
+ }
+ }
+
+ private boolean isContinue(ClusterCreate clusterCreate) {
+ boolean continueCreate = true;
+ boolean continueLoop = true;
+ String readMsg = "";
+ try {
+ ConsoleReader reader = new ConsoleReader();
+ int k = 0;
+ while (continueLoop) {
+ if (k >= 3) {
+ continueCreate = false;
+ break;
+ }
+ // Prompt continue infomation
+ System.out.println(Constants.PARAM_PROMPT_CONTINUE_MESSAGE);
+ // Get user's entering
+ readMsg = reader.readLine();
+ if (readMsg.trim().equalsIgnoreCase("yes")
+ || readMsg.trim().equalsIgnoreCase("y")) {
+ continueLoop = false;
+ } else if (readMsg.trim().equalsIgnoreCase("no")
+ || readMsg.trim().equalsIgnoreCase("n")) {
+ continueLoop = false;
+ continueCreate = false;
+ } else {
+ k++;
+ }
+ }
+ } catch (Exception e) {
+ CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,
+ clusterCreate.getName(), Constants.OUTPUT_OP_CREATE,
+ Constants.OUTPUT_OP_RESULT_FAIL, e.getMessage());
+ continueCreate = false;
+ }
+ return continueCreate;
+ }
+
+ private NodeGroupRole getNodeGroupRole(NodeGroupCreate nodeGroupCreate) {
+ //Find roles list from current NodeGroupCreate instance.
+ List<String> roles = nodeGroupCreate.getRoles();
+ for (NodeGroupRole role : NodeGroupRole.values()) {
+ if (matchRole(role, roles)) {
+ return role;
+ }
+ }
+ return NodeGroupRole.NONE;
+ }
+
+ /**
+ * Check the roles was introduced, whether matching with system's specialize
+ * role.
+ */
+ private boolean matchRole(NodeGroupRole role, List<String> roles) {
+ List<String> matchRoles = new LinkedList<String>();
+ switch (role) {
+ case MASTER:
+ if (roles.size() != 2) {
+ return false;
+ } else {
+ matchRoles.add(Constants.ROLE_HADOOP_NAME_NODE);
+ matchRoles.add(Constants.ROLE_HADOOP_JOB_TRACKER);
+ matchRoles.removeAll(roles);
+ return matchRoles.size() == 0 ? true : false;
+ }
+ case WORKER:
+ if (roles.size() != 2) {
+ return false;
+ } else {
+ matchRoles.add(Constants.ROLE_HADOOP_DATANODE);
+ matchRoles.add(Constants.ROLE_HADOOP_TASKTRACKER);
+ matchRoles.removeAll(roles);
+ return matchRoles.size() == 0 ? true : false;
+ }
+ case CLIENT:
+ if (roles.size() < 1 || roles.size() > 3) {
+ return false;
+ } else {
+ matchRoles.add(Constants.ROLE_HADOOP_CLIENT);
+ matchRoles.add(Constants.ROLE_HIVE);
+ matchRoles.add(Constants.ROLE_PIG);
+ int diffNum = matchRoles.size() - roles.size();
+ matchRoles.removeAll(roles);
+ return roles.contains(Constants.ROLE_HADOOP_CLIENT)
+ && (diffNum >= 0) && (diffNum == matchRoles.size()) ? true
+ : false;
+ }
+ }
+ return false;
+ }
+
+ private void showWarningMsg() {
+ System.out.println(Constants.PARAM_CLUSTER_WARNING);
+ }
+
+ private boolean checkInstanceNum(NodeGroupCreate nodeGroup,
+ List<String> failedMsgList) {
+ boolean validated = true;
+ if (nodeGroup.getInstanceNum() < 0) {
+ validated = false;
+ collectInstanceNumInvalidateMsg(nodeGroup, failedMsgList);
+ }
+ return validated;
+ }
+
+ private void collectInstanceNumInvalidateMsg(NodeGroupCreate nodeGroup,
+ List<String> failedMsgList) {