cp_oraclecloud 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/controllers/cp_oraclecloud/compute_components_controller.rb +9 -0
  4. data/app/controllers/cp_oraclecloud/compute_instances_controller.rb +5 -0
  5. data/app/controllers/cp_oraclecloud/ssh_keys_controller.rb +68 -0
  6. data/app/models/cp_oraclecloud/compute_component.rb +45 -0
  7. data/app/models/cp_oraclecloud/compute_instance.rb +56 -0
  8. data/app/models/cp_oraclecloud/database_component.rb +2 -0
  9. data/app/models/cp_oraclecloud/database_instance.rb +3 -6
  10. data/app/models/cp_oraclecloud/java_component.rb +2 -0
  11. data/app/models/cp_oraclecloud/java_instance.rb +2 -1
  12. data/app/models/cp_oraclecloud/soa_component.rb +2 -0
  13. data/app/models/cp_oraclecloud/soa_instance.rb +2 -1
  14. data/app/models/cp_oraclecloud/ssh_key.rb +62 -0
  15. data/app/policies/cp_oraclecloud/compute_component_policy.rb +5 -0
  16. data/app/policies/cp_oraclecloud/compute_instance_policy.rb +5 -0
  17. data/app/policies/cp_oraclecloud/ssh_key_policy.rb +26 -0
  18. data/app/views/cp_oraclecloud/compute_components/_fields.html.erb +5 -0
  19. data/app/views/cp_oraclecloud/compute_instances/_show.html.erb +8 -0
  20. data/app/views/cp_oraclecloud/soa_components/_fields.html.erb +1 -1
  21. data/app/views/cp_oraclecloud/ssh_keys/_form.html.erb +8 -0
  22. data/app/views/cp_oraclecloud/ssh_keys/edit.html.erb +4 -0
  23. data/app/views/cp_oraclecloud/ssh_keys/index.html.erb +34 -0
  24. data/app/views/cp_oraclecloud/ssh_keys/new.html.erb +4 -0
  25. data/app/views/products/_cp_oraclecloud_component_menu.html.erb +2 -0
  26. data/config/routes.rb +3 -0
  27. data/lib/cp_oraclecloud/compute_mixin.rb +7 -0
  28. data/lib/cp_oraclecloud/database_mixin.rb +27 -0
  29. data/lib/cp_oraclecloud/java_mixin.rb +27 -0
  30. data/lib/cp_oraclecloud/soa_mixin.rb +13 -0
  31. data/lib/cp_oraclecloud/version.rb +1 -1
  32. data/lib/cp_oraclecloud.rb +9 -1
  33. metadata +21 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c71c79e6d8c964b6f6a179b98816de8e28756570
4
- data.tar.gz: 8b674c39cd22ec9240956a448830f5c951c9e297
3
+ metadata.gz: c78ca804b054bdfb3c01b17f2e4e9794ac264e28
4
+ data.tar.gz: c5fba7ace68a7ab0e0f5dde90147051f28b9633c
5
5
  SHA512:
6
- metadata.gz: 3abdfeff13bc49af0283474badbbe965246793752dd0d05fd5793cefd1ab3484a2d08d24db3ea1a6badc239236f5acba8623a46cebc7a64d73097193792c9194
7
- data.tar.gz: c9e30a08902a498e7d79a5a32dc507e18c7186626144719e2b37d058e1af3cd6bb18cf03de3a047da87ccbe7752ab5c869928e0ce31440c128026210006f4d05
6
+ metadata.gz: 4fee671dccd5040daff93ceff1bb006691fd9d1c049c94c0d7ffcde74107a8e6aa3178db7f781d36e5213f79421735b12d9435b81856a176c6bb836134b26e75
7
+ data.tar.gz: 0ff67df98036aa9a8b8d389b7d7a2005174bcc71ce9282590db60596b0df5f931c8991da182014a6224a5442f6a67ce6ba87fa18c290e7def922f339538b6f57
data/README.md CHANGED
@@ -30,10 +30,10 @@ CpOraclecloud.setup do |config|
30
30
  config.region = <region, remove if using US data centres>
31
31
  config.compute_api = <compute url>
32
32
  config.storage_api = <storage url>
33
- config.active_components = ['Database', 'Java']
33
+ config.active_components = ['Database', 'Java', 'SOA']
34
34
  end
35
35
  ```
36
- The *active_components* option configures which components can be created in the cloud. Supported options are 'Database' and 'Java'. Remove any services you aren't subscribed to.
36
+ The *active_components* option configures which components can be created in the cloud. Supported options are 'Database', 'Java' and 'SOA'. Remove any services you aren't subscribed to.
37
37
 
38
38
  ## Contributing
39
39
  1. Fork it ( https://github.com/Joelith/cp_oraclecloud )
@@ -0,0 +1,9 @@
1
+ module CpOraclecloud
2
+ class ComputeComponentsController < CloudComponentsController
3
+
4
+ private
5
+ def component_params
6
+ params.require(:cp_oraclecloud_compute_component).permit(:name, :shape, :imagelist, :label, :sshkeys)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ module CpOraclecloud
2
+ class ComputeInstancesController < CloudInstancesController
3
+
4
+ end
5
+ end
@@ -0,0 +1,68 @@
1
+ module CpOraclecloud
2
+ class SshKeysController < ApplicationController
3
+ before_action :set_ssh_key, only: [:show, :edit, :update, :destroy]
4
+
5
+ def index
6
+ authorize SshKey
7
+ @ssh_keys = policy_scope(SshKey)
8
+ end
9
+
10
+ def new
11
+ authorize SshKey
12
+ @ssh_key = CpOraclecloud::SshKey.new
13
+ end
14
+
15
+ def show
16
+ authorize @ssh_key
17
+ end
18
+
19
+ def create
20
+ authorize SshKey
21
+ @ssh_key = SshKey.new(ssh_key_params)
22
+
23
+ if @ssh_key.save
24
+ flash[:notice] = "SSH Key has been created."
25
+ redirect_to cp_oraclecloud_ssh_keys_path
26
+ else
27
+ flash.now[:alert] = "SSH Key has not been created."
28
+ render "new"
29
+ end
30
+ end
31
+
32
+ def edit
33
+ authorize @ssh_key
34
+ end
35
+
36
+ def destroy
37
+ authorize @ssh_key
38
+ @ssh_key.destroy
39
+ flash[:notice] = "SSH Key has been deleted."
40
+
41
+ redirect_to cp_oraclecloud_ssh_keys_path
42
+ end
43
+
44
+ def update
45
+ authorize @ssh_key
46
+ if @ssh_key.update_attributes(ssh_key_params)
47
+ flash[:notice] = "SSH Key has been updated."
48
+ redirect_to cp_oraclecloud_ssh_keys_path
49
+ else
50
+ flash.now[:alert] = "SSH Key has not been updated."
51
+ render "edit"
52
+ end
53
+ end
54
+
55
+ private
56
+
57
+ def set_ssh_key
58
+ @project = CpOraclecloud::SshKey.find(params[:name])
59
+ rescue ActiveRecord::RecordNotFound
60
+ flash[:alert] = "The SSH Key you were looking for could not be found."
61
+ redirect_to cp_oraclecloud_ssh_keys_path
62
+ end
63
+
64
+ def ssh_key_params
65
+ params.require(:cp_oraclecloud_ssh_key).permit(:name, :enabled, :key)
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,45 @@
1
+ module CpOraclecloud
2
+ class ComputeComponent < CloudComponent
3
+ include CpOraclecloud::ComputeMixin
4
+
5
+ store :config, accessors: [:name, :shape, :imagelist, :label, :sshkeys], coder: JSON
6
+
7
+ enum shape: [:oc3, :oc4, :oc5, :oc6, :oc1m, :oc2m, :oc3m, :oc4m]
8
+
9
+ validates :name, :presence => true
10
+ validates :imagelist, :presence => true
11
+ validates :shape, :presence => true
12
+ validates :sshkeys, :presence => true
13
+
14
+ def all_image_lists
15
+ connection.image_lists.all
16
+ end
17
+
18
+ def all_ssh_keys
19
+ connection.ssh_keys.all
20
+ end
21
+
22
+ def pretty_type
23
+ 'Oracle Compute Instance'
24
+ end
25
+
26
+ def instance_type
27
+ "CpOraclecloud::ComputeInstance"
28
+ end
29
+
30
+ def instance_name
31
+ "name"
32
+ end
33
+
34
+ def connection
35
+ @connection ||= Fog::Compute.new(
36
+ :provider => 'OracleCloud',
37
+ :oracle_username => CpOraclecloud.username,
38
+ :oracle_password => CpOraclecloud.password,
39
+ :oracle_domain => CpOraclecloud.domain,
40
+ :oracle_compute_api => CpOraclecloud.compute_api
41
+ )
42
+ end
43
+
44
+ end
45
+ end
@@ -0,0 +1,56 @@
1
+ module CpOraclecloud
2
+ class ComputeInstance < CloudInstance
3
+ include CpOraclecloud::ComputeMixin
4
+
5
+ def provision
6
+ connection.instances.create(init_config)
7
+ end
8
+
9
+ def wait
10
+ fog.wait_for { ready? }
11
+ end
12
+
13
+ def provider
14
+ "OracleCloud"
15
+ end
16
+
17
+ def cloud_type
18
+ "Compute"
19
+ end
20
+
21
+ def fog
22
+ @instance ||= connection.instances.get(name)
23
+ @instance
24
+ end
25
+
26
+ def attr_get(attribute)
27
+ begin
28
+ @instance ||= connection.instances.get(name)
29
+ @instance.attributes[attribute.to_sym]
30
+ rescue Fog::Compute::OracleCloud::NotFound
31
+ "Error"
32
+ end
33
+ end
34
+
35
+ def month_cost
36
+ calculate_monthly_cost(init_config)
37
+ end
38
+
39
+ def calc_cost(start_date, end_date)
40
+ cost = 0
41
+ cost = (end_date - start_date) * (month_cost / 30)
42
+ cost
43
+ end
44
+
45
+ def connection
46
+ @connection ||= Fog::Compute.new(
47
+ :provider => 'OracleCloud',
48
+ :oracle_username => CpOraclecloud.username,
49
+ :oracle_password => CpOraclecloud.password,
50
+ :oracle_domain => CpOraclecloud.domain,
51
+ :oracle_compute_api => CpOraclecloud.compute_api
52
+ )
53
+ end
54
+
55
+ end
56
+ end
@@ -1,5 +1,7 @@
1
1
  module CpOraclecloud
2
2
  class DatabaseComponent < CloudComponent
3
+ include CpOraclecloud::DatabaseMixin
4
+
3
5
  store :config, accessors: [:service_name, :version, :description, :ssh_key, :shape, :level, :subscription_type, :edition, :backup_destination, :admin_password], coder: JSON
4
6
 
5
7
  enum edition: [:SE, :EE, :EE_HP, :EE_EP]
@@ -1,5 +1,6 @@
1
1
  module CpOraclecloud
2
2
  class DatabaseInstance < CloudInstance
3
+ include CpOraclecloud::DatabaseMixin
3
4
 
4
5
  def provision
5
6
  @instance = connection.instances.create(init_config)
@@ -32,12 +33,8 @@ module CpOraclecloud
32
33
  end
33
34
 
34
35
  def month_cost
35
- cost = 0
36
- if init_config['edition'] == 'EE_EP' then
37
- rc = RateCard.where("provider = ? AND key = ?", provider, 'Database Cloud Service Enterprise Edition Extreme Performance').first
38
- rc ? cost = rc.value : 0
39
- end
40
- cost
36
+ cost = calculate_monthly_cost(init_config)
37
+ cost
41
38
  end
42
39
 
43
40
  def calc_cost(start_date, end_date)
@@ -1,5 +1,7 @@
1
1
  module CpOraclecloud
2
2
  class JavaComponent < CloudComponent
3
+ include CpOraclecloud::JavaMixin
4
+
3
5
  after_initialize :init
4
6
  store :config, accessors: [:service_name, :cloud_storage_container, :cloud_storage_pwd, :cloud_storage_user, :cloud_storage_if_missing, :description, :enable_admin_console, :provision_otd, :sample_app_deployment_requested, :subscription_type, :level, :admin_password, :admin_port, :admin_username, :backup_volume_size, :cluster_name, :content_port, :dba_name, :dba_password, :db_service_name, :wls_deployment_channel_port, :domain_mode, :domain_name, :domain_partition_count, :domain_volume_size, :edition, :num_nodes, :ms_initial_heap_mb, :ms_jvm_args, :ms_max_heap_mb, :ms_max_perm_mb, :node_manager_password, :node_manager_port, :node_manager_username, :overwrite_ms_jvm_args, :pdb_name, :secured_admin_port, :secured_content_port, :shape, :ssh_key, :version], coder: JSON
5
7
 
@@ -1,5 +1,6 @@
1
1
  module CpOraclecloud
2
2
  class JavaInstance < CloudInstance
3
+ include CpOraclecloud::JavaMixin
3
4
 
4
5
  def provision
5
6
  connection.instances.create(init_config)
@@ -32,7 +33,7 @@ module CpOraclecloud
32
33
  end
33
34
 
34
35
  def month_cost
35
- cost = 0
36
+ cost = calculate_monthly_cost(init_config)
36
37
  cost
37
38
  end
38
39
 
@@ -1,5 +1,7 @@
1
1
  module CpOraclecloud
2
2
  class SoaComponent < CloudComponent
3
+ include CpOraclecloud::SoaMixin
4
+
3
5
  after_initialize :init
4
6
  store :config, accessors: [:service_name, :cloud_storage_container, :cloud_storage_pwd, :cloud_storage_user, :description, :provision_otd, :subscription_type, :level, :topology, :admin_password, :admin_username, :dba_name, :dba_password, :db_service_name, :num_nodes, :shape, :ssh_key, :version], coder: JSON
5
7
 
@@ -1,5 +1,6 @@
1
1
  module CpOraclecloud
2
2
  class SoaInstance < CloudInstance
3
+ include CpOraclecloud::SoaMixin
3
4
 
4
5
  def provision
5
6
  connection.instances.create(init_config)
@@ -32,7 +33,7 @@ module CpOraclecloud
32
33
  end
33
34
 
34
35
  def month_cost
35
- cost = 0
36
+ cost = calculate_monthly_cost(init_config)
36
37
  cost
37
38
  end
38
39
 
@@ -0,0 +1,62 @@
1
+ module CpOraclecloud
2
+ class SshKey
3
+ include ActiveModel::Validations
4
+ include ActiveModel::Conversion
5
+ extend ActiveModel::Naming
6
+
7
+ attr_accessor :uri, :enabled, :key, :name
8
+
9
+ validates :enabled, inclusion: [true, false]
10
+ validates :key, :presence => true
11
+ validates :name, :presence => true
12
+
13
+
14
+ def initialize(attributes = {})
15
+ attributes.each do |name, value|
16
+ send("#{name}=", value)
17
+ end
18
+ end
19
+
20
+ def to_model
21
+ self
22
+ end
23
+
24
+ def persisted?
25
+ false
26
+ end
27
+
28
+ def self.all
29
+ connection.ssh_keys
30
+ end
31
+
32
+ def self.find_by_id(id)
33
+ connection.ssh_keys.get(id)
34
+ end
35
+
36
+ def self.create(params)
37
+ connection.ssh_keys.create(:name => params[:name],
38
+ :enabled => params[:enabled],
39
+ :key => params[:key])
40
+ end
41
+
42
+ def save
43
+ self.connection.ssh_keys.create(:name => name,
44
+ :enabled => enabled,
45
+ :key => key)
46
+ end
47
+
48
+ def self.delete(id)
49
+ connection.ssh_keys.get(id).destroy
50
+ end
51
+
52
+ def self.connection
53
+ @connection ||= Fog::Compute.new(
54
+ :provider => 'OracleCloud',
55
+ :oracle_username => CpOraclecloud.username,
56
+ :oracle_password => CpOraclecloud.password,
57
+ :oracle_domain => CpOraclecloud.domain,
58
+ :oracle_compute_api => CpOraclecloud.compute_api
59
+ )
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,5 @@
1
+ module CpOraclecloud
2
+
3
+ class ComputeComponentPolicy < CloudComponentPolicy
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module CpOraclecloud
2
+
3
+ class ComputeInstancePolicy < CloudInstancePolicy
4
+ end
5
+ end
@@ -0,0 +1,26 @@
1
+ module CpOraclecloud
2
+ class SshKeyPolicy < ApplicationPolicy
3
+
4
+ def create?
5
+ user.has_role? :admin
6
+ end
7
+
8
+ def update?
9
+ user.has_role? :admin
10
+ end
11
+
12
+ def destroy?
13
+ user.has_role? :admin
14
+ end
15
+
16
+ def index?
17
+ user.has_role? :admin
18
+ end
19
+
20
+ class Scope < Scope
21
+ def resolve
22
+ scope.all
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,5 @@
1
+ <%= f.input :name %>
2
+ <%= f.input :shape %>
3
+ <%= f.input :imagelist, collection: @component.all_image_lists, value_method: lambda{|i| i.name} %>
4
+ <%= f.input :label %>
5
+ <%= f.input :sshkeys, collection: @component.all_ssh_keys, value_method: lambda{|s| s.name}, hint: "#{link_to 'Manage SSH Keys', cp_oraclecloud_ssh_keys_path}".html_safe %>
@@ -0,0 +1,8 @@
1
+ <dl class="dl-horizontal">
2
+ <% ['name', 'shape'].each { |a| %>
3
+ <% if instance.attr_get(a).present? then %>
4
+ <dt><%= a.titleize() %></dt>
5
+ <dd><%= instance.attr_get(a) %></dd>
6
+ <% end %>
7
+ <% } %>
8
+ </dl>
@@ -1,4 +1,4 @@
1
- <em>Required fields are on the General and Database tabs. You can ignore the rest if needed</em>
1
+ <em>Required fields are on the General tab. You can ignore the rest if needed</em>
2
2
  <ul class="nav nav-tabs">
3
3
  <li role="presentation" class="active"><a href="#general" data-toggle="tab">* General</a></li>
4
4
  <li role="presentation"><a href="#database" data-toggle="tab">Database</a></li>
@@ -0,0 +1,8 @@
1
+ <%= simple_form_for(ssh_key) do |f| %>
2
+
3
+ <%= f.input :name %>
4
+ <%= f.input :enabled, as: :boolean %>
5
+ <%= f.input :key, as: :text %>
6
+
7
+ <%= f.button :submit, class: "btn-primary" %>
8
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <header>
2
+ <h1>Edit SSH Key</h1>
3
+ </header>
4
+ <%= render "form", ssh_key: @ssh_key %>
@@ -0,0 +1,34 @@
1
+ <header>
2
+ <h1>SSH Keys</h1>
3
+
4
+ <ul class="actions">
5
+ <% if policy(CpOraclecloud::SshKey).new? %>
6
+ <li><%= link_to "New SSH Key", new_cp_oraclecloud_ssh_key_path,
7
+ class: "new" %></li>
8
+ <% end %>
9
+ </ul>
10
+
11
+ </header>
12
+
13
+ <div id="ssh_keys">
14
+ <table class="table table-striped table-hover">
15
+ <thead>
16
+ <tr>
17
+ <th>Name</th>
18
+ <th>Enabled</th>
19
+ <th>Actions</th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <% @ssh_keys.each do |key| %>
24
+ <tr>
25
+ <td><%= key.name %></td>
26
+ <td><%= key.enabled %></td>
27
+ <td><%= link_to "", key, method: :delete,
28
+ data: { confirm: "Are you sure you want to delete this SSH Key? This will remove it from the cloud."},
29
+ class: "delete" %></td>
30
+ </tr>
31
+ <% end %>
32
+ </tbody>
33
+ </table>
34
+ </div>
@@ -0,0 +1,4 @@
1
+ <header>
2
+ <h1>Create SSH Key</h1>
3
+ </header>
4
+ <%= render "form", ssh_key: @ssh_key %>
@@ -9,6 +9,8 @@
9
9
  <%= link_to "Create WebLogic", [@product, CpOraclecloud::JavaComponent, action: :new]%>
10
10
  <% elsif comp == 'SOA' %>
11
11
  <%= link_to "Create SOA Instance", [@product, CpOraclecloud::SoaComponent, action: :new]%>
12
+ <% elsif comp == 'Compute' %>
13
+ <%= link_to "Create Compute Instance", [@product, CpOraclecloud::ComputeComponent, action: :new] %>
12
14
  <% end %>
13
15
  </li>
14
16
  <% end %>
data/config/routes.rb CHANGED
@@ -4,6 +4,7 @@ Rails.application.routes.draw do
4
4
  resources :database_components, type: 'CpOraclecloud::DatabaseComponent'
5
5
  resources :java_components, type: 'CpOraclecloud::JavaComponent'
6
6
  resources :soa_components, type: 'CpOraclecloud::SoaComponent'
7
+ resources :compute_components, type: 'CpOraclecloud::ComputeComponent'
7
8
  end
8
9
  end
9
10
 
@@ -15,5 +16,7 @@ Rails.application.routes.draw do
15
16
  put :backup
16
17
  end
17
18
  resources :soa_instances, type: 'CpOraclecloud::SoaInstance'
19
+ resources :compute_instances, type: 'CpOraclecloud::SoaInstance'
20
+ resources :ssh_keys
18
21
  end
19
22
  end
@@ -0,0 +1,7 @@
1
+ module CpOraclecloud
2
+ module ComputeMixin
3
+ def calculate_monthly_cost(config)
4
+ CpOraclecloud.rate_card[:compute]['hourly'] * 24 * 30
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,27 @@
1
+ module CpOraclecloud
2
+ module DatabaseMixin
3
+ def calculate_monthly_cost(config)
4
+ cost = 0
5
+ if %w(oc3 oc4 oc5 oc6).include? config['shape']
6
+ # General Compute
7
+ rates = CpOraclecloud.rate_card[:database]['general']
8
+ else
9
+ # High Memory
10
+ rates = CpOraclecloud.rate_card[:database]['high']
11
+ end
12
+ case config['edition']
13
+ when 'SE'
14
+ edition_rate = rates['standard']
15
+ when 'EE'
16
+ edition_rate = rates['enterprise']
17
+ when 'EE_HP'
18
+ edition_rate = rates['hp']
19
+ when 'EE_XP'
20
+ edition_rate = rates['xp']
21
+ end
22
+ if config['subscription_type'] == 'MONTHLY' then cost = edition_rate['monthly']
23
+ else cost = 30 * 24 * edition_rate['hourly'] end
24
+ cost
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ module CpOraclecloud
2
+ module JavaMixin
3
+ def calculate_monthly_cost(config)
4
+ if %w(oc3 oc4 oc5 oc6).include? config['shape']
5
+ # General Compute
6
+ rates = CpOraclecloud.rate_card[:java]['general']
7
+ else
8
+ # High Memory
9
+ rates = CpOraclecloud.rate_card[:java]['high']
10
+ end
11
+ case config['edition']
12
+ when 'SE'
13
+ edition_rate = rates['standard']
14
+ when 'EE'
15
+ edition_rate = rates['enterprise']
16
+ when 'Suite'
17
+ edition_rate = rates['suite']
18
+ end
19
+ if config['subscription_type'] == 'MONTHLY' then cost = edition_rate['monthly']
20
+ else cost = 30 * 24 * edition_rate['hourly'] end
21
+ cost = cost * config['num_nodes'].to_f
22
+ cost
23
+ end
24
+ end
25
+ end
26
+
27
+
@@ -0,0 +1,13 @@
1
+ module CpOraclecloud
2
+ module SoaMixin
3
+ def calculate_monthly_cost(config)
4
+ cost = 0
5
+ if config['topology'] == 'mft' then cost = CpOraclecloud.rate_card[:soa]['mft']
6
+ elsif config['topology'] == 'apim' then cost = CpOraclecloud.rate_card[:soa]['api']
7
+ else cost = CpOraclecloud.rate_card[:soa]['full'] end
8
+ cost
9
+ end
10
+ end
11
+ end
12
+
13
+
@@ -1,3 +1,3 @@
1
1
  module CpOraclecloud
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
3
3
  end
@@ -1,7 +1,8 @@
1
1
  require "cp_oraclecloud/engine"
2
2
 
3
3
  module CpOraclecloud
4
- # Your code goes here...
4
+ extend ActiveSupport::Autoload
5
+
5
6
  mattr_accessor :username
6
7
  mattr_accessor :password
7
8
  mattr_accessor :domain
@@ -9,8 +10,15 @@ module CpOraclecloud
9
10
  mattr_accessor :storage_api
10
11
  mattr_accessor :region
11
12
  mattr_accessor :active_components
13
+ mattr_accessor :rate_card
14
+
15
+ autoload :DatabaseMixin
16
+ autoload :JavaMixin
17
+ autoload :SoaMixin
18
+ autoload :ComputeMixin
12
19
 
13
20
  def self.setup
14
21
  yield self
15
22
  end
16
23
  end
24
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cp_oraclecloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Nation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-25 00:00:00.000000000 Z
11
+ date: 2016-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -55,34 +55,53 @@ files:
55
55
  - README.md
56
56
  - Rakefile
57
57
  - app/assets/config/cp_oraclecloud_manifest.js
58
+ - app/controllers/cp_oraclecloud/compute_components_controller.rb
59
+ - app/controllers/cp_oraclecloud/compute_instances_controller.rb
58
60
  - app/controllers/cp_oraclecloud/database_components_controller.rb
59
61
  - app/controllers/cp_oraclecloud/database_instances_controller.rb
60
62
  - app/controllers/cp_oraclecloud/java_components_controller.rb
61
63
  - app/controllers/cp_oraclecloud/java_instances_controller.rb
62
64
  - app/controllers/cp_oraclecloud/soa_components_controller.rb
63
65
  - app/controllers/cp_oraclecloud/soa_instances_controller.rb
66
+ - app/controllers/cp_oraclecloud/ssh_keys_controller.rb
67
+ - app/models/cp_oraclecloud/compute_component.rb
68
+ - app/models/cp_oraclecloud/compute_instance.rb
64
69
  - app/models/cp_oraclecloud/database_component.rb
65
70
  - app/models/cp_oraclecloud/database_instance.rb
66
71
  - app/models/cp_oraclecloud/java_component.rb
67
72
  - app/models/cp_oraclecloud/java_instance.rb
68
73
  - app/models/cp_oraclecloud/soa_component.rb
69
74
  - app/models/cp_oraclecloud/soa_instance.rb
75
+ - app/models/cp_oraclecloud/ssh_key.rb
76
+ - app/policies/cp_oraclecloud/compute_component_policy.rb
77
+ - app/policies/cp_oraclecloud/compute_instance_policy.rb
70
78
  - app/policies/cp_oraclecloud/database_component_policy.rb
71
79
  - app/policies/cp_oraclecloud/database_instance_policy.rb
72
80
  - app/policies/cp_oraclecloud/java_component_policy.rb
73
81
  - app/policies/cp_oraclecloud/java_instance_policy.rb
74
82
  - app/policies/cp_oraclecloud/soa_component_policy.rb
75
83
  - app/policies/cp_oraclecloud/soa_instance_policy.rb
84
+ - app/policies/cp_oraclecloud/ssh_key_policy.rb
85
+ - app/views/cp_oraclecloud/compute_components/_fields.html.erb
86
+ - app/views/cp_oraclecloud/compute_instances/_show.html.erb
76
87
  - app/views/cp_oraclecloud/database_components/_fields.html.erb
77
88
  - app/views/cp_oraclecloud/database_instances/_show.html.erb
78
89
  - app/views/cp_oraclecloud/java_components/_fields.html.erb
79
90
  - app/views/cp_oraclecloud/java_instances/_show.html.erb
80
91
  - app/views/cp_oraclecloud/soa_components/_fields.html.erb
81
92
  - app/views/cp_oraclecloud/soa_instances/_show.html.erb
93
+ - app/views/cp_oraclecloud/ssh_keys/_form.html.erb
94
+ - app/views/cp_oraclecloud/ssh_keys/edit.html.erb
95
+ - app/views/cp_oraclecloud/ssh_keys/index.html.erb
96
+ - app/views/cp_oraclecloud/ssh_keys/new.html.erb
82
97
  - app/views/products/_cp_oraclecloud_component_menu.html.erb
83
98
  - config/routes.rb
84
99
  - lib/cp_oraclecloud.rb
100
+ - lib/cp_oraclecloud/compute_mixin.rb
101
+ - lib/cp_oraclecloud/database_mixin.rb
85
102
  - lib/cp_oraclecloud/engine.rb
103
+ - lib/cp_oraclecloud/java_mixin.rb
104
+ - lib/cp_oraclecloud/soa_mixin.rb
86
105
  - lib/cp_oraclecloud/version.rb
87
106
  - lib/tasks/cp_oraclecloud_tasks.rake
88
107
  homepage: http://github.com/Joelith