Sha256: 337ddec740bf80b80ea2542c49047aee36daa3c4cbce4d6d0a098e6445375339
Contents?: true
Size: 1.35 KB
Versions: 7
Compression:
Stored size: 1.35 KB
Contents
require "fog/core/collection" module Fog module Compute class XenServer module Models class Servers < Collection model Fog::Compute::XenServer::Models::Server def templates Fog::Logger.deprecation "This method is DEPRECATED. Call #templates directly on the connection instead." service.templates end def custom_templates Fog::Logger.deprecation "This method is DEPRECATED. Call #custom_templates directly on the connection instead." service.custom_templates end def builtin_templates Fog::Logger.deprecation "This method is DEPRECATED. Call #builtin_templates directly on the connection instead." service.builtin_templates end def all(options = {}) data = service.get_records "VM" # Exclude templates data.delete_if { |vm| vm[:is_control_domain] or vm[:is_a_template] } data.delete_if { |vm| vm[:is_a_snapshot] and !options[:include_snapshots] } data.delete_if { |vm| options[:name_matches] and (vm[:name_label] !~ /#{Regexp.escape(options[:name_matches])}/i ) } data.delete_if { |vm| options[:name_equals] and (vm[:name_label] != options[:name_equals] ) } load(data) end end end end end end
Version data entries
7 entries across 5 versions & 2 rubygems