module

Etcd::Keys

Keys module provides the basic key value operations against etcd /keys namespace

Instance methods

compare_and_swap(key : String, opts : Options = Options.new) : Response

Set a new value for key if previous value of key is matched

This method takes the following parameters as arguments

  • key - whose value is going to change if previous value is matched
  • value - new value to be set for specified key
  • prevValue - value of a key to compare with existing value of key
  • ttl - shelf life of a key (in secsonds) (optional)
Source
create(key : String, opts : Options)
Source
create(key : String)
Source
create_in_order(dir : String, opts : Options = Options.new) : Response
Source
delete(key : String, opts : Options = Options.new) : Response

Deletes a key (and its content)

This method takes the following parameters as arguments

  • key - key to be deleted
Source
exists?(key)
Source
get(key : String, opts : Options = Options.new) : Response

Retrives a key with its associated data, if key is not present it will return with message "Key Not Found"

This method takes the following parameters as arguments

  • key - whose data is to be retrieved
Source
key_endpoint

return etcd endpoint that is reserved for key/value store

Source
set(key : String, opts : Options = Options.new) : Response

Create or update a new key

This method takes the following parameters as arguments

  • key - whose value to be set
  • value - value to be set for specified key
  • ttl - shelf life of a key (in seconds) (optional)
Source
update(key : String, opts : Options)
Source
update(key : String)
Source
watch(key : String, opts : Options = Options.new, timeout : Int32 = -1) : Response

Gives a notification when specified key changes

This method takes the following parameters as arguments @ key - key to be watched @options [Hash] additional options for watching a key @options [Fixnum] :index watch the specified key from given index @options [Fixnum] :timeout specify http timeout

Source