Module: Virtuatable::Builders::Helpers::Registration
- Extended by:
- ActiveSupport::Concern
- Included in:
- Base
- Defined in:
- lib/virtuatable/builders/helpers/registration.rb
Overview
Registers the service in the database by declaring it as a Arkaan::Monitoring::Service object, and declaring the instance.
Instance Attribute Summary collapse
-
#instance ⇒ Object
readonly
Returns the value of attribute instance.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
-
#load_registration! ⇒ Object
Registers the service in the micro-services registry (consisting in the arkaan_monitoring_services and arkaan_monitoring_instances collections).
Instance Attribute Details
#instance ⇒ Object (readonly)
Returns the value of attribute instance.
17 18 19 |
# File 'lib/virtuatable/builders/helpers/registration.rb', line 17 def instance @instance end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
14 15 16 |
# File 'lib/virtuatable/builders/helpers/registration.rb', line 14 def service @service end |
Instance Method Details
#load_registration! ⇒ Object
Registers the service in the micro-services registry (consisting in the arkaan_monitoring_services and arkaan_monitoring_instances collections)
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/virtuatable/builders/helpers/registration.rb', line 25 def load_registration! @service = Arkaan::Monitoring::Service.first_or_create!( key: @name, path: "/#{@name}" ) @instance = service.instances.first_or_create!( type: type, url: ENV['SERVICE_URL'] ) end |