Skip to content

Commit 962c547

Browse files
pjaclarkJMercerGit
andauthored
Fixes missing curl examples (#243) (#245)
* Fixes missing curl examples (#243) Fixes missing curl examples * missing curl example (#246) * Fixes missing curl examples Fixes missing curl examples * 2.9.0p5 curl examples 2.9.0p5 curl examples that vanished into space * 3.0.8 curl fix (#247) * Fixes missing curl examples Fixes missing curl examples * 2.9.0p5 curl examples 2.9.0p5 curl examples that vanished into space * 3.0.8 curl example 3.0.8 curl example --------- Co-authored-by: James M <[email protected]>
1 parent 855b644 commit 962c547

File tree

24 files changed

+975
-0
lines changed

24 files changed

+975
-0
lines changed

content/riak/kv/2.9.0p5/developing/usage/updating-objects.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
221221
222222
# When performing a write to the same key, that same header needs to
223223
# accompany the write for Riak to be able to use the context object
224+
225+
curl -XPUT \
226+
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
227+
-d "Harlem Globetrotters" \
228+
http://localhost:8098/types/sports/buckets/nba/keys/champion
224229
```
225230

226231
In the samples above, we didn't need to actually interact with the
@@ -299,6 +304,15 @@ fmt.Println(rsp.VClock)
299304
// Output:
300305
// X3hNXFq3ythUqvvrG9eJEGbUyLS
301306
```
307+
```curl
308+
# When using curl, the context object is attached to the X-Riak-Vclock header
309+
310+
curl -i http://localhost:8098/types/sports/buckets/nba/keys/champion
311+
312+
# In the resulting output, the header will look something like this:
313+
314+
X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
315+
```
302316

303317
## The Object Update Cycle
304318

@@ -473,6 +487,13 @@ if err := cluster.Execute(cmd); err != nil {
473487
fmt.Println("Stored Pete Carroll")
474488
```
475489

490+
```curl
491+
curl -XPUT \
492+
-H "Content-Type: text/plain" \
493+
-d "Pete Carroll" \
494+
http://localhost:8098/types/siblings/buckets/coaches/keys/seahawks
495+
```
496+
476497
Every once in a while, though, head coaches change in the NFL, which
477498
means that our data would need to be updated. Below is an example
478499
function for updating such objects:
@@ -619,6 +640,27 @@ func updateCoach(cluster *riak.Cluster, team, newCoach string) error {
619640
}
620641
```
621642

643+
644+
```curl
645+
646+
# When using curl, the context object is attached to the X-Riak-Vclock header
647+
648+
curl -i http://localhost:8098/types/siblings/buckets/coaches/keys/packers
649+
650+
# In the resulting output, the header will look something like this:
651+
652+
X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
653+
654+
# When performing a write to the same key, that same header needs to
655+
# accompany the write for Riak to be able to use the context object
656+
657+
curl -XPUT \
658+
-H "Content-Type: text/plain" \
659+
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
660+
-d "Vince Lombardi" \
661+
http://localhost:8098/types/siblings/buckets/coaches/keys/packers
662+
```
663+
622664
In the example above, you can see the three steps in action: first, the
623665
object is read, which automatically fetches the object's causal context;
624666
then the object is modified, i.e. the object's value is set to the name

content/riak/kv/2.9.1/developing/usage/updating-objects.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
214214
215215
# When performing a write to the same key, that same header needs to
216216
# accompany the write for Riak to be able to use the context object
217+
218+
curl -XPUT \
219+
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
220+
-d "Harlem Globetrotters" \
221+
http://localhost:8098/types/sports/buckets/nba/keys/champion
217222
```
218223

219224
In the samples above, we didn't need to actually interact with the
@@ -292,6 +297,12 @@ fmt.Println(rsp.VClock)
292297
// Output:
293298
// X3hNXFq3ythUqvvrG9eJEGbUyLS
294299
```
300+
```curl
301+
# When using curl, the context object is attached to the X-Riak-Vclock header
302+
curl -i http://localhost:8098/types/sports/buckets/nba/keys/champion
303+
# In the resulting output, the header will look something like this:
304+
X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
305+
```
295306

296307
## The Object Update Cycle
297308

@@ -466,6 +477,13 @@ if err := cluster.Execute(cmd); err != nil {
466477
fmt.Println("Stored Pete Carroll")
467478
```
468479

480+
```curl
481+
curl -XPUT \
482+
-H "Content-Type: text/plain" \
483+
-d "Pete Carroll" \
484+
http://localhost:8098/types/siblings/buckets/coaches/keys/seahawks
485+
```
486+
469487
Every once in a while, though, head coaches change in the NFL, which
470488
means that our data would need to be updated. Below is an example
471489
function for updating such objects:
@@ -612,6 +630,26 @@ func updateCoach(cluster *riak.Cluster, team, newCoach string) error {
612630
}
613631
```
614632

633+
```curl
634+
635+
# When using curl, the context object is attached to the X-Riak-Vclock header
636+
637+
curl -i http://localhost:8098/types/siblings/buckets/coaches/keys/packers
638+
639+
# In the resulting output, the header will look something like this:
640+
641+
X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
642+
643+
# When performing a write to the same key, that same header needs to
644+
# accompany the write for Riak to be able to use the context object
645+
646+
curl -XPUT \
647+
-H "Content-Type: text/plain" \
648+
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
649+
-d "Vince Lombardi" \
650+
http://localhost:8098/types/siblings/buckets/coaches/keys/packers
651+
```
652+
615653
In the example above, you can see the three steps in action: first, the
616654
object is read, which automatically fetches the object's causal context;
617655
then the object is modified, i.e. the object's value is set to the name

content/riak/kv/2.9.10/developing/usage/updating-objects.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
214214
215215
# When performing a write to the same key, that same header needs to
216216
# accompany the write for Riak to be able to use the context object
217+
218+
curl -XPUT \
219+
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
220+
-d "Harlem Globetrotters" \
221+
http://localhost:8098/types/sports/buckets/nba/keys/champion
217222
```
218223

219224
In the samples above, we didn't need to actually interact with the
@@ -292,6 +297,12 @@ fmt.Println(rsp.VClock)
292297
// Output:
293298
// X3hNXFq3ythUqvvrG9eJEGbUyLS
294299
```
300+
```curl
301+
# When using curl, the context object is attached to the X-Riak-Vclock header
302+
curl -i http://localhost:8098/types/sports/buckets/nba/keys/champion
303+
# In the resulting output, the header will look something like this:
304+
X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
305+
```
295306

296307
## The Object Update Cycle
297308

@@ -466,6 +477,13 @@ if err := cluster.Execute(cmd); err != nil {
466477
fmt.Println("Stored Pete Carroll")
467478
```
468479

480+
```curl
481+
curl -XPUT \
482+
-H "Content-Type: text/plain" \
483+
-d "Pete Carroll" \
484+
http://localhost:8098/types/siblings/buckets/coaches/keys/seahawks
485+
```
486+
469487
Every once in a while, though, head coaches change in the NFL, which
470488
means that our data would need to be updated. Below is an example
471489
function for updating such objects:
@@ -612,6 +630,27 @@ func updateCoach(cluster *riak.Cluster, team, newCoach string) error {
612630
}
613631
```
614632

633+
634+
```curl
635+
636+
# When using curl, the context object is attached to the X-Riak-Vclock header
637+
638+
curl -i http://localhost:8098/types/siblings/buckets/coaches/keys/packers
639+
640+
# In the resulting output, the header will look something like this:
641+
642+
X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
643+
644+
# When performing a write to the same key, that same header needs to
645+
# accompany the write for Riak to be able to use the context object
646+
647+
curl -XPUT \
648+
-H "Content-Type: text/plain" \
649+
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
650+
-d "Vince Lombardi" \
651+
http://localhost:8098/types/siblings/buckets/coaches/keys/packers
652+
```
653+
615654
In the example above, you can see the three steps in action: first, the
616655
object is read, which automatically fetches the object's causal context;
617656
then the object is modified, i.e. the object's value is set to the name

content/riak/kv/2.9.2/developing/usage/updating-objects.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
214214
215215
# When performing a write to the same key, that same header needs to
216216
# accompany the write for Riak to be able to use the context object
217+
218+
curl -XPUT \
219+
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
220+
-d "Harlem Globetrotters" \
221+
http://localhost:8098/types/sports/buckets/nba/keys/champion
217222
```
218223

219224
In the samples above, we didn't need to actually interact with the
@@ -292,6 +297,12 @@ fmt.Println(rsp.VClock)
292297
// Output:
293298
// X3hNXFq3ythUqvvrG9eJEGbUyLS
294299
```
300+
```curl
301+
# When using curl, the context object is attached to the X-Riak-Vclock header
302+
curl -i http://localhost:8098/types/sports/buckets/nba/keys/champion
303+
# In the resulting output, the header will look something like this:
304+
X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
305+
```
295306

296307
## The Object Update Cycle
297308

@@ -466,6 +477,13 @@ if err := cluster.Execute(cmd); err != nil {
466477
fmt.Println("Stored Pete Carroll")
467478
```
468479

480+
```curl
481+
curl -XPUT \
482+
-H "Content-Type: text/plain" \
483+
-d "Pete Carroll" \
484+
http://localhost:8098/types/siblings/buckets/coaches/keys/seahawks
485+
```
486+
469487
Every once in a while, though, head coaches change in the NFL, which
470488
means that our data would need to be updated. Below is an example
471489
function for updating such objects:
@@ -612,6 +630,26 @@ func updateCoach(cluster *riak.Cluster, team, newCoach string) error {
612630
}
613631
```
614632

633+
```curl
634+
635+
# When using curl, the context object is attached to the X-Riak-Vclock header
636+
637+
curl -i http://localhost:8098/types/siblings/buckets/coaches/keys/packers
638+
639+
# In the resulting output, the header will look something like this:
640+
641+
X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
642+
643+
# When performing a write to the same key, that same header needs to
644+
# accompany the write for Riak to be able to use the context object
645+
646+
curl -XPUT \
647+
-H "Content-Type: text/plain" \
648+
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
649+
-d "Vince Lombardi" \
650+
http://localhost:8098/types/siblings/buckets/coaches/keys/packers
651+
```
652+
615653
In the example above, you can see the three steps in action: first, the
616654
object is read, which automatically fetches the object's causal context;
617655
then the object is modified, i.e. the object's value is set to the name

content/riak/kv/2.9.4/developing/usage/updating-objects.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
214214
215215
# When performing a write to the same key, that same header needs to
216216
# accompany the write for Riak to be able to use the context object
217+
218+
curl -XPUT \
219+
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
220+
-d "Harlem Globetrotters" \
221+
http://localhost:8098/types/sports/buckets/nba/keys/champion
217222
```
218223

219224
In the samples above, we didn't need to actually interact with the
@@ -292,6 +297,12 @@ fmt.Println(rsp.VClock)
292297
// Output:
293298
// X3hNXFq3ythUqvvrG9eJEGbUyLS
294299
```
300+
```curl
301+
# When using curl, the context object is attached to the X-Riak-Vclock header
302+
curl -i http://localhost:8098/types/sports/buckets/nba/keys/champion
303+
# In the resulting output, the header will look something like this:
304+
X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
305+
```
295306

296307
## The Object Update Cycle
297308

@@ -466,6 +477,13 @@ if err := cluster.Execute(cmd); err != nil {
466477
fmt.Println("Stored Pete Carroll")
467478
```
468479

480+
```curl
481+
curl -XPUT \
482+
-H "Content-Type: text/plain" \
483+
-d "Pete Carroll" \
484+
http://localhost:8098/types/siblings/buckets/coaches/keys/seahawks
485+
```
486+
469487
Every once in a while, though, head coaches change in the NFL, which
470488
means that our data would need to be updated. Below is an example
471489
function for updating such objects:
@@ -612,6 +630,27 @@ func updateCoach(cluster *riak.Cluster, team, newCoach string) error {
612630
}
613631
```
614632

633+
634+
```curl
635+
636+
# When using curl, the context object is attached to the X-Riak-Vclock header
637+
638+
curl -i http://localhost:8098/types/siblings/buckets/coaches/keys/packers
639+
640+
# In the resulting output, the header will look something like this:
641+
642+
X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=
643+
644+
# When performing a write to the same key, that same header needs to
645+
# accompany the write for Riak to be able to use the context object
646+
647+
curl -XPUT \
648+
-H "Content-Type: text/plain" \
649+
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
650+
-d "Vince Lombardi" \
651+
http://localhost:8098/types/siblings/buckets/coaches/keys/packers
652+
```
653+
615654
In the example above, you can see the three steps in action: first, the
616655
object is read, which automatically fetches the object's causal context;
617656
then the object is modified, i.e. the object's value is set to the name

0 commit comments

Comments
 (0)