Class: Avm::Instances::Base

Inherits:
Object
  • Object
show all
Includes:
Entries::Base, With::ApplicationStereotype, With::ExtraSubcommands
Defined in:
lib/avm/instances/base.rb,
lib/avm/instances/base/web.rb,
lib/avm/instances/base/install.rb,
lib/avm/instances/base/processes.rb,
lib/avm/instances/base/entry_keys.rb,
lib/avm/instances/base/auto_values.rb,
lib/avm/instances/base/dockerizable.rb,
lib/avm/instances/base/auto_values/data.rb,
lib/avm/instances/base/subcommand_parent.rb,
lib/avm/instances/base/auto_values/mailer.rb,
lib/avm/instances/base/auto_values/source.rb,
lib/avm/instances/base/auto_values/database.rb

Direct Known Subclasses

Self::Instance

Defined Under Namespace

Modules: AutoValues, Dockerizable, EntryKeys, Install, Processes, Web Classes: SubcommandParent

Constant Summary collapse

ID_PATTERN =
/\A([a-z0-9]+(?:-[a-z0-9]+)*)_(.+)\z/.freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods included from With::ApplicationStereotype

#stereotype_namespace_module

Methods included from With::ExtraSubcommands

#extra_available_subcommands, #extra_available_subcommands_from_runners_module

Methods included from Entries::Base

#entries_provider_id, #entries_provider_id!, #entry, #full_entry_path, #path_prefix, #read_entry, #read_entry_optional

Class Method Details

.by_id(id) ⇒ Object



26
27
28
29
30
# File 'lib/avm/instances/base.rb', line 26

def by_id(id)
  parsed_id = ::Avm::Instances::Ids.parse!(id)
  require 'avm/applications/base'
  new(::Avm::Applications::Base.new(parsed_id.application_id), parsed_id.instance_suffix)
end

Instance Method Details

#data_packageAvm::Instances::Data::Package



38
39
40
# File 'lib/avm/instances/base.rb', line 38

def data_package
  @data_package ||= data_package_create
end

#data_package_createAvm::Instances::Data::Package



43
44
45
# File 'lib/avm/instances/base.rb', line 43

def data_package_create
  ::Avm::Instances::Data::Package.new(self)
end

#host_env_uncachedObject



56
57
58
59
60
61
62
# File 'lib/avm/instances/base.rb', line 56

def host_env_uncached
  case install_scheme
  when 'file' then ::EacRubyUtils::Envs.local
  when 'ssh' then ::EacRubyUtils::Envs.ssh(install_url)
  else raise("Unmapped access value: \"#{install_scheme}\"")
  end
end

#idString

Returns:

  • (String)


48
49
50
# File 'lib/avm/instances/base.rb', line 48

def id
  ::Avm::Instances::Ids.build(application.id, suffix)
end

#to_sObject



52
53
54
# File 'lib/avm/instances/base.rb', line 52

def to_s
  id
end