Class: MultiCloudImageInternal
  
  
  
Overview
  
  Instance Attribute Summary
  
  
  #params
  
    
      Class Method Summary
      collapse
    
    
  
    
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  
  [], create, deny_methods, filters, find, find_all, find_by, find_by_cloud_id, find_by_id, find_by_nickname, find_by_nickname_speed, find_with_filter
  
  
  
  
  
  
  
  
  
  #connection
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  #connection
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  #[], #[]=, #destroy, #method_missing, #reload, #rs_id, #save
  Constructor Details
  
    
  
  
    
Returns a new instance of MultiCloudImageInternal.
   
 
  
  
    
      
70
71
72
73 
     | 
    
      # File 'lib/rest_connection/rightscale/multi_cloud_image_internal.rb', line 70
def initialize(params={})
  @params = params
  transform_settings
end
     | 
  
 
  
 
  Dynamic Method Handling
  
    This class handles dynamic methods through the method_missing method
    
      in the class RightScale::Api::Base
    
  
  
 
  
    Class Method Details
    
      
  
  
    .resource_plural_name  ⇒ Object 
  
  
  
  
    
      
41
42
43 
     | 
    
      # File 'lib/rest_connection/rightscale/multi_cloud_image_internal.rb', line 41
def self.resource_plural_name
  "multi_cloud_images"
end 
     | 
  
 
    
      
  
  
    .resource_singular_name  ⇒ Object 
  
  
  
  
    
      
45
46
47 
     | 
    
      # File 'lib/rest_connection/rightscale/multi_cloud_image_internal.rb', line 45
def self.resource_singular_name
  "multi_cloud_image"
end 
     | 
  
 
    
   
  
    Instance Method Details
    
      
  
  
    #clone  ⇒ Object 
  
  
  
  
    
      
54
55
56
57 
     | 
    
      # File 'lib/rest_connection/rightscale/multi_cloud_image_internal.rb', line 54
def clone
  t = URI.parse(self.href)
  MultiCloudImage.new(:href => connection.post(t.path + "/clone"))
end 
     | 
  
 
    
      
  
  
    #commit(message)  ⇒ Object 
  
  
  
  
    
      
49
50
51
52 
     | 
    
      # File 'lib/rest_connection/rightscale/multi_cloud_image_internal.rb', line 49
def commit(message)
  t = URI.parse(self.href)
  MultiCloudImage.new(:href => connection.post(t.path + "/commit"))
end 
     | 
  
 
    
      
  
  
    #resource_plural_name  ⇒ Object 
  
  
  
  
    
      
33
34
35 
     | 
    
      # File 'lib/rest_connection/rightscale/multi_cloud_image_internal.rb', line 33
def resource_plural_name
  "multi_cloud_images"
end 
     | 
  
 
    
      
  
  
    #resource_singular_name  ⇒ Object 
  
  
  
  
    
      
37
38
39 
     | 
    
      # File 'lib/rest_connection/rightscale/multi_cloud_image_internal.rb', line 37
def resource_singular_name
  "multi_cloud_image"
end 
     | 
  
 
    
      
  
  
    #settings  ⇒ Object 
  
  
  
  
    
      
75
76
77
78 
     | 
    
      # File 'lib/rest_connection/rightscale/multi_cloud_image_internal.rb', line 75
def settings
  transform_settings
  @params["multi_cloud_image_cloud_settings"]
end 
     | 
  
 
    
      
  
  
    #supported_cloud_ids  ⇒ Object 
  
  
  
  
    
      
80
81
82 
     | 
    
      # File 'lib/rest_connection/rightscale/multi_cloud_image_internal.rb', line 80
def supported_cloud_ids
  @params["multi_cloud_image_cloud_settings"].map { |mcics| mcics.cloud_id }
end
     | 
  
 
    
      
  
  
    
      
59
60
61
62
63
64
65
66
67
68 
     | 
    
      # File 'lib/rest_connection/rightscale/multi_cloud_image_internal.rb', line 59
def transform_settings
  if @params["multi_cloud_image_cloud_settings"] && @params["multi_cloud_image_cloud_settings"].first.is_a?(Hash)
    @params["multi_cloud_image_cloud_settings"].map! { |setting|
            next if setting["fingerprint"] || setting["cloud_id"] > 10
      MultiCloudImageCloudSettingInternal.new(setting)
    }
    @params["multi_cloud_image_cloud_settings"].compact!
  end
end
     |