Sha256: 344f0718e49afc2f2e1d97f5e8dbeba18dd9cc087c447014d70250f8881ca06c

Contents?: true

Size: 1.47 KB

Versions: 28

Compression:

Stored size: 1.47 KB

Contents

module Fog
  module Sql
    class AzureRM
      # Sql Server model for Server Service
      class SqlServer < Fog::Model
        identity :name
        attribute :id
        attribute :type
        attribute :resource_group
        attribute :location
        attribute :version
        attribute :state
        attribute :administrator_login
        attribute :administrator_login_password
        attribute :fully_qualified_domain_name, aliases: %w(fullyQualifiedDomainName)
        attribute :tags

        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

        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

        def destroy
          service.delete_sql_server(resource_group, name)
        end

        private

        def format_sql_server_params
          {
            resource_group: resource_group,
            name: name,
            version: version,
            location: location,
            administrator_login: administrator_login,
            administrator_login_password: administrator_login_password,
            tags: tags
          }
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
fog-azure-rm-0.6.0 lib/fog/azurerm/models/sql/sql_server.rb
fog-azure-rm-0.5.3 lib/fog/azurerm/models/sql/sql_server.rb
fog-azure-rm-0.5.2 lib/fog/azurerm/models/sql/sql_server.rb
far-gem-0.5.6 lib/fog/azurerm/models/sql/sql_server.rb
fog-azure-rm-0.5.1 lib/fog/azurerm/models/sql/sql_server.rb
far-gem-0.5.5 lib/fog/azurerm/models/sql/sql_server.rb
fog-azure-rm-0.5.0 lib/fog/azurerm/models/sql/sql_server.rb
far-gem-0.5.4 lib/fog/azurerm/models/sql/sql_server.rb
far-gem-0.5.3 lib/fog/azurerm/models/sql/sql_server.rb
fog-azure-rm-0.4.9 lib/fog/azurerm/models/sql/sql_server.rb
far-gem-0.5.2 lib/fog/azurerm/models/sql/sql_server.rb
fog-azure-rm-0.4.8 lib/fog/azurerm/models/sql/sql_server.rb
fog-azure-rm-0.4.7 lib/fog/azurerm/models/sql/sql_server.rb
fog-azure-rm-0.4.6 lib/fog/azurerm/models/sql/sql_server.rb
fog-azure-rm-0.4.5 lib/fog/azurerm/models/sql/sql_server.rb
fog-azure-rm-temp-0.0.5 lib/fog/azurerm/models/sql/sql_server.rb
fog-azure-rm-0.4.4 lib/fog/azurerm/models/sql/sql_server.rb
fog-azure-rm-0.4.3 lib/fog/azurerm/models/sql/sql_server.rb
far-gem-0.5.1 lib/fog/azurerm/models/sql/sql_server.rb
fog-azure-rm-0.4.2 lib/fog/azurerm/models/sql/sql_server.rb