Class: ElasticDot::Command::Services

Inherits:
Base
  • Object
show all
Defined in:
lib/elasticdot/command/services.rb

Class Method Summary collapse

Class Method Details

.create(args, opts) ⇒ Object


2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/elasticdot/command/services.rb', line 2

def self.create(args, opts)
  info = api.post '/domains', domain: args[0], type: 'service'

  if info['error']
    puts info['error']
    exit 1
  end

  puts "Creating service app #{info['app_name']}... done"
  puts info['app_repo']

  create_git_remote 'elasticdot', info['app_repo']
end

.destroy(opts) ⇒ Object


16
17
18
19
20
21
22
# File 'lib/elasticdot/command/services.rb', line 16

def self.destroy(opts)
  find_app! opts

  spinner "Destroying app #{@app}..." do
    api.delete "/domains/#{@app}"
  end
end

.info(opts) ⇒ Object


24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/elasticdot/command/services.rb', line 24

def self.info(opts)
  find_app! opts

  h = api.get "/domains/#{@app}"

  puts "=== #{@app}"
  puts
  puts "Git URL:\t#{h['git_repo']}"
  puts "Owner Email:\t#{h['owner_email']}"
  puts "Region:\t\tEU"
  #   puts "Slug Size:\t#{h['slug_size']}"
end

.listObject


37
38
39
40
41
# File 'lib/elasticdot/command/services.rb', line 37

def self.list
  apps = api.get "/apps?type=service"
  puts '=== My Services'
  apps.each { |app| puts app }
end