Class: Dip::CLI::DNS

Inherits:
Base
  • Object
show all
Defined in:
lib/dip/cli/dns.rb

Overview

Instance Method Summary collapse

Methods inherited from Base

exit_on_failure?

Instance Method Details

#downObject



46
47
48
49
50
51
52
53
54
# File 'lib/dip/cli/dns.rb', line 46

def down
  if options[:help]
    invoke :help, ["down"]
  else
    Dip::Commands::DNS::Down.new(
      name: options.fetch(:name)
    ).execute
  end
end

#ipObject



76
77
78
79
80
81
82
83
84
85
# File 'lib/dip/cli/dns.rb', line 76

def ip
  if options[:help]
    invoke :help, ["status"]
  else
    Dip::Commands::DNS::IP.new(
      name: options.fetch(:name),
      net: options.fetch(:net)
    ).execute
  end
end

#restart(*args) ⇒ Object



59
60
61
62
63
64
65
66
67
# File 'lib/dip/cli/dns.rb', line 59

def restart(*args)
  if options[:help]
    invoke :help, ["restart"]
  else
    Dip::CLI::DNS.start(["down"] + args)
    sleep 1
    Dip::CLI::DNS.start(["up"] + args)
  end
end

#upObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/dip/cli/dns.rb', line 26

def up
  if options[:help]
    invoke :help, ["up"]
  else
    Dip::Commands::DNS::Up.new(
      name: options.fetch(:name),
      socket: options.fetch(:socket),
      net: options.fetch(:net),
      publish: options.fetch(:publish),
      image: options.fetch(:image),
      domain: options.fetch(:domain)
    ).execute
  end
end