jellyfish-manageiq 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +202 -0
  3. data/README.md +109 -0
  4. data/Rakefile +25 -0
  5. data/app/assets/images/jellyfish_manageiq/products/apache.png +0 -0
  6. data/app/assets/images/jellyfish_manageiq/products/aws_ec2.png +0 -0
  7. data/app/assets/images/jellyfish_manageiq/products/aws_rds.png +0 -0
  8. data/app/assets/images/jellyfish_manageiq/products/aws_s3.png +0 -0
  9. data/app/assets/images/jellyfish_manageiq/products/bugzilla.png +0 -0
  10. data/app/assets/images/jellyfish_manageiq/products/confluence.png +0 -0
  11. data/app/assets/images/jellyfish_manageiq/products/database.png +0 -0
  12. data/app/assets/images/jellyfish_manageiq/products/dna.png +0 -0
  13. data/app/assets/images/jellyfish_manageiq/products/exchange.png +0 -0
  14. data/app/assets/images/jellyfish_manageiq/products/f5.png +0 -0
  15. data/app/assets/images/jellyfish_manageiq/products/firewall.png +0 -0
  16. data/app/assets/images/jellyfish_manageiq/products/hadoop.png +0 -0
  17. data/app/assets/images/jellyfish_manageiq/products/java.png +0 -0
  18. data/app/assets/images/jellyfish_manageiq/products/jira.png +0 -0
  19. data/app/assets/images/jellyfish_manageiq/products/kb.png +0 -0
  20. data/app/assets/images/jellyfish_manageiq/products/man.png +0 -0
  21. data/app/assets/images/jellyfish_manageiq/products/mean.png +0 -0
  22. data/app/assets/images/jellyfish_manageiq/products/mssql.png +0 -0
  23. data/app/assets/images/jellyfish_manageiq/products/netapp.png +0 -0
  24. data/app/assets/images/jellyfish_manageiq/products/oracle.png +0 -0
  25. data/app/assets/images/jellyfish_manageiq/products/php.png +0 -0
  26. data/app/assets/images/jellyfish_manageiq/products/postgresql.png +0 -0
  27. data/app/assets/images/jellyfish_manageiq/products/rails.png +0 -0
  28. data/app/assets/images/jellyfish_manageiq/products/redhat.png +0 -0
  29. data/app/assets/images/jellyfish_manageiq/products/teradata.png +0 -0
  30. data/app/assets/images/jellyfish_manageiq/products/ubuntu.png +0 -0
  31. data/app/assets/images/jellyfish_manageiq/products/windows.png +0 -0
  32. data/app/assets/images/jellyfish_manageiq/products/woman.png +0 -0
  33. data/app/assets/javascripts/jellyfish_manageiq/application.js +13 -0
  34. data/app/assets/javascripts/jellyfish_manageiq/products_admin_controller.js +63 -0
  35. data/app/assets/stylesheets/jellyfish_manageiq/application.css +15 -0
  36. data/app/controllers/manageiq/automate_controller.rb +61 -0
  37. data/app/controllers/manageiq/order_items_controller.rb +64 -0
  38. data/app/helpers/application_helper.rb +2 -0
  39. data/app/models/manage_iq_client.rb +12 -0
  40. data/app/models/manage_iq_client/base.rb +61 -0
  41. data/app/models/manage_iq_client/cluster.rb +9 -0
  42. data/app/models/manage_iq_client/datastore.rb +9 -0
  43. data/app/models/manage_iq_client/host.rb +9 -0
  44. data/app/models/manage_iq_client/policy.rb +9 -0
  45. data/app/models/manage_iq_client/policy_profile.rb +9 -0
  46. data/app/models/manage_iq_client/provider.rb +9 -0
  47. data/app/models/manage_iq_client/resource.rb +82 -0
  48. data/app/models/manage_iq_client/resource_pool.rb +9 -0
  49. data/app/models/manage_iq_client/server.rb +34 -0
  50. data/app/models/manage_iq_client/service.rb +9 -0
  51. data/app/models/manage_iq_client/service_catalog.rb +9 -0
  52. data/app/models/manage_iq_client/service_template.rb +9 -0
  53. data/app/models/manage_iq_client/template.rb +25 -0
  54. data/app/models/manage_iq_client/virtual_machine.rb +27 -0
  55. data/app/models/manage_iq_client/zone.rb +9 -0
  56. data/app/policies/manageiq/order_item_policy.rb +16 -0
  57. data/app/views/manageiq/automate/catalog_item_initialization.html.erb +0 -0
  58. data/app/views/manageiq/automate/create_chef_node.html.erb +97 -0
  59. data/app/views/manageiq/automate/create_ec2.html.erb +140 -0
  60. data/app/views/manageiq/automate/create_rds.html.erb +146 -0
  61. data/app/views/manageiq/automate/create_s3.html.erb +100 -0
  62. data/app/views/manageiq/automate/create_ses.html.erb +114 -0
  63. data/app/views/manageiq/automate/create_vmware_vm.html.erb +102 -0
  64. data/app/views/manageiq/automate/provision_rds.html.erb +130 -0
  65. data/app/views/manageiq/automate/retire_ec2.html.erb +96 -0
  66. data/app/views/manageiq/automate/retire_rds.html.erb +117 -0
  67. data/app/views/manageiq/automate/retire_s3.html.erb +93 -0
  68. data/app/views/manageiq/automate/retire_ses.html.erb +98 -0
  69. data/app/views/manageiq/automate/retire_vmware_vm.html.erb +70 -0
  70. data/app/views/manageiq/automate/update_servicemix_and_chef.html.erb +364 -0
  71. data/config/initializers/manage_iq_client.rb +9 -0
  72. data/config/initializers/product_types.rb +6 -0
  73. data/config/initializers/provisioners.rb +9 -0
  74. data/config/initializers/task_scheduler.rb +12 -0
  75. data/config/product_questions/big_data.json +50 -0
  76. data/config/product_questions/database.json +79 -0
  77. data/config/product_questions/infrastructure.json +49 -0
  78. data/config/product_questions/storage.json +57 -0
  79. data/config/provisioners.json +6 -0
  80. data/config/routes.rb +38 -0
  81. data/db/migrate/20150513221625_create_jellyfish_manageiq_database_products.rb +16 -0
  82. data/db/migrate/20150513221938_create_jellyfish_manageiq_big_data_products.rb +14 -0
  83. data/db/migrate/20150513222020_create_jellyfish_manageiq_infrastructure_products.rb +13 -0
  84. data/db/migrate/20150513222056_create_jellyfish_manageiq_storage_products.rb +13 -0
  85. data/lib/jellyfish/manageiq.rb +34 -0
  86. data/lib/jellyfish/manageiq/big_data.rb +6 -0
  87. data/lib/jellyfish/manageiq/databases.rb +6 -0
  88. data/lib/jellyfish/manageiq/engine.rb +19 -0
  89. data/lib/jellyfish/manageiq/infrastructure.rb +6 -0
  90. data/lib/jellyfish/manageiq/provisioner.rb +115 -0
  91. data/lib/jellyfish/manageiq/storage.rb +6 -0
  92. data/lib/jellyfish/manageiq/version.rb +5 -0
  93. data/lib/tasks/pollvms.rake +42 -0
  94. metadata +360 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a27727a0d562774f594b8f2307b18d6b2061afac
4
+ data.tar.gz: f1766f62fb667f24811f545bb40759c06a1fe962
5
+ SHA512:
6
+ metadata.gz: ab517e59aff8285eae9a32b53ac6e458a0020bec985fad1bd0d4254d21403652d4084c94908e00b1fd32698eaffe579fce84d092d657000e473f5501832b088e
7
+ data.tar.gz: 0eae37eaa4da21bb86c3132c706e4c2b56f2a6e87c146dfba115b7ce1c2599d4f04dc75dd5924fcd90e9aac2bf7346be16a4d63db433cd9d4f9b0cfdf4ef3692
data/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2015 Booz Allen Hamilton
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
202
+
@@ -0,0 +1,109 @@
1
+ # jellyfish-manageiq
2
+ Project Jellyfish ManageIQ Module
3
+
4
+ ## How to create ManageIQ Automation Scripts
5
+ Jellyfish is utilizing the Service Catalog and Automation capabilities provided by ManageIQ to automate the provisioning of additional cloud services. This guide will walk you through the steps of creating catalog items and automation scripts, and then retrieving the information necessary about a catalog item to interact with jellyfish-core.
6
+
7
+ ####Download and Install ManageIQ
8
+ Follow the steps provided here: http://manageiq.org/download/
9
+
10
+ ###Creating an Automation Script
11
+ The following steps will guide you through the process of creating an automation method, adding it to a Service Provisioning Template, and then adding them to a Catalog Item. These steps allow them to interact with Jellyfish-UX and Jellyfish-Core. The automation scripts provided are located in in jellyfish-core/app/view/automate.
12
+
13
+ ####Automation Basics
14
+ Here are some general basics to understand the automation scripts provided through jellyfish-core.
15
+
16
+ **Global Variables**
17
+
18
+ The global variable used through ManageIQ to access the options passed through the REST call is:
19
+
20
+ ````
21
+ $evm
22
+ ````
23
+ These scripts mainly use the root property and log method of this variable. To access the information passed from the call, use
24
+ ````
25
+ $evm.root['dialog_variable_name]
26
+ ````
27
+ To access the logger, use
28
+ ````
29
+ $evm.root('level', 'message')
30
+ ````
31
+ ManageIQ appends a 'dialog_' to every value passed through the payload that isn't one of their required and standard fields.
32
+
33
+ To run the provided scripts, you need the aws (http://aws.amazon.com/sdk-for-ruby/) and rbvmomi (https://github.com/rlane/rbvmomi) ruby gems to be installed on your ManageIQ server.
34
+
35
+ For more information regarding automation, such as definitions and additional terminology, please see ManageIQs automation guide: http://manageiq.org/pdf/ManageIQ-0-Lifecycle_and_Automation_Guide-en-US.pdf
36
+
37
+ ####Adding an Automate Method
38
+ 1. Once logged into ManageIQ, select **Explorer** under the **Automation** menu.
39
+ 2. From the left side **Datastore** menu, select the Methods class located under Datastore/[your domain]/Service/Provisioning/StateMachines.
40
+ 3. Select **Add a new instance** from the **Configuration** menu.
41
+ 4. Enter a name in the **Name** textbox. **Display Name** and **Description** are optional fields.
42
+ 5. Under the **Value** field next to **execute**, enter the same name from the step above.
43
+ 6. Click the **Add** button on the bottom right hand corner.
44
+ 7. Back on the Methods class page, choose **Methods**.
45
+ 8. Select **Add a new method** from the configuration menu.
46
+ 9. Give the method the same name that you created in Step 4.
47
+ 10. Choose **inline** for the **Location**
48
+ 11. Paste in a method that has been provided, or one of your own.
49
+ 12. Click 'Add' from the bottom right hand corner.
50
+
51
+ ####Adding to a Provisioning Template
52
+ 1. Under the left side **Datastore** menu, select the **ServiceProvision_Template** class.
53
+ 2. Under the **Configuration** menu, select **Add a new instance**
54
+ 3. Name your new instance. **Display Name** and **Description** are optional.
55
+ 4. The template is where you supply the method to be executed for a particular service. The provisioning script will go in the **Value** box of the 'provision' field. Also provided with this template are options for pre and post script execution methods.
56
+
57
+ ####Adding a Catalog Item
58
+ 1. Select **Catalog** under the **Services** menu.
59
+ 2. Select **Catalogs** from the left hand side menu.
60
+ 3. From the configuration menu, select **Add a New Catalog**
61
+ 4. Add in a **Name** and **Description**.
62
+ 5. Select **Catalog Items** from the left hand side menu.
63
+ 6. From the **Configuration** menu, select **Add a New Catalog Item**
64
+ 7. Input a **Name** and optional **Description**
65
+ 8. Check the **Display in Dialog** box
66
+ 9. Choose a the **Catalog** that you previously created, or another one
67
+ 10. The automation scripts for jellyfish-core are of type **generic**
68
+ 11. Select whether you'd like to use a **Dialog**
69
+ 12. Select the **Provisioning Entry Point** to be the Provisioning Template you created under Datastore/[your domain]/Service/Provisioning/StateMachines
70
+ 13. For **Reconfigure** and **Retirement** entry points, you may select the default.
71
+
72
+ ####Adding a Dialog
73
+ 1. Select **Customization** under the **Automation** menu.
74
+ 2. On the left hand side, select **Service Dialogs**.
75
+ 3. From the **Configuration** menu, select **Add a new Dialog**
76
+ 4. **Label** your Dialog and select a **Submit** button.
77
+ 5. From the **+** on the top, select **Add a new Tab to this Dialog**
78
+ 6. Label your tab and add an optional description.
79
+ 7. From the **+** on the top, select **Add a new Box to this Tab**
80
+ 8. Label your box and add an optional description
81
+ 9. From the **+** on the top, select **Add a new Element to this Box**
82
+ 10. Label and name your boxes. The name of the box is the value that will be passed through to your automation script. Depending on the type of Element that you choose, you will have different options.
83
+ 11. When complete, select **Save** from the bottom right hand corner.
84
+
85
+ ###Using the ManageIQ API to retrieve Catalog Item properties
86
+ You will need properties Catalog Item properties to configure the use of jellyfish-core and ManageIQ through the UX. These properties that you need can be retrieved using the ManageIQ API as outlined below. The full ManageIQ REST API is available here: http://manageiq.org/documentation/development/rest_api/reference/
87
+
88
+ ####Finding Available Catalog Service Items
89
+ To retrieve a list of all available service items, make a request to
90
+ ````
91
+ GET /api/service_templates/
92
+ ````
93
+ The available items are located in the **Resources** array of the response. The
94
+ To retrieve the specific information regarding a specific service item, you can use any one of the "href"s from the "Resources" array. They are all formatted like the following
95
+ ````
96
+ GET /api/service_templates/[catalog_id]
97
+ ````
98
+ The **catalog_id** is what is needed to configure products. This value is the ManageIQ Type ID field on the Edit Products page.
99
+
100
+ ####Retirement
101
+ For the automation methods currently provided in jellyfish-core, each one requires a separate Catalog Item with the appropriate retirement method included.
102
+
103
+ # ENV ManageIQ settings
104
+ MIQ_URL=<ManageIQ URL>
105
+ MIQ_USERNAME=<username>
106
+ MIQ_PASSWORD=<password>
107
+
108
+ # Get the status of VM's from ManageIQ
109
+ rake upkeep:poll_miq_vms
@@ -0,0 +1,25 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'JellyfishManageIQ'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ Dir[File.join(File.dirname(__FILE__), 'lib/tasks/*.rake')].each { |rake_file| load rake_file }
18
+
19
+ Bundler::GemHelper.install_tasks
20
+
21
+ require 'rspec/core/rake_task'
22
+
23
+ RSpec::Core::RakeTask.new(:spec)
24
+
25
+ task default: :spec
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,63 @@
1
+ 'use strict';
2
+
3
+ /**@ngInject*/
4
+ function ProductsAdminController(categories, categoriesByName, categoryNames, clouds) {
5
+ this.categoriesByName = categoriesByName;
6
+ this.categories = categories;
7
+ this.categoryNames = categoryNames;
8
+ this.clouds = clouds;
9
+
10
+ // TODO: Where are images stored and retrieved from?
11
+ this.productImages = [
12
+ 'products/aws_ec2.png',
13
+ 'products/aws_rds.png',
14
+ 'products/aws_s3.png',
15
+ 'products/redhat.png',
16
+ 'products/ubuntu.png',
17
+ 'products/jira.png',
18
+ 'products/windows.png',
19
+ 'products/exchange.png',
20
+ 'products/confluence.png',
21
+ 'products/php.png',
22
+ 'products/java.png',
23
+ 'products/rails.png',
24
+ 'products/apache.png',
25
+ 'products/database.png',
26
+ 'products/postgresql.png',
27
+ 'products/dna.png',
28
+ 'products/hadoop.png',
29
+ 'products/kb.png',
30
+ 'products/teradata.png',
31
+ 'products/mssql.png',
32
+ 'products/bugzilla.png',
33
+ 'products/oracle.png',
34
+ 'products/netapp.png',
35
+ 'products/firewall.png',
36
+ 'products/f5.png',
37
+ 'products/man.png',
38
+ 'products/woman.png',
39
+ 'products/mean.png',
40
+ ];
41
+ }
42
+
43
+ ProductsAdminController.resolve = {
44
+ /**@ngInject*/
45
+ categories: function(ProductTypesResource) {
46
+ return ProductTypesResource.query().$promise;
47
+ },
48
+ /**@ngInject*/
49
+ categoriesByName: function(categories) {
50
+ return _.object(_.map(categories, function(x){return [x.title, x]}))
51
+ },
52
+ /**@ngInject*/
53
+ categoryNames: function(categories) {
54
+ return _.map(categories, "title");
55
+ },
56
+ /**@ngInject*/
57
+ clouds: function(CloudsResource) {
58
+ return CloudsResource.query().$promise;
59
+ }
60
+
61
+ };
62
+
63
+ window.ProductsAdminController = ProductsAdminController;