Class: Fog::Sql::AzureRM::SqlServer

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

Overview

Sql Server model for Server Service

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(server) ⇒ Object



18
19
20
21
22
# File 'lib/fog/azurerm/models/sql/sql_server.rb', line 18

def self.parse(server)
  sql_server_hash = get_hash_from_object(server)
  sql_server_hash['resource_group'] = get_resource_group_from_id(server.id)
  sql_server_hash
end

Instance Method Details

#destroyObject



30
31
32
# File 'lib/fog/azurerm/models/sql/sql_server.rb', line 30

def destroy
  service.delete_sql_server(resource_group, name)
end

#saveObject



24
25
26
27
28
# File 'lib/fog/azurerm/models/sql/sql_server.rb', line 24

def save
  requires :name, :resource_group, :location, :version, :administrator_login, :administrator_login_password
  sql_server = service.create_or_update_sql_server(format_sql_server_params)
  merge_attributes(Fog::Sql::AzureRM::SqlServer.parse(sql_server))
end