class Consul extends AnyRef
Encapsulates functions towards Consul.
- Alphabetic
- By Inheritance
- Consul
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Consul(httpSender: HttpSender)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
createSession(session: Session): Try[SessionID]
Attempts to create a session in Consul.
Attempts to create a session in Consul.
- session
Data to store on the session
- returns
The created session id
-
def
deleteKeyValue(kv: DeleteKeyValue): Try[Boolean]
Deletes the provided key This function is idempotent, i.e.
Deletes the provided key This function is idempotent, i.e. it will not fail even if the key does not exist
- kv
The key to remove
- returns
Success if managed to access Consul, then normally 'true'
-
def
deleteKeyValue(key: String): Try[Boolean]
Deletes the provided key This function is idempotent, i.e.
Deletes the provided key This function is idempotent, i.e. it will not fail even if the key does not exist
- key
The key to remove
- returns
Success if managed to access Consul, then normally 'true'
-
def
deleteKeyValueRecursive(key: String): Try[Boolean]
Recursively deletes the provided key and all its descendants/children.
Recursively deletes the provided key and all its descendants/children. This function is idempotent, i.e. it will not fail even if the key does not exist
- key
The key to remove
- returns
Success if managed to access Consul, then normally 'true'
-
def
destroySession(sessionID: SessionID): Try[Unit]
Attempts to destroy a session in Consul.
Attempts to destroy a session in Consul. This function is idempotent, i.e. it will not fail even if the session does not exist
- sessionID
The session to destroy
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
readKeyValue(key: String): Try[Option[KeyValue]]
Attempts to read the value for the provided key.
Attempts to read the value for the provided key.
- key
The full path of the key, e.g foo/bar/my-config
- returns
Success if managed to access Consul, then Some if the value was found, None else
-
def
readKeyValueRecursive(key: String): Try[Option[Stream[KeyValue]]]
Attempts to recursively read the key/values for the provided key path
Attempts to recursively read the key/values for the provided key path
- key
The path to query
- returns
Success if managed to access Consul, then Some if the key was found followed by the stream of key/values matching the query
-
def
readKeyValueWhenChanged(key: String, modifyIndex: Int, maxWait: FiniteDuration): Try[Option[KeyValue]]
Blocks and waits for provided key to changed value.
Blocks and waits for provided key to changed value. This is done by waiting until the ModifyIndex on the key has gone passed the provided modifyIndex. If the provided index is lower than what is represented in Consul this function returns immediately. The function always returns the value of the key even if the provided wait time has been exceeded.
- key
The full path of the key, e.g foo/bar/my-config
- modifyIndex
The modification index value to block on
- maxWait
Max wait time
- returns
Success if managed to access Consul, then Some if the value was found, None else
-
def
readKeyValues(kv: GetKeyValue): Try[Option[Stream[KeyValue]]]
Attempts to read the key/value(s) as specified by the provided data.
Attempts to read the key/value(s) as specified by the provided data. The result is a stream since if recursive is requested then there could be more than one key returned
- kv
The key to query
- returns
Success if managed to access Consul, then Some if the key was found followed by the stream of key/values matching the query
-
def
renewSession(sessionID: SessionID): Try[Session]
Attempts to renew a session in Consul.
Attempts to renew a session in Consul.
- sessionID
The session to renew
- returns
The session data
-
def
storeKeyValue(kv: SetKeyValue): Try[Boolean]
Attempts to store a value on the provided key.
Attempts to store a value on the provided key. The exact behavior of the storage operation is determined by the values set on the provided SetKeyValue
- kv
The key value data
- returns
Success if managed to access Consul, then true id the key/value was set
-
def
storeKeyValue(key: String, value: Option[String]): Try[Boolean]
Attempts to store a value on the provided key.
Attempts to store a value on the provided key. This function will always write to the key irrespective if there is an owning session.
- key
The full path of the key, e.g foo/bar/my-config
- value
The optional value to store on the key
- returns
Success if managed to access Consul, then true id the key/value was set
-
def
storeKeyValueIfNotSet(key: String, value: Option[String]): Try[Boolean]
Attempts to store a value on the provided key only if the key did not previously exist.
Attempts to store a value on the provided key only if the key did not previously exist.
- key
The full path of the key, e.g foo/bar/my-config
- value
The optional value to store on the key
- returns
Success if managed to access Consul, then true id the key/value was set
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )