Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cloud Volume Type model #17610

Merged
merged 2 commits into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions app/models/cloud_volume_type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class CloudVolumeType < ApplicationRecord
# CloudVolumeTypes represent various "flavors" of
# volume that are available to create within a given
# Storage service.
include NewWithTypeStiMixin
include ProviderObjectMixin

acts_as_miq_taggable

belongs_to :ext_management_system, :foreign_key => :ems_id, :class_name => "ExtManagementSystem"

def self.class_by_ems(ext_management_system)
ext_management_system && ext_management_system.class::CloudVolumeType
end
end
1 change: 1 addition & 0 deletions app/models/manageiq/providers/cloud_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class << model_name
has_many :cloud_tenants, :foreign_key => :ems_id, :dependent => :destroy
has_many :cloud_resource_quotas, :foreign_key => :ems_id, :dependent => :destroy
has_many :cloud_volumes, :foreign_key => :ems_id, :dependent => :destroy
has_many :cloud_volume_types, :foreign_key => :ems_id, :dependent => :destroy
has_many :cloud_volume_backups, :foreign_key => :ems_id, :dependent => :destroy
has_many :cloud_volume_snapshots, :foreign_key => :ems_id, :dependent => :destroy
has_many :cloud_object_store_containers, :foreign_key => :ems_id, :dependent => :destroy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module ManageIQ::Providers::StorageManager::BlockMixin
has_many :cloud_volumes, :foreign_key => :ems_id, :dependent => :destroy
has_many :cloud_volume_snapshots, :foreign_key => :ems_id, :dependent => :destroy
has_many :cloud_volume_backups, :foreign_key => :ems_id, :dependent => :destroy
has_many :cloud_volume_types, :foreign_key => :ems_id, :dependent => :destroy

supports :block_storage
end
Expand Down