Package

com.eiipii.etcd.client

model

Permalink

package model

Model

Contains case classes for dealing with etcd HTTP responses and building correct HTTP requests to etcd. Most of the case classes are self-explanatory, once the Responses and Errors section below is read. Those that are not are discussed in more detail in this documentation. They are mostly used by handlers or by the client to extract information from JSON objects or write information to JSON objects sent in requests.

Also, package model contains an object for properly building instances of EtcdKey, EtcdDirectory, hidden nodes and EtcdValue.

Finally, it contains JSON4S custom serializers for JSON parsing support. All the custom serializers contained in this package are contained in the EtcdJsonFormat object, which in turn is used by handlers in package handlers to parse responses from etcd to HTTP requests.

Responses and Errors

All requests can return either a response or an error. In order to deal with this two possible situations, the outcome of each request is represented by a Result sealed trait in this package. These traits are extended by case classes representing an error or a response in the manner described bellow. The naming convention for Result sealed traits is the following: Etcd<NameOfTheEtcdClientMethod>Result. For example EtcdGetKeyResult.

There are two types of error that etcd could return. For EtcdClient, they are represented in the EtcdStandardError and EtcdRequestError. One of these case classes extends each Result sealed trait representing the outcome of a request sent by the client.

On the other hand, Responses are dealt with using Response case classes. They contain all the necessary fields used to deserialize the information contained in the HTTP response received from etcd. Response case classes also extend Result sealed traits. The naming convention is similar: Etcd<NameOfTheEtcdClientMethod>Response. For example EtcdGetKeyResponse.

Both Response and Error case classes contain the relevant information about etcd that can be found in headers and in the response body.

A more involved case, which is delt with a callback, is EtcdWaitForKeyResult.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. model
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait CompareAndSwapCondition extends AnyRef

    Permalink

    Used for conditionally updating a key with the EtcdClient.setKey method.

    Used for conditionally updating a key with the EtcdClient.setKey method.

    Its subclasses pose a condition which has to be met in order to perform an update to a key in etcd.

  2. sealed trait ConditionalDeleteCondition extends AnyRef

    Permalink

    Used for conditionally deleting a key with the EtcdClient.deleteKey method.

    Used for conditionally deleting a key with the EtcdClient.deleteKey method.

    Its subclasses pose a condition which has to be met in order to perform a delete operation of a key in etcd.

  3. case class EtcdAddMemberResponse(xEtcdClusterId: EtcdClusterId, body: EtcdMember) extends EtcdAddMemberResult with Product with Serializable

    Permalink
  4. sealed trait EtcdAddMemberResult extends AnyRef

    Permalink

    AddMember

  5. case class EtcdAddUpdateRoleResponse(xEtcdClusterId: EtcdClusterId, body: EtcdRole) extends EtcdAddUpdateRoleResult with Product with Serializable

    Permalink
  6. sealed trait EtcdAddUpdateRoleResult extends AnyRef

    Permalink

    CreateUpdateRole

  7. case class EtcdAddUpdateUserResponse(xEtcdClusterId: EtcdClusterId, body: EtcdAddUpdateUserResponseBody) extends EtcdAddUpdateUserResult with Product with Serializable

    Permalink
  8. case class EtcdAddUpdateUserResponseBody(user: String, password: Option[String], roles: List[String]) extends Product with Serializable

    Permalink
  9. sealed trait EtcdAddUpdateUserResult extends AnyRef

    Permalink

    Add or Update User

  10. final case class EtcdClusterId(id: String) extends AnyVal with Product with Serializable

    Permalink
  11. case class EtcdConfirmationResponse(xEtcdClusterId: EtcdClusterId) extends EtcdConfirmationResult with Product with Serializable

    Permalink

    Empty response to confirm that operation was successful.

    Empty response to confirm that operation was successful.

    xEtcdClusterId

    cluster id on headers

  12. sealed trait EtcdConfirmationResult extends AnyRef

    Permalink

    Default response for operations which return only X-Etcd Cluster ID.

  13. case class EtcdCounts(fail: Int, success: Int) extends Product with Serializable

    Permalink
  14. case class EtcdCreateDirBody(action: String, node: EtcdCreateDirNode, prevNode: Option[EtcdCreateDirNode]) extends Product with Serializable

    Permalink
  15. case class EtcdCreateDirNode(createdIndex: EtcdIndex, dir: Boolean, expiration: Option[String], key: EtcdKey, modifiedIndex: Option[EtcdIndex], ttl: Option[EtcdTTL]) extends Product with Serializable

    Permalink
  16. case class EtcdCreateDirResponse(headers: EtcdHeaders, body: EtcdCreateDirBody) extends EtcdCreateDirResult with Product with Serializable

    Permalink
  17. sealed trait EtcdCreateDirResult extends AnyRef

    Permalink

    Create directory operation result.

  18. case class EtcdDeleteKeyBody(action: String, node: EtcdNodeEmpty, prevNode: EtcdNodeValue) extends Product with Serializable

    Permalink
  19. case class EtcdDeleteKeyResponse(headers: EtcdHeaders, body: EtcdDeleteKeyBody) extends EtcdDeleteKeyResult with Product with Serializable

    Permalink
  20. sealed trait EtcdDeleteKeyResult extends AnyRef

    Permalink

    Delete operation result.

  21. final case class EtcdDirectory(dir: String) extends AnyVal with Product with Serializable

    Permalink

    A directory is a full path with a trailing '/'.

    A directory is a full path with a trailing '/'.

    dir

    the string representation of the directory.

  22. case class EtcdEnableAuthentication(enabled: Option[Boolean]) extends Product with Serializable

    Permalink
  23. case class EtcdError(cause: String, errorCode: Int, index: Int, message: String) extends EtcdErrorMessage with Product with Serializable

    Permalink
  24. sealed trait EtcdErrorMessage extends AnyRef

    Permalink
  25. case class EtcdGetAuthenticationStatusResponse(xEtcdClusterId: EtcdClusterId, body: EtcdEnableAuthentication) extends EtcdGetAuthenticationStatusResult with Product with Serializable

    Permalink
  26. sealed trait EtcdGetAuthenticationStatusResult extends AnyRef

    Permalink

    Get Authentication Status

  27. case class EtcdGetHealthResponse(health: String) extends EtcdGetHealthResult with Product with Serializable

    Permalink
  28. sealed trait EtcdGetHealthResult extends AnyRef

    Permalink
  29. case class EtcdGetKeyBody(action: String, node: EtcdNodeValue) extends Product with Serializable

    Permalink
  30. case class EtcdGetKeyResponse(headers: EtcdHeaders, body: EtcdGetKeyBody) extends EtcdGetKeyResult with Product with Serializable

    Permalink
  31. sealed trait EtcdGetKeyResult extends AnyRef

    Permalink
  32. case class EtcdGetLeaderStatsResponse(leader: String, followers: List[EtcdMemberStats]) extends EtcdGetLeaderStatsResult with Product with Serializable

    Permalink
  33. sealed trait EtcdGetLeaderStatsResult extends AnyRef

    Permalink

    Leader Statistics Result.

  34. case class EtcdGetMembersBody(members: List[EtcdMember]) extends Product with Serializable

    Permalink
  35. case class EtcdGetMembersResponse(xEtcdClusterId: EtcdClusterId, body: EtcdGetMembersBody) extends EtcdGetMembersResult with Product with Serializable

    Permalink
  36. sealed trait EtcdGetMembersResult extends AnyRef

    Permalink

    GetMembers

  37. case class EtcdGetRoleDetailsResponse(xEtcdClusterId: EtcdClusterId, body: EtcdRole) extends EtcdGetRoleDetailsResult with Product with Serializable

    Permalink
  38. sealed trait EtcdGetRoleDetailsResult extends AnyRef

    Permalink

    GetRoleDetails

  39. case class EtcdGetRolesBody(roles: List[EtcdRole]) extends Product with Serializable

    Permalink
  40. case class EtcdGetRolesResponse(xEtcdClusterId: EtcdClusterId, roles: EtcdGetRolesBody) extends EtcdGetRolesResult with Product with Serializable

    Permalink
  41. sealed trait EtcdGetRolesResult extends AnyRef

    Permalink

    GetRoles

  42. case class EtcdGetSelfStatsResponse(id: String, leaderInfo: EtcdLeaderInfo, name: String, recvAppendRequestCnt: Int, recvBandwidthRate: Option[Double], recvPkgRate: Option[Double], sendAppendRequestCnt: Int, startTime: String, state: String) extends EtcdGetSelfStatsResult with Product with Serializable

    Permalink
  43. sealed trait EtcdGetSelfStatsResult extends AnyRef

    Permalink

    Self Statistics Result.

  44. case class EtcdGetStoreStatsResponse(compareAndSwapFail: Int, compareAndSwapSuccess: Int, createFail: Int, createSuccess: Int, deleteFail: Int, deleteSuccess: Int, expireCount: Int, getsFail: Int, getsSuccess: Int, setsFail: Int, setsSuccess: Int, updateFail: Int, updateSuccess: Int, watchers: Int) extends EtcdGetStoreStatsResult with Product with Serializable

    Permalink
  45. sealed trait EtcdGetStoreStatsResult extends AnyRef

    Permalink

    Self Statistics Result.

  46. case class EtcdGetUserDetailsResponse(xEtcdClusterId: EtcdClusterId, body: EtcdUser) extends EtcdGetUserDetailsResult with Product with Serializable

    Permalink
  47. sealed trait EtcdGetUserDetailsResult extends AnyRef

    Permalink

    GetUserDetails

  48. case class EtcdGetUsersBody(users: List[EtcdUser]) extends Product with Serializable

    Permalink
  49. case class EtcdGetUsersResponse(xEtcdClusterId: EtcdClusterId, users: EtcdGetUsersBody) extends EtcdGetUsersResult with Product with Serializable

    Permalink
  50. sealed trait EtcdGetUsersResult extends AnyRef

    Permalink

    GetUsers

  51. case class EtcdGetVersionResponse(etcdserver: String, etcdcluster: String) extends EtcdGetVersionResult with Product with Serializable

    Permalink
  52. sealed trait EtcdGetVersionResult extends AnyRef

    Permalink

    Version Request Result.

  53. case class EtcdHeaders(xEtcdClusterId: EtcdClusterId, xEtcdIndex: EtcdIndex, xRaftIndex: RaftIndex, xRaftTerm: RaftTerm) extends Product with Serializable

    Permalink

    Etcd information returned in headers of responses to requests performed by key-value methods.

  54. final case class EtcdIndex(index: Int) extends AnyVal with Product with Serializable

    Permalink

    Index associated to the last operation performed in etcd.

    Index associated to the last operation performed in etcd.

    See Response Headers.

  55. case class EtcdKV(read: List[String], write: List[String]) extends Product with Serializable

    Permalink

    Data specifying the read and write access to the key-value and authentication spaces.

    Data specifying the read and write access to the key-value and authentication spaces.

    read

    List of strings specifying read access to a certain domain of the key-value and authentication spaces.

    write

    List of strings specifying write access to a certain domain of the key-value and authentication spaces.

  56. final case class EtcdKey(key: String) extends AnyVal with Product with Serializable

    Permalink

    A key name is a full path name.

    A key name is a full path name.

    key

    the string representation of the key.

  57. case class EtcdLatency(average: Double, current: Double, maximum: Double, minimum: Double, standardDeviation: Double) extends Product with Serializable

    Permalink
  58. case class EtcdLeaderInfo(leader: String, startTime: String, uptime: String) extends Product with Serializable

    Permalink
  59. case class EtcdListDirBody(action: String, node: EtcdListDirectory) extends Product with Serializable

    Permalink
  60. sealed trait EtcdListDirNode extends AnyRef

    Permalink
  61. case class EtcdListDirResponse(headers: EtcdHeaders, body: EtcdListDirBody) extends EtcdListDirResult with Product with Serializable

    Permalink
  62. sealed trait EtcdListDirResult extends AnyRef

    Permalink

    List directory operation result.

  63. case class EtcdListDirectory(dir: Boolean = true, key: EtcdKey, nodes: List[EtcdListDirNode], modifiedIndex: EtcdIndex, createdIndex: EtcdIndex) extends EtcdListDirNode with Product with Serializable

    Permalink
  64. case class EtcdListValue(dir: Boolean = false, key: EtcdKey, value: EtcdValue, modifiedIndex: EtcdIndex, createdIndex: EtcdIndex) extends EtcdListDirNode with Product with Serializable

    Permalink
  65. case class EtcdMember(id: String, name: String, peerURLs: List[String], clientURLs: List[String]) extends Product with Serializable

    Permalink

    Case class representing the information that a member of a cluster may have of another member.

    Case class representing the information that a member of a cluster may have of another member.

    id

    String identifying a member of an etcd cluster.

    name

    String identifying a member of an etcd cluster by name.

    peerURLs

    List of URLs (represented as strings) used for communication between peers in an etcd cluster.

    clientURLs

    List of URLs (represented as strings) used for communication with clients.

  66. case class EtcdMemberForm(peerURLs: List[String]) extends Product with Serializable

    Permalink

    Form used to update the peer URLs of a member of a cluster.

    Form used to update the peer URLs of a member of a cluster.

    peerURLs

    List of strings representing the peer URLs.

  67. case class EtcdMemberStats(memberId: String, counts: EtcdCounts, latency: EtcdLatency) extends Product with Serializable

    Permalink
  68. case class EtcdNodeEmpty(key: EtcdKey, modifiedIndex: EtcdIndex, createdIndex: EtcdIndex, ttl: Option[EtcdTTL]) extends Product with Serializable

    Permalink
  69. case class EtcdNodeValue(key: EtcdKey, value: EtcdValue, modifiedIndex: EtcdIndex, createdIndex: EtcdIndex, ttl: Option[EtcdTTL], expiration: Option[String]) extends Product with Serializable

    Permalink
  70. case class EtcdPermission(kv: EtcdKV) extends Product with Serializable

    Permalink

    Data specifying the read and write access to the key-value and authentication spaces.

    Data specifying the read and write access to the key-value and authentication spaces.

    kv

    Instance of EtcdKV

  71. case class EtcdRequestError(statusCode: EtcdResponseCode, headers: Option[EtcdHeaders], body: EtcdErrorMessage) extends EtcdListDirResult with EtcdSetKeyResult with EtcdGetKeyResult with EtcdWaitForKeyResult with EtcdCreateDirResult with EtcdDeleteKeyResult with Product with Serializable

    Permalink

    Type of error returned by most operations on etcd done on the key space.

    Type of error returned by most operations on etcd done on the key space.

    statusCode

    HTTP response code returned in the response's headers.

    headers

    Headers of the HTTP response returned by etcd.

    body

    Body of the HTTP error response containing information on the cause of the error.

  72. final case class EtcdResponseCode(code: Int) extends AnyVal with Product with Serializable

    Permalink

    HTTP response code to a request.

  73. case class EtcdRole(role: String, permissions: Option[EtcdPermission] = None, grant: Option[EtcdPermission] = None, revoke: Option[EtcdPermission] = None) extends Product with Serializable

    Permalink

    Data specifying what write and read privileges are granted or revoked to the users in possession of it.

    Data specifying what write and read privileges are granted or revoked to the users in possession of it.

    role

    String representing the name of the role.

    permissions

    List of permissions that the possession of the role grants.

    grant

    Used for granting a permission when a role is updated.

    revoke

    Used for revoking a permission when a role is updated.

  74. case class EtcdSetKeyBody(action: String, node: EtcdNodeValue, prevNode: Option[EtcdNodeValue]) extends Product with Serializable

    Permalink
  75. case class EtcdSetKeyResponse(headers: EtcdHeaders, body: EtcdSetKeyBody) extends EtcdSetKeyResult with Product with Serializable

    Permalink
  76. sealed trait EtcdSetKeyResult extends AnyRef

    Permalink

    Key-Value methods Put operation result.

  77. case class EtcdSimpleError(message: String) extends EtcdErrorMessage with Product with Serializable

    Permalink
  78. case class EtcdStandardError(statusCode: EtcdResponseCode, xEtcdClusterId: Option[EtcdClusterId], error: EtcdErrorMessage) extends EtcdAddMemberResult with EtcdGetMembersResult with EtcdGetRoleDetailsResult with EtcdGetRolesResult with EtcdGetUserDetailsResult with EtcdGetUsersResult with EtcdGetAuthenticationStatusResult with EtcdAddUpdateUserResult with EtcdGetVersionResult with EtcdGetLeaderStatsResult with EtcdConfirmationResult with EtcdGetStoreStatsResult with EtcdGetSelfStatsResult with EtcdGetHealthResult with EtcdAddUpdateRoleResult with Product with Serializable

    Permalink

    Type of error returned by most operations on etcd that are not done on the key space.

    Type of error returned by most operations on etcd that are not done on the key space.

    statusCode

    HTTP response code returned in the response's headers.

    xEtcdClusterId

    Etcd cluster id information

    error

    Message with information on the cause of the error.

  79. final case class EtcdTTL(ttl: Int) extends AnyVal with Product with Serializable

    Permalink

    Life span in seconds of a key or directory.

    Life span in seconds of a key or directory.

    ttl

    Integer representing the time to live in seconds.

  80. case class EtcdUser(user: String, password: Option[String], roles: List[EtcdRole] = List()) extends Product with Serializable

    Permalink

    Data representing a user in etcd.

    Data representing a user in etcd.

    user

    String representing the name of the user.

    password

    String representing the password of the user.

    roles

    List of instances of EtcdRole, which specify the permissions the user has.

  81. case class EtcdUserAuthenticationData(userLogin: String, password: String) extends Product with Serializable

    Permalink

    Data used to get authorization when authentication is enabled.

    Data used to get authorization when authentication is enabled.

    userLogin

    String representing a login.

    password

    String representing a password.

  82. case class EtcdUserRequestForm(user: String, password: Option[String] = None, roles: List[String] = List(), grant: List[String] = List(), revoke: List[String] = List()) extends Product with Serializable

    Permalink

    Form that needs to be filled to use as input for EtcdClient.addUpdateUser and EtcdClient.deleteUser methods.

    Form that needs to be filled to use as input for EtcdClient.addUpdateUser and EtcdClient.deleteUser methods.

    user

    String identifying a user.

    password

    Password that the user will use for authentication.

    roles

    List of roles that a user has when it gets created.

    grant

    List of roles to be granted when performing an update.

    revoke

    List of roles to be revoked when performing an update.

  83. final case class EtcdValue(value: String) extends AnyVal with Product with Serializable

    Permalink

    A value is any data being stored under a key.

    A value is any data being stored under a key.

    value

    the string representation of the value.

  84. trait EtcdWaitCallback extends AnyRef

    Permalink

    Callback for a wait operation used by EtcdWaitAcceptedAsyncHandler to asynchonously handle etcd responses to a wait operation.

  85. case class EtcdWaitForKeyAccepted(headers: EtcdHeaders) extends EtcdWaitForKeyResult with Product with Serializable

    Permalink

    Response returned once the wait is accepted.

    Response returned once the wait is accepted.

    In the case there has not been any change in etcd since the watch has ben set, etcd returns a HTTP response with an empty body, but with headers confirming the wait has been set. See Waiting for a change.

    headers

    Headers returned as response to a request of an operation on the key space.

  86. sealed trait EtcdWaitForKeyResult extends AnyRef

    Permalink

    Result of a wait operation.

    Result of a wait operation.

    For implementation details, see EtcdWaitForKeyAccepted, FutureBasedEtcdWaitCallback and EtcdWaitCallback.

  87. class FutureBasedEtcdWaitCallback extends EtcdWaitCallback

    Permalink

    Callback for a wait operation.

    Callback for a wait operation.

    Extends EtcdWaitCallback. It should be used as input for EtcdClient.waitForKey.

    It contains methods for retrieving an EtcdGetKeyResponse received once a change to etcd is registered.

  88. case class IncorrectEtcdRequestFormatException(handler: String, responseCode: Option[Int], responseBody: Option[String], headers: Option[EtcdHeaders]) extends Exception with Product with Serializable

    Permalink

    If HTTP request information do not match the etcd format, then a IncorrectEtcdRequestFormatException is created

  89. case class IncorrectSimpleEtcdRequestFormatException(handler: String, responseCode: Option[Int], responseBody: Option[String], clustedIdHeader: Option[EtcdClusterId]) extends Exception with Product with Serializable

    Permalink

    A simple version of IncorrectEtcdRequestFormatException when only ClusterId is provided on headers.

  90. case class KeyMustExist(state: Boolean) extends CompareAndSwapCondition with Product with Serializable

    Permalink

    Used for conditionally updating a key using the EtcdClient.setKey method.

    Used for conditionally updating a key using the EtcdClient.setKey method.

    state

    Requires that the key to already exist, when set to true. When set to false, requires that key do not exist.

  91. case class KeyMustHaveIndex(index: EtcdIndex) extends CompareAndSwapCondition with ConditionalDeleteCondition with Product with Serializable

    Permalink

    Used for conditionally updating or deleting a key using the EtcdClient.setKey or EtcdClient.deleteKey methods.

    Used for conditionally updating or deleting a key using the EtcdClient.setKey or EtcdClient.deleteKey methods.

    index

    Requires for the key to have this modified index associated to its last operation.

  92. case class KeyMustHaveValue(value: EtcdValue) extends CompareAndSwapCondition with ConditionalDeleteCondition with Product with Serializable

    Permalink

    Used for conditionally updating or deleting a key using the EtcdClient.setKey or EtcdClient.deleteKey methods.

    Used for conditionally updating or deleting a key using the EtcdClient.setKey or EtcdClient.deleteKey methods.

    value

    Requires for the key to have this value at the time of the request.

  93. final case class RaftIndex(rIndex: Int) extends AnyVal with Product with Serializable

    Permalink

    See Response Headers.

  94. final case class RaftTerm(term: Int) extends AnyVal with Product with Serializable

    Permalink

    An integer that will increase whenever an etcd master election happens in the cluster.

    An integer that will increase whenever an etcd master election happens in the cluster.

    See Response Headers.

Value Members

  1. object EtcdClusterIdSerializer extends CustomSerializer[EtcdClusterId] with Product with Serializable

    Permalink
  2. object EtcdErrorMessageSerializer extends CustomSerializer[EtcdErrorMessage] with Product with Serializable

    Permalink
  3. object EtcdIndexSerializer extends CustomSerializer[EtcdIndex] with Product with Serializable

    Permalink
  4. object EtcdJsonFormat

    Permalink

    Object extending JSON4S DefaultFormats with custom Serializer]]s.

    Object extending JSON4S DefaultFormats with custom Serializer]]s.

    All of them are defined in the model package. They are the following:

  5. object EtcdKeySerializer extends CustomSerializer[EtcdKey] with Product with Serializable

    Permalink
  6. object EtcdListDirNodeSerializer extends CustomSerializer[EtcdListDirNode] with Product with Serializable

    Permalink
  7. object EtcdMemberStatsSerialized extends CustomSerializer[EtcdGetLeaderStatsResponse] with Product with Serializable

    Permalink
  8. object EtcdModel

    Permalink

    Contains methods to define well-formed instances of EtcdKey, EtcdDirectory, hidden nodes and EtcdValue.

  9. object EtcdTTLSerializer extends CustomSerializer[EtcdTTL] with Product with Serializable

    Permalink
  10. object EtcdValueSerializer extends CustomSerializer[EtcdValue] with Product with Serializable

    Permalink
  11. object RaftIndexSerializer extends CustomSerializer[RaftIndex] with Product with Serializable

    Permalink
  12. object RaftTermSerializer extends CustomSerializer[RaftTerm] with Product with Serializable

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped