class Etcd::Kv
- Etcd::Kv
- Reference
- Object
Included Modules
Defined in:
etcd/kv.crConstant Summary
-
Log =
::Log.for(self)
Constructors
Instance Method Summary
-
#compare_and_swap(key, value, previous_value, lease_id : Int64 = 0_i64) : Bool
Sets a
key
if the givenprevious_value
matches the existing value forkey
-
#delete(key, range_end : String | Nil = nil, base64_keys : Bool = true)
Deletes key or range of keys
-
#delete_prefix(prefix)
Deletes an entire keyspace prefix
- #get(key) : String | Nil
-
#move(key : String, key_destination : String, value, lease : Int64 = 0_i64) : Bool
Moves a value from
key
tokey_destination
, deleting the kv atkey
in the process. -
#put(key : String, value, lease : Int64 = 0_i64, prev_kv : Bool | Nil = nil, ignore_value : Bool | Nil = nil, ignore_lease : Bool | Nil = nil)
Sets a key and value in etcd.
-
#put_not_exists(key : String, value, lease : Int64 = 0_i64) : Bool
Sets a key if the key is not already present.
-
#range(key, range_end : String | Nil = nil, base64_keys : Bool = true)
Queries a range of keys
-
#range_greater_than_or_equal(key)
Query all keys >= key
-
#range_prefix(prefix)
Query keys beneath a prefix
Instance methods inherited from module Etcd::Utils
prefix_range_end(prefix)
prefix_range_end
Constructor Detail
Instance Method Detail
Sets a key
if the given previous_value
matches the existing value for key
Wrapper over the etcd transaction API.
Deletes key or range of keys
Moves a value from key
to key_destination
, deleting the kv at key
in the process.
Sets a key and value in etcd. key key is the string that will be base64 encoded and associated with value in the kv store String value value is the string that will be base64 encoded and associated with key in the kv store String opts lease lease is the lease ID to associate with the key in the key-value store. A lease value of 0 indicates no lease. Int64 prev_kv If prev_kv is set, etcd gets the previous key-value pair before changing it. The previous key-value pair will be returned in the put response. Bool ignore_value If ignore_value is set, etcd updates the key using its current value. Returns an error if the key does not exist Bool ignore_lease If ignore_lease is set, etcd updates the key using its current lease. Returns an error if the key does not exist Bool
Sets a key if the key is not already present.
Wrapper over the etcd transaction API.
Queries a range of keys