Merge pull request #1827 from lamielle/doc-whitespaces

doc: uses spaces consistently in sample JSON
This commit is contained in:
Xiang Li 2014-12-02 07:44:03 -08:00
commit f02eae934b

View File

@ -126,10 +126,10 @@ curl -L http://127.0.0.1:4001/v2/keys/message -XPUT -d value="Hello etcd"
"value": "Hello etcd" "value": "Hello etcd"
}, },
"prevNode": { "prevNode": {
"createdIndex": 2, "createdIndex": 2,
"key": "/message", "key": "/message",
"value": "Hello world", "value": "Hello world",
"modifiedIndex": 2 "modifiedIndex": 2
} }
} }
``` ```
@ -153,10 +153,10 @@ curl -L http://127.0.0.1:4001/v2/keys/message -XDELETE
"modifiedIndex": 4 "modifiedIndex": 4
}, },
"prevNode": { "prevNode": {
"key": "/message", "key": "/message",
"value": "Hello etcd", "value": "Hello etcd",
"modifiedIndex": 3, "modifiedIndex": 3,
"createdIndex": 3 "createdIndex": 3
} }
} }
``` ```
@ -405,19 +405,19 @@ curl 'http://127.0.0.1:4001/v2/keys/dir/asdf?consistent=true&wait=true'
```json ```json
{ {
"action": "expire", "action": "expire",
"node": { "node": {
"createdIndex": 8, "createdIndex": 8,
"key": "/dir", "key": "/dir",
"modifiedIndex": 15 "modifiedIndex": 15
}, },
"prevNode": { "prevNode": {
"createdIndex": 8, "createdIndex": 8,
"key": "/dir", "key": "/dir",
"dir":true, "dir":true,
"modifiedIndex": 17, "modifiedIndex": 17,
"expiration": "2013-12-11T10:39:35.689275857-08:00" "expiration": "2013-12-11T10:39:35.689275857-08:00"
} }
} }
``` ```
@ -499,10 +499,10 @@ The response should be:
"value": "two" "value": "two"
}, },
"prevNode": { "prevNode": {
"createdIndex": 8, "createdIndex": 8,
"key": "/foo", "key": "/foo",
"modifiedIndex": 8, "modifiedIndex": 8,
"value": "one" "value": "one"
} }
} }
``` ```
@ -536,10 +536,10 @@ The error code explains the problem:
```json ```json
{ {
"errorCode": 101, "errorCode": 101,
"message": "Compare failed", "message": "Compare failed",
"cause": "[two != one]", "cause": "[two != one]",
"index": 8 "index": 8
} }
``` ```
@ -551,10 +551,10 @@ curl -L http://127.0.0.1:4001/v2/keys/foo?prevIndex=1 -XDELETE
```json ```json
{ {
"errorCode": 101, "errorCode": 101,
"message": "Compare failed", "message": "Compare failed",
"cause": "[1 != 8]", "cause": "[1 != 8]",
"index": 8 "index": 8
} }
``` ```
@ -568,18 +568,18 @@ The successful response will look something like:
```json ```json
{ {
"action": "compareAndDelete", "action": "compareAndDelete",
"node": { "node": {
"key": "/foo", "key": "/foo",
"modifiedIndex": 9, "modifiedIndex": 9,
"createdIndex": 8 "createdIndex": 8
}, },
"prevNode": { "prevNode": {
"key": "/foo", "key": "/foo",
"value": "one", "value": "one",
"modifiedIndex": 8, "modifiedIndex": 8,
"createdIndex": 8 "createdIndex": 8
} }
} }
``` ```
@ -643,22 +643,22 @@ We should see the response as an array of items:
```json ```json
{ {
"action": "get", "action": "get",
    "node": { "node": {
     "key": "/", "key": "/",
       "dir": true, "dir": true,
       "nodes": [ "nodes": [
         { {
             "key": "/foo_dir", "key": "/foo_dir",
             "dir": true, "dir": true,
             "modifiedIndex": 2, "modifiedIndex": 2,
             "createdIndex": 2 "createdIndex": 2
          }, },
          { {
             "key": "/foo", "key": "/foo",
             "value": "two", "value": "two",
             "modifiedIndex": 1, "modifiedIndex": 1,
             "createdIndex": 1 "createdIndex": 1
          } }
] ]
} }
} }
@ -673,33 +673,33 @@ curl -L http://127.0.0.1:4001/v2/keys/?recursive=true
```json ```json
{ {
    "action": "get", "action": "get",
    "node": { "node": {
        "key": "/", "key": "/",
        "dir": true, "dir": true,
        "nodes": [ "nodes": [
            { {
                "key": "/foo_dir", "key": "/foo_dir",
                "dir": true, "dir": true,
                "nodes": [ "nodes": [
                    { {
                        "key": "/foo_dir/foo", "key": "/foo_dir/foo",
                        "value": "bar", "value": "bar",
                        "modifiedIndex": 2, "modifiedIndex": 2,
                        "createdIndex": 2 "createdIndex": 2
                    } }
                ], ],
                "modifiedIndex": 2, "modifiedIndex": 2,
                "createdIndex": 2 "createdIndex": 2
            }, },
            { {
                "key": "/foo", "key": "/foo",
                "value": "two", "value": "two",
                "modifiedIndex": 1, "modifiedIndex": 1,
                "createdIndex": 1 "createdIndex": 1
            } }
        ] ]
    } }
} }
``` ```
@ -723,10 +723,10 @@ curl -L 'http://127.0.0.1:4001/v2/keys/foo_dir?dir=true' -XDELETE
"modifiedIndex": 31 "modifiedIndex": 31
}, },
"prevNode": { "prevNode": {
"createdIndex": 30, "createdIndex": 30,
"key": "/foo_dir", "key": "/foo_dir",
"dir": true, "dir": true,
"modifiedIndex": 30 "modifiedIndex": 30
} }
} }
``` ```
@ -747,10 +747,10 @@ curl -L http://127.0.0.1:4001/v2/keys/dir?recursive=true -XDELETE
"modifiedIndex": 11 "modifiedIndex": 11
}, },
"prevNode": { "prevNode": {
"createdIndex": 10, "createdIndex": 10,
"dir": true, "dir": true,
"key": "/dir", "key": "/dir",
"modifiedIndex": 10 "modifiedIndex": 10
} }
} }
``` ```