Class: Chef::Resource::Etcd

Inherits:
Chef::Resource show all
Defined in:
lib/chef/resource/etcd.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, run_context = nil) ⇒ Etcd

Returns a new instance of Etcd.



12
13
14
15
16
17
18
19
20
21
# File 'lib/chef/resource/etcd.rb', line 12

def initialize(name, run_context=nil)
  super
  @resource_name = :etcd
  @action = [:set]
  @allowed_actions.push(:test_and_set, :delete, :get, :wait, :set)
  @key = name
  @value = nil
  @prev_value = nil
  @ttl = nil
end

Instance Method Details

#key(arg = nil) ⇒ Object



23
24
25
# File 'lib/chef/resource/etcd.rb', line 23

def key(arg=nil)
  set_or_return(:key, arg, :kind_of => String)
end

#prev_value(arg = nil) ⇒ Object



31
32
33
# File 'lib/chef/resource/etcd.rb', line 31

def prev_value(arg=nil)
  set_or_return(:prev_value, arg, :kind_of => String)
end

#ttl(arg = nil) ⇒ Object



35
36
37
# File 'lib/chef/resource/etcd.rb', line 35

def ttl(arg=nil)
  set_or_return(:ttl, arg, :kind_of => String)
end

#value(arg = nil) ⇒ Object



27
28
29
# File 'lib/chef/resource/etcd.rb', line 27

def value(arg=nil)
  set_or_return(:value, arg, :kind_of => String)
end