Class: Orchestrator::Module

Inherits:
Couchbase::Model
  • Object
show all
Includes:
CouchbaseId::Generator
Defined in:
app/models/orchestrator/module.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.allObject

Loads all the modules for this node



49
50
51
52
# File 'app/models/orchestrator/module.rb', line 49

def self.all
    # ascending order by default (device, service then logic)
    by_module_type(stale: false)
end

.dependent_on(dep_id) ⇒ Object

Finds all the modules belonging to a particular dependency



56
57
58
# File 'app/models/orchestrator/module.rb', line 56

def self.dependent_on(dep_id)
    by_dependency({key: dep_id, stale: false})
end

Instance Method Details

#hostnameObject

Device module



18
# File 'app/models/orchestrator/module.rb', line 18

def hostname; ip; end

#hostname=(host) ⇒ Object



19
# File 'app/models/orchestrator/module.rb', line 19

def hostname=(host); ip = host; end

#managerObject

helper method for looking up the manager



43
44
45
# File 'app/models/orchestrator/module.rb', line 43

def manager
    ::Orchestrator::Control.instance.loaded? self.id
end