Class: McMultiCloudImage

Inherits:
Object
  • Object
show all
Extended by:
RightScale::Api::GatewayExtend, RightScale::Api::McTaggableExtend
Includes:
RightScale::Api::Gateway, RightScale::Api::McTaggable
Defined in:
lib/rest_connection/rightscale/mc_multi_cloud_image.rb

Overview

API 1.5

Instance Attribute Summary

Attributes included from RightScale::Api::Base

#params

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RightScale::Api::GatewayExtend

create, filters, find, find_all, find_by, find_with_filter, load, load_all, parse_args, resource_post_name

Methods included from RightScale::Api::GatewayConnection

#connection

Methods included from RightScale::Api::BaseExtend

#[], #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

Methods included from RightScale::Api::BaseConnection

#connection

Methods included from RightScale::Api::McTaggableExtend

find_by_tags

Methods included from RightScale::Api::McTaggable

#add_tags, #remove_tags, #tags

Methods included from RightScale::Api::Taggable

#add_tags, #clear_tags, #get_info_tags, #get_tags_by_namespace, #remove_info_tags, #remove_tags, #remove_tags_by_namespace, #set_info_tags, #set_tags_by_namespace, #set_tags_to, #tags

Methods included from RightScale::Api::Gateway

#[], #[]=, #actions, #hash_of_links, #href, #initialize, #load, #method_missing, #nickname, #parse_params, #rediscover, #save

Methods included from RightScale::Api::Base

#[], #[]=, #destroy, #initialize, #method_missing, #rs_id, #save

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RightScale::Api::Gateway

Class Method Details

.filtersObject



55
56
57
# File 'lib/rest_connection/rightscale/mc_multi_cloud_image.rb', line 55

def self.filters
  [:description, :name, :revision]
end

.parse_args(server_template_id = nil) ⇒ Object



51
52
53
# File 'lib/rest_connection/rightscale/mc_multi_cloud_image.rb', line 51

def self.parse_args(server_template_id=nil)
  server_template_id ? "server_templates/#{server_template_id}/" : ""
end

.resource_plural_nameObject



43
44
45
# File 'lib/rest_connection/rightscale/mc_multi_cloud_image.rb', line 43

def self.resource_plural_name
  "multi_cloud_images"
end

.resource_singular_nameObject



47
48
49
# File 'lib/rest_connection/rightscale/mc_multi_cloud_image.rb', line 47

def self.resource_singular_name
  "multi_cloud_image"
end

Instance Method Details

#get_settingsObject



78
# File 'lib/rest_connection/rightscale/mc_multi_cloud_image.rb', line 78

def get_settings; settings; end

#reloadObject



63
64
65
66
# File 'lib/rest_connection/rightscale/mc_multi_cloud_image.rb', line 63

def reload
  @settings = nil
  super
end

#resource_plural_nameObject



35
36
37
# File 'lib/rest_connection/rightscale/mc_multi_cloud_image.rb', line 35

def resource_plural_name
  "multi_cloud_images"
end

#resource_singular_nameObject



39
40
41
# File 'lib/rest_connection/rightscale/mc_multi_cloud_image.rb', line 39

def resource_singular_name
  "multi_cloud_image"
end

#settingsObject

Note, only returns API 1.5 clouds, API 1.0 omitted



69
70
71
72
73
74
75
76
77
# File 'lib/rest_connection/rightscale/mc_multi_cloud_image.rb', line 69

def settings
  return @settings if @settings
  @settings = []
  url = URI.parse(self.href)
  connection.get(url.path + '/settings').each { |s|
    @settings << McMultiCloudImageSetting.new(s)
  }
  @settings
end

#supported_cloud_idsObject



59
60
61
# File 'lib/rest_connection/rightscale/mc_multi_cloud_image.rb', line 59

def supported_cloud_ids
  settings.map { |mcics| mcics.cloud_id }
end