-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parsing information about objects on S3 buckets. Calculating bucket's size and object count.
- Loading branch information
Showing
9 changed files
with
222 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 27 additions & 29 deletions
56
app/models/manageiq/providers/amazon/storage_manager/ebs/refresher.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,39 @@ | ||
module ManageIQ::Providers | ||
class Amazon::StorageManager::Ebs::Refresher < ManageIQ::Providers::BaseManager::Refresher | ||
include ::EmsRefresh::Refreshers::EmsRefresherMixin | ||
class ManageIQ::Providers::Amazon::StorageManager::Ebs::Refresher < ManageIQ::Providers::BaseManager::Refresher | ||
include ::EmsRefresh::Refreshers::EmsRefresherMixin | ||
|
||
def collect_inventory_for_targets(ems, targets) | ||
targets_with_data = targets.collect do |target| | ||
target_name = target.try(:name) || target.try(:event_type) | ||
def collect_inventory_for_targets(ems, targets) | ||
targets_with_data = targets.collect do |target| | ||
target_name = target.try(:name) || target.try(:event_type) | ||
|
||
_log.info "Filtering inventory for #{target.class} [#{target_name}] id: [#{target.id}]..." | ||
_log.info "Filtering inventory for #{target.class} [#{target_name}] id: [#{target.id}]..." | ||
|
||
if refresher_options.try(:[], :inventory_object_refresh) | ||
inventory = ManageIQ::Providers::Amazon::Builder.build_inventory(ems, target) | ||
end | ||
|
||
_log.info "Filtering inventory...Complete" | ||
[target, inventory] | ||
if refresher_options.try(:[], :inventory_object_refresh) | ||
inventory = ManageIQ::Providers::Amazon::Builder.build_inventory(ems, target) | ||
end | ||
|
||
targets_with_data | ||
_log.info "Filtering inventory...Complete" | ||
[target, inventory] | ||
end | ||
|
||
def parse_targeted_inventory(ems, _target, inventory) | ||
log_header = format_ems_for_logging(ems) | ||
_log.debug "#{log_header} Parsing inventory..." | ||
hashes, = Benchmark.realtime_block(:parse_inventory) do | ||
if refresher_options.try(:[], :inventory_object_refresh) | ||
inventory.inventory_collections | ||
else | ||
ManageIQ::Providers::Amazon::StorageManager::Ebs::RefreshParser.ems_inv_to_hashes(ems, refresher_options) | ||
end | ||
end | ||
_log.debug "#{log_header} Parsing inventory...Complete" | ||
targets_with_data | ||
end | ||
|
||
hashes | ||
def parse_targeted_inventory(ems, _target, inventory) | ||
log_header = format_ems_for_logging(ems) | ||
_log.debug "#{log_header} Parsing inventory..." | ||
hashes, = Benchmark.realtime_block(:parse_inventory) do | ||
if refresher_options.try(:[], :inventory_object_refresh) | ||
inventory.inventory_collections | ||
else | ||
ManageIQ::Providers::Amazon::StorageManager::Ebs::RefreshParser.ems_inv_to_hashes(ems, refresher_options) | ||
end | ||
end | ||
_log.debug "#{log_header} Parsing inventory...Complete" | ||
|
||
def post_process_refresh_classes | ||
[] | ||
end | ||
hashes | ||
end | ||
|
||
def post_process_refresh_classes | ||
[] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.