Class: Fog::Resources::AzureRM::ResourceGroup

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/azurerm/models/resources/resource_group.rb

Overview

This class is giving implementation of create/save and delete/destroy for resource group.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(resource_group) ⇒ Object


12
13
14
15
16
17
18
19
# File 'lib/fog/azurerm/models/resources/resource_group.rb', line 12

def self.parse(resource_group)
  hash = {}
  hash['id'] = resource_group.id
  hash['name'] = resource_group.name
  hash['location'] = resource_group.location
  hash['tags'] = resource_group.tags
  hash
end

Instance Method Details

#destroyObject


28
29
30
# File 'lib/fog/azurerm/models/resources/resource_group.rb', line 28

def destroy
  service.delete_resource_group(name)
end

#saveObject


21
22
23
24
25
26
# File 'lib/fog/azurerm/models/resources/resource_group.rb', line 21

def save
  requires :name
  requires :location
  resource_group = service.create_resource_group(name, location, tags)
  merge_attributes(Fog::Resources::AzureRM::ResourceGroup.parse(resource_group))
end