Class: Azure::AGs
- Inherits:
-
Object
- Object
- Azure::AGs
- Defined in:
- lib/azure/service_management/ag.rb
Instance Method Summary collapse
- #all ⇒ Object
- #create(params) ⇒ Object
- #exists?(name) ⇒ Boolean
- #find(name) ⇒ Object
-
#initialize(connection) ⇒ AGs
constructor
A new instance of AGs.
- #load ⇒ Object
Constructor Details
#initialize(connection) ⇒ AGs
Returns a new instance of AGs.
21 22 23 |
# File 'lib/azure/service_management/ag.rb', line 21 def initialize(connection) @connection = connection end |
Instance Method Details
#all ⇒ Object
42 43 44 |
# File 'lib/azure/service_management/ag.rb', line 42 def all load.values end |
#create(params) ⇒ Object
54 55 56 57 |
# File 'lib/azure/service_management/ag.rb', line 54 def create(params) ag = AG.new(@connection) ag.create(params) end |
#exists?(name) ⇒ Boolean
46 47 48 |
# File 'lib/azure/service_management/ag.rb', line 46 def exists?(name) load.key?(name) end |
#find(name) ⇒ Object
50 51 52 |
# File 'lib/azure/service_management/ag.rb', line 50 def find(name) load[name] end |
#load ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/azure/service_management/ag.rb', line 25 def load @ags ||= begin @ags = {} response = @connection.query_azure("affinitygroups", "get", "", "", true, false) response.css("AffinityGroup").each do |ag| item = AG.new(@connection).parse(ag) @ags[item.name] = item end @ags end end |