Class: DokkuClient::Plugins::Mongodb

Inherits:
Base
  • Object
show all
Defined in:
lib/dokku_client/plugins/mongodb.rb

Constant Summary

Constants inherited from Base

Base::GIT_DIR, Base::KEYS_AND_QUESTIONS

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#common_description, #dokku, #git_directory_present?, #initialize, #plugin_enabled, #reconfig

Constructor Details

This class inherits a constructor from DokkuClient::Base

Instance Method Details

#commands(opts) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/dokku_client/plugins/mongodb.rb', line 36

def commands opts
  if plugin_enabled('mongodb')
    opts.separator  "\n   MongoDB commands:"
    opts.separator  "     mongodb:create                        create a mongo database"
    opts.separator  "     mongodb:delete                        delete a mongo database"
    opts.separator  "     mongodb:console                       lunch mongodb console as admin"
    opts.separator  "     mongodb:link                          link mongo container to application"
    opts.separator  "     mongodb:logs                          display logs for mongo container"
    opts.separator  "     mongodb:list                          list all mongo databases"
    opts.separator  "     mongodb:status                        display status of mongo container"
  end
end

#console_mongodbObject



12
13
14
# File 'lib/dokku_client/plugins/mongodb.rb', line 12

def console_mongodb
  dokku "mongodb:console"
end

#create_mongodbObject



8
9
10
# File 'lib/dokku_client/plugins/mongodb.rb', line 8

def create_mongodb
  dokku "mongodb:create #{@options["project-name"]}"
end

#delete_mongodbObject



16
17
18
# File 'lib/dokku_client/plugins/mongodb.rb', line 16

def delete_mongodb
  dokku "mongodb:delete #{@options["project-name"]}"
end


28
29
30
# File 'lib/dokku_client/plugins/mongodb.rb', line 28

def link_mongodb
  dokku "mongodb:link #{@options["project-name"]}"
end

#list_mongodbObject



20
21
22
# File 'lib/dokku_client/plugins/mongodb.rb', line 20

def list_mongodb
  dokku "mongodb:list"
end

#logs_mongodbObject



24
25
26
# File 'lib/dokku_client/plugins/mongodb.rb', line 24

def logs_mongodb
  dokku "mongodb:logs"
end

#runObject



5
6
# File 'lib/dokku_client/plugins/mongodb.rb', line 5

def run
end

#status_mongodbObject



32
33
34
# File 'lib/dokku_client/plugins/mongodb.rb', line 32

def status_mongodb
  dokku "mongodb:status"
end