Skip to content

Commit

Permalink
Merge pull request #204 from ZitaNemeckova/delete_ontap
Browse files Browse the repository at this point in the history
Remove ontap controllers and all code related to them
  • Loading branch information
martinpovolny authored Feb 13, 2017
2 parents 020b283 + acf224a commit 5dbab14
Show file tree
Hide file tree
Showing 78 changed files with 145 additions and 2,277 deletions.
Binary file removed app/assets/images/100/cim_base_storage_extent.png
Binary file not shown.
15 changes: 3 additions & 12 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ def reset_toolbar
end

# Convert Controller Name to Actual Model
# Examples:
# CimStorageExtentController => CimStorageExtent
# OntapFileShareController => OntapFileShare
def self.model
@model ||= name[0..-11].constantize
end
Expand All @@ -87,9 +84,6 @@ def self.permission_prefix
controller_name
end

# Examples:
# CimStorageExtentController => cim_storage_extent
# OntapFileShareController => ontap_file_share
def self.table_name
@table_name ||= model.name.underscore
end
Expand Down Expand Up @@ -1448,9 +1442,7 @@ def dashboard_view

def get_view_process_search_text(view)
# Check for new search by name text entered
if params[:search] &&
# Disabled search for Storage CIs until backend is fixed to handle evm_display_name field
!["CimBaseStorageExtent", "OntapStorageSystem", "OntapLogicalDisk", "OntapStorageVolume", "OntapFileShare", "SniaLocalFileSystem"].include?(view.db)
if params[:search]
@search_text = params[:search][:text].blank? ? nil : params[:search][:text].strip
elsif params[:search_text] && @explorer
@search_text = params[:search_text].blank? ? nil : params[:search_text].strip
Expand Down Expand Up @@ -1721,8 +1713,7 @@ def replace_list_grid
"show_list"
end

ajax_url = ! %w(OntapStorageSystem OntapLogicalDisk OntapStorageVolume
OntapFileShare SecurityGroup CloudVolume).include?(view.db)
ajax_url = !%w(SecurityGroup CloudVolume).include?(view.db)
ajax_url = false if request.parameters[:controller] == "service" && view.db == "Vm"
ajax_url = false unless @explorer

Expand Down Expand Up @@ -2129,7 +2120,7 @@ def set_global_session_data
# These controllers don't use breadcrumbs, see above get method to store URL
when "dashboard", "report", "support", "alert", "jobs", "ui_jobs", "miq_ae_tools", "miq_policy", "miq_action", "miq_capacity", "chargeback", "service"

when "ontap_storage_system", "ontap_logical_disk", "cim_base_storage_extent", "ontap_storage_volume", "ontap_file_share", "snia_local_file_system", "storage_manager"
when "storage_manager"
session[:tab_bc][:sto] = @breadcrumbs.dup if ["show", "show_list", "index"].include?(action_name)
when "ems_cloud", "availability_zone", "host_aggregate", "flavor"
session[:tab_bc][:clo] = @breadcrumbs.dup if ["show", "show_list"].include?(action_name)
Expand Down
60 changes: 0 additions & 60 deletions app/controllers/application_controller/ci_processing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1114,66 +1114,6 @@ def show_item
end
end

def snia_local_file_systems
@db = params[:db] ? params[:db] : request.parameters[:controller]
session[:db] = @db unless @db.nil?
@db = session[:db] unless session[:db].nil?

@record = identify_record(params[:id])
return if record_no_longer_exists?(@record)

@view = session[:view] # Restore the view from the session to get column names for the display
@display = "snia_local_file_systems"
if !params[:show].nil?
@item = SniaLocalFileSystem.find_by_id(from_cid(params[:show]))
drop_breadcrumb(:name => @record.evm_display_name + " (" + ui_lookup(:tables => "snia_local_file_system") + ")", :url => "/#{@db}/snia_local_file_systems/#{@record.id}?page=#{@current_page}")
drop_breadcrumb(:name => @item.evm_display_name, :url => "/#{@db}/show/#{@record.id}?show=#{@item.id}")
show_item
else
drop_breadcrumb(:name => @record.evm_display_name + " (" + ui_lookup(:tables => "snia_local_file_system") + ")", :url => "/#{@db}/snia_local_file_systems/#{@record.id}")
# generate the grid/tile/list url to come back here when gtl buttons are pressed
@gtl_url = "/#{@db}/snia_local_file_systems/" + @record.id.to_s + "?"
@showtype = "details"

table_name = "snia_local_file_systems"
model_name = table_name.classify.constantize
drop_breadcrumb(:name => @record.evm_display_name + " (All #{ui_lookup(:tables => @display.singularize)})", :url => "/#{self.class.table_name}/show/#{@record.id}?display=#{@display}")
@view, @pages = get_view(model_name, :parent => @record, :parent_method => :local_file_systems) # Get the records (into a view) and the paginator
render :action => 'show'
end
end

def cim_base_storage_extents
@db = params[:db] ? params[:db] : request.parameters[:controller]
session[:db] = @db unless @db.nil?
@db = session[:db] unless session[:db].nil?

@record = identify_record(params[:id])
return if record_no_longer_exists?(@record)

@view = session[:view] # Restore the view from the session to get column names for the display
@display = "cim_base_storage_extents"
if !params[:show].nil?
@item = CimBaseStorageExtent.find_by_id(from_cid(params[:show]))
drop_breadcrumb(:name => @record.evm_display_name + " (" + ui_lookup(:tables => "cim_base_storage_extent") + ")", :url => "/#{@db}/cim_base_storage_extents/#{@record.id}?page=#{@current_page}")
drop_breadcrumb(:name => @item.evm_display_name, :url => "/#{@db}/show/#{@record.id}?show=#{@item.id}")
show_item
else
drop_breadcrumb(:name => @record.evm_display_name + " (" + ui_lookup(:tables => "cim_base_storage_extent") + ")", :url => "/#{@db}/cim_base_storage_extents/#{@record.id}")
# generate the grid/tile/list url to come back here when gtl buttons are pressed
@gtl_url = "/#{@db}/cim_base_storage_extents/" + @record.id.to_s + "?"
@showtype = "details"

table_name = "cim_base_storage_extents"
model_name = table_name.classify.constantize
drop_breadcrumb(:name => _("%{name} (All %{tables})") % {:name => @record.evm_display_name,
:tables => ui_lookup(:tables => @display.singularize)},
:url => "/#{self.class.table_name}/show/#{@record.id}?display=#{@display}")
@view, @pages = get_view(model_name, :parent => @record, :parent_method => :base_storage_extents) # Get the records (into a view) and the paginator
render :action => 'show'
end
end

def get_record(db)
if db == "host"
@host = @record = identify_record(params[:id], Host)
Expand Down
39 changes: 2 additions & 37 deletions app/controllers/application_controller/performance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def perf_gen_init_options(refresh = nil)
@perf_options[:typ] = "Hourly" if @perf_record.class.name.starts_with?("Vmdb")
@perf_options[:days] = "7"
@perf_options[:rt_minutes] = 15.minutes
@perf_options[:model] = @perf_record.kind_of?(MiqCimInstance) ? @perf_record.class.to_s : @perf_record.class.base_class.to_s
@perf_options[:model] = @perf_record.class.base_class.to_s
end
@perf_options[:rt_minutes] ||= 15.minutes
@perf_options[:cats] ||= perf_build_cats(@perf_options[:model]) if ["EmsCluster", "Host", "Storage", "AvailabilityZone", "HostAggregate"].include?(@perf_options[:model])
Expand Down Expand Up @@ -650,26 +650,7 @@ def perf_gen_data_before_wait
end

# Get the report definition (yaml) and set the where clause based on the record type
if @perf_record.kind_of?(MiqCimInstance)
rpt = perf_get_chart_rpt(@perf_options[:model].underscore)
if interval_type == "hourly"
rpt.where_clause = ["miq_cim_instance_id = ? and statistic_time >= ? and statistic_time <= ? and rollup_type = ?",
@perf_record.id,
from_dt,
to_dt,
interval_type]
elsif interval_type == "daily"
tz = @perf_options["tz#{@perf_options[:typ] == "Daily" ? "_daily" : ""}".to_sym]
tp = @perf_options[:time_profile] ||
TimeProfile.rollup_daily_metrics.find_all_with_entire_tz.detect { |p| p.tz_or_default == tz }.id
rpt.where_clause = ["miq_cim_instance_id = ? and statistic_time >= ? and statistic_time <= ? and rollup_type = ? and time_profile_id = ?",
@perf_record.id,
from_dt,
to_dt,
interval_type,
tp]
end
elsif @perf_record.kind_of?(VmdbDatabase)
if @perf_record.kind_of?(VmdbDatabase)
rpt = perf_get_chart_rpt(@perf_options[:model].underscore)
rpt.where_clause = ["vmdb_database_id = ? and timestamp >= ? and timestamp <= ? and capture_interval_name = ?",
@perf_record.id,
Expand Down Expand Up @@ -739,16 +720,6 @@ def perf_gen_data_before_wait
p_rpt.where_clause[1] = @perf_options[:parent]
p_rpt.where_clause[2] = @perf_record.send(VALID_PERF_PARENTS[@perf_options[:parent]]).id
rpts.push(p_rpt)
elsif perf_compare_vm? # Build the compare to VM report, i0f asked for
c_rpt = perf_get_chart_rpt("vim_perf_#{@perf_options[:typ].downcase}")
c_rpt.tz = @perf_options[:tz]
c_rpt.time_profile_id = @perf_options[:time_profile]
c_rpt.where_clause = ["resource_type = ? and resource_id = ? and timestamp >= ? and timestamp <= ?",
"VmOrTemplate",
@perf_options[:compare_vm],
from_dt,
to_dt]
rpts.push(c_rpt)
end

initiate_wait_for_task(:task_id => MiqReport.async_generate_tables(:reports => rpts, :userid => session[:userid]))
Expand All @@ -759,24 +730,18 @@ def perf_gen_data_after_wait
miq_task = MiqTask.find(params[:task_id]) # Not first time, read the task record
rpt = miq_task.task_results.first # Grab the only report in the array of reports returned
p_rpt = miq_task.task_results[1] if perf_parent? # Grab the parent report in the array of reports returned
c_rpt = miq_task.task_results[1] if perf_compare_vm? # Grab the compare VM report in the array of reports returned
miq_task.destroy # Get rid of the task and results

@charts, @chart_data = perf_gen_charts(rpt, @perf_options)
if perf_parent?
@parent_charts, @parent_chart_data =
perf_gen_charts(p_rpt, @perf_options.merge(:model => "Parent-#{@perf_options[:parent]}"))
elsif perf_compare_vm?
@compare_vm = VmOrTemplate.find_by_id(@perf_options[:compare_vm]) # Get rec for view to use
@compare_vm_charts, @compare_vm_chart_data =
perf_gen_charts(c_rpt, @perf_options.merge(:model => "VmOrTemplate"))
end

@sb[:chart_reports] = rpt # Hang on to the report data for these charts

@html = perf_report_to_html
@p_html = perf_report_to_html(p_rpt, @parent_charts[0]) if perf_parent?
@c_html = perf_report_to_html(c_rpt, @compare_vm_charts[0]) if perf_compare_vm? && !@compare_vm_charts.empty?
end

# Return the column in the chart that starts with "trend_"
Expand Down
146 changes: 0 additions & 146 deletions app/controllers/cim_instance_controller.rb

This file was deleted.

16 changes: 0 additions & 16 deletions app/controllers/cim_storage_extent_controller.rb

This file was deleted.

28 changes: 0 additions & 28 deletions app/controllers/ems_cluster_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,34 +90,6 @@ def show
:url => "/ems_cluster/show/#{@ems_cluster.id}?display=storage")
@view, @pages = get_view(Storage, :parent => @ems_cluster) # Get the records (into a view) and the paginator
@showtype = "storage"

when "storage_extents"
drop_breadcrumb(:name => @ems_cluster.name + _(" (All %{tables})") %
{:tables => ui_lookup(:tables => "cim_base_storage_extent")},
:url => "/ems_cluster/show/#{@ems_cluster.id}?display=storage_extents")
@view, @pages = get_view(CimBaseStorageExtent, :parent => @ems_cluster, :parent_method => :base_storage_extents) # Get the records (into a view) and the paginator
@showtype = "storage_extents"

when "storage_systems"
drop_breadcrumb(:name => @ems_cluster.name + _(" (All %{tables})") %
{:tables => ui_lookup(:tables => "ontap_storage_system")},
:url => "/ems_cluster/show/#{@ems_cluster.id}?display=storage_systems")
@view, @pages = get_view(OntapStorageSystem, :parent => @ems_cluster, :parent_method => :storage_systems) # Get the records (into a view) and the paginator
@showtype = "storage_systems"

when "ontap_storage_volumes"
drop_breadcrumb(:name => @ems_cluster.name + _(" (All %{tables})") %
{:tables => ui_lookup(:tables => "ontap_storage_volume")},
:url => "/ems_cluster/show/#{@ems_cluster.id}?display=ontap_storage_volumes")
@view, @pages = get_view(OntapStorageVolume, :parent => @ems_cluster, :parent_method => :storage_volumes) # Get the records (into a view) and the paginator
@showtype = "ontap_storage_volumes"

when "ontap_file_shares"
drop_breadcrumb(:name => @ems_cluster.name + _(" (All %{tables})") %
{:tables => ui_lookup(:tables => "ontap_file_share")},
:url => "/ems_cluster/show/#{@ems_cluster.id}?display=ontap_file_shares")
@view, @pages = get_view(OntapFileShare, :parent => @ems_cluster, :parent_method => :file_shares) # Get the records (into a view) and the paginator
@showtype = "ontap_file_shares"
end

set_config(@ems_cluster)
Expand Down
Loading

0 comments on commit 5dbab14

Please sign in to comment.