class Cloudkeeper::Aws::ProtoHelper
Module refining basic GRPC structs with additional methods
used for conversion from one format to another
Constants
- APPLIANCE_PREFIX
- EXTRA_APPLIANCE_TAGS
- IMAGE_PREFIX
- NAME_TAG_KEY
Public Class Methods
appliance_prepare_values(appliance)
click to toggle source
# File lib/cloudkeeper/aws/proto_helper.rb, line 45 def appliance_prepare_values(appliance) appliance[:ram] = appliance[:ram].to_i appliance[:core] = appliance[:core].to_i appliance[:expiration_date] = appliance[:expiration_date].to_i appliance end
image_prepare_values(image)
click to toggle source
# File lib/cloudkeeper/aws/proto_helper.rb, line 61 def image_prepare_values(image) image[:size] = image[:size].to_i image[:mode] = image[:mode].upcase.to_sym image[:format] = image[:format].upcase.to_sym image end
remove_prefix(tags, prefix)
click to toggle source
# File lib/cloudkeeper/aws/proto_helper.rb, line 16 def remove_prefix(tags, prefix) tags.map { |tag| { tag[:key].sub(prefix, '').to_sym => tag[:value] } }.reduce(&:merge) end