initial version complete. Still needed testing and validation
Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/938f3748 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/938f3748 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/938f3748 Branch: refs/heads/CURATOR-88 Commit: 938f3748dae783b4f1762b63a6c3932b40655d13 Parents: 037a467 Author: randgalt <randg...@apache.org> Authored: Sun Feb 23 12:45:25 2014 +0530 Committer: randgalt <randg...@apache.org> Committed: Sun Feb 23 12:45:25 2014 +0530 ---------------------------------------------------------------------- curator-x-rest/src/site/confluence/apis.confluence | 17 ++++++++--------- .../src/site/confluence/client.confluence | 2 +- .../src/site/confluence/entities.confluence | 11 ++++++++++- 3 files changed, 19 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/938f3748/curator-x-rest/src/site/confluence/apis.confluence ---------------------------------------------------------------------- diff --git a/curator-x-rest/src/site/confluence/apis.confluence b/curator-x-rest/src/site/confluence/apis.confluence index abde4ca..920c516 100644 --- a/curator-x-rest/src/site/confluence/apis.confluence +++ b/curator-x-rest/src/site/confluence/apis.confluence @@ -12,8 +12,6 @@ h2. Status APIs h2. Client APIs -NOTE: Not all combinations are valid *TBD* - ||URL||Method||Request Entity||Response Entity||Description|| |/get-children|POST|GetChildrenSpec|Array of strings|This is the equivalent of CuratorFramework.getChildren().| |/create|POST|CreateSpec|PathAndId|This is the equivalent of CuratorFramework.create().| @@ -24,17 +22,22 @@ NOTE: Not all combinations are valid *TBD* h3. How Asynchronous APIs Are Handled -*TBD* +For async versions of the Client APIs, the result is returned via a Status Message. See the [[Managing Status|client.html]] section for details +as well as the [[Status Messages|status.html]] page which details the Asynchronous Client APIs messages. h3. How Watchers Are Handled -*TBD* +If you set "isWatched" to true in a Client API, a status message is generated when the watcher fires. See the [[Managing Status|client.html]] +section for details as well as the [[Status Messages|status.html]] page which details the Watchers message. h3. How Ephemeral Nodes Are Handled -*TBD* +If you create an ephemeral node using the Client APIs, you must periodically send a heartbeat with the ID of the ephemeral node (as +returned by the API). See the [[Client Page|client.html]] for details. IMPORTANT: if you fail to send heartbeats within the configured +session length, the Curator REST Proxy will delete the ephemeral node (sending an expiration status message). h2. Recipe APIs + ||URL||Method||Request Entity||Response Entity||Description|| |/curator/v1/recipes/lock|POST|LockSpec|IdSpec|An InterProcessSemaphoreMutex. On successful return, your client will be holding the specified lock until you delete the lock via the delete API.| |/curator/v1/recipes/lock/{lock-id}|DELETE|n/a|n/a|Release and delete a lock.| @@ -42,10 +45,6 @@ h2. Recipe APIs |/curator/v1/recipes/leader/{leader-id}|DELETE|n/a|n/a|Release/delete leadership.| |/curator/v1/recipes/leader/{leader-id}|GET|n/a|array of ParticipantSpecs|List of participants in the leader election.| -h3. Handling Timeouts, Status and Releasing - -*TBD - releases must go to same server, etc. - h2. Entities See the [[Entity Descriptions Page|entities.html]] for details on the Entities used in the APIs. http://git-wip-us.apache.org/repos/asf/curator/blob/938f3748/curator-x-rest/src/site/confluence/client.confluence ---------------------------------------------------------------------- diff --git a/curator-x-rest/src/site/confluence/client.confluence b/curator-x-rest/src/site/confluence/client.confluence index 9f9054e..94683dd 100644 --- a/curator-x-rest/src/site/confluence/client.confluence +++ b/curator-x-rest/src/site/confluence/client.confluence @@ -41,7 +41,7 @@ Here is pseudo-code for doing a distributed lock using the Curator REST Proxy: {code} Address address = ... # host and port of the Curator REST Proxy instance -LockSpec lock = {path: "/lock/path", maxWaitMs=5000} +LockSpec lock = {path: "/lock/path", maxWaitMs: 5000} IdSpec lockId = restClient.post(address, "/curator/v1/recipes/lock", lock) statusMaintainer.add(address, lockId) ... do work here while in the acquired mutex ... http://git-wip-us.apache.org/repos/asf/curator/blob/938f3748/curator-x-rest/src/site/confluence/entities.confluence ---------------------------------------------------------------------- diff --git a/curator-x-rest/src/site/confluence/entities.confluence b/curator-x-rest/src/site/confluence/entities.confluence index 910cea8..d1ce778 100644 --- a/curator-x-rest/src/site/confluence/entities.confluence +++ b/curator-x-rest/src/site/confluence/entities.confluence @@ -10,7 +10,7 @@ Here are the entity descriptions for the entities used in the APIs: |messages|array of StatusMessages|Any pending messages from this instance.| | | | | |*StatusMessage*| | | -|type|string|The status message type. See the Managing Status section for details.| +|type|string|The status message type. See the [[Managing Status|client.html]] section for details.| |message|string|Type-dependent message| |details|string|Type-dependent details| |sourceId|string|Type-dependent sourceId| @@ -27,6 +27,11 @@ Here are the entity descriptions for the entities used in the APIs: |path|string|The ZK path| |data|string|The data to store in the node| |mode|string|The create mode. One of: "persistent", "persistent\_sequential", "ephemeral", or "ephemeral\_sequential"| +|async|boolean|If true, perform asynchronously| +|asyncId|string|for async, a user-defined ID to return in the status message| +|compressed|boolean|if true, compress the data using Curator's compression mechanism| +|creatingParentsIfNeeded|boolean|if true, parent paths are created if needed| +|withProtection|boolean|if true, the Curator protection mechanism is used| | | | | | *PathAndId* | | | |path|string|The created ZK Path (possibly with a sequence suffix)| @@ -82,3 +87,7 @@ Here are the entity descriptions for the entities used in the APIs: | *ParticipantSpec* | | | |participantId|string|The participant ID| |isLeader|boolean|true if this is the leader| + +*NOTE* - for the entities above used in the Recipe APIs, not all combinations of values are valid. For example, +in the CreateSpec, withProtection and creatingParentsIfNeeded cannot be used together. The rule is only combinations +that Curator itself supports can be used. \ No newline at end of file