Skip to content

Fixes missing curl examples from PR #137 #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 24, 2023
38 changes: 38 additions & 0 deletions content/riak/kv/2.9.1/developing/usage/updating-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=

# When performing a write to the same key, that same header needs to
# accompany the write for Riak to be able to use the context object

curl -XPUT \
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
-d "Harlem Globetrotters" \
http://localhost:8098/types/sports/buckets/nba/keys/champion
```

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

## The Object Update Cycle

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

```curl
curl -XPUT \
-H "Content-Type: text/plain" \
-d "Pete Carroll" \
http://localhost:8098/types/siblings/buckets/coaches/keys/seahawks
```

Every once in a while, though, head coaches change in the NFL, which
means that our data would need to be updated. Below is an example
function for updating such objects:
Expand Down Expand Up @@ -612,6 +630,26 @@ func updateCoach(cluster *riak.Cluster, team, newCoach string) error {
}
```

```curl

# When using curl, the context object is attached to the X-Riak-Vclock header

curl -i http://localhost:8098/types/siblings/buckets/coaches/keys/packers

# In the resulting output, the header will look something like this:

X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=

# When performing a write to the same key, that same header needs to
# accompany the write for Riak to be able to use the context object

curl -XPUT \
-H "Content-Type: text/plain" \
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
-d "Vince Lombardi" \
http://localhost:8098/types/siblings/buckets/coaches/keys/packers
```

In the example above, you can see the three steps in action: first, the
object is read, which automatically fetches the object's causal context;
then the object is modified, i.e. the object's value is set to the name
Expand Down
39 changes: 39 additions & 0 deletions content/riak/kv/2.9.10/developing/usage/updating-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=

# When performing a write to the same key, that same header needs to
# accompany the write for Riak to be able to use the context object

curl -XPUT \
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
-d "Harlem Globetrotters" \
http://localhost:8098/types/sports/buckets/nba/keys/champion
```

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

## The Object Update Cycle

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

```curl
curl -XPUT \
-H "Content-Type: text/plain" \
-d "Pete Carroll" \
http://localhost:8098/types/siblings/buckets/coaches/keys/seahawks
```

Every once in a while, though, head coaches change in the NFL, which
means that our data would need to be updated. Below is an example
function for updating such objects:
Expand Down Expand Up @@ -612,6 +630,27 @@ func updateCoach(cluster *riak.Cluster, team, newCoach string) error {
}
```


```curl

# When using curl, the context object is attached to the X-Riak-Vclock header

curl -i http://localhost:8098/types/siblings/buckets/coaches/keys/packers

# In the resulting output, the header will look something like this:

X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=

# When performing a write to the same key, that same header needs to
# accompany the write for Riak to be able to use the context object

curl -XPUT \
-H "Content-Type: text/plain" \
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
-d "Vince Lombardi" \
http://localhost:8098/types/siblings/buckets/coaches/keys/packers
```

In the example above, you can see the three steps in action: first, the
object is read, which automatically fetches the object's causal context;
then the object is modified, i.e. the object's value is set to the name
Expand Down
38 changes: 38 additions & 0 deletions content/riak/kv/2.9.2/developing/usage/updating-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=

# When performing a write to the same key, that same header needs to
# accompany the write for Riak to be able to use the context object

curl -XPUT \
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
-d "Harlem Globetrotters" \
http://localhost:8098/types/sports/buckets/nba/keys/champion
```

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

## The Object Update Cycle

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

```curl
curl -XPUT \
-H "Content-Type: text/plain" \
-d "Pete Carroll" \
http://localhost:8098/types/siblings/buckets/coaches/keys/seahawks
```

Every once in a while, though, head coaches change in the NFL, which
means that our data would need to be updated. Below is an example
function for updating such objects:
Expand Down Expand Up @@ -612,6 +630,26 @@ func updateCoach(cluster *riak.Cluster, team, newCoach string) error {
}
```

```curl

# When using curl, the context object is attached to the X-Riak-Vclock header

curl -i http://localhost:8098/types/siblings/buckets/coaches/keys/packers

# In the resulting output, the header will look something like this:

X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=

# When performing a write to the same key, that same header needs to
# accompany the write for Riak to be able to use the context object

curl -XPUT \
-H "Content-Type: text/plain" \
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
-d "Vince Lombardi" \
http://localhost:8098/types/siblings/buckets/coaches/keys/packers
```

In the example above, you can see the three steps in action: first, the
object is read, which automatically fetches the object's causal context;
then the object is modified, i.e. the object's value is set to the name
Expand Down
39 changes: 39 additions & 0 deletions content/riak/kv/2.9.4/developing/usage/updating-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=

# When performing a write to the same key, that same header needs to
# accompany the write for Riak to be able to use the context object

curl -XPUT \
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
-d "Harlem Globetrotters" \
http://localhost:8098/types/sports/buckets/nba/keys/champion
```

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

## The Object Update Cycle

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

```curl
curl -XPUT \
-H "Content-Type: text/plain" \
-d "Pete Carroll" \
http://localhost:8098/types/siblings/buckets/coaches/keys/seahawks
```

Every once in a while, though, head coaches change in the NFL, which
means that our data would need to be updated. Below is an example
function for updating such objects:
Expand Down Expand Up @@ -612,6 +630,27 @@ func updateCoach(cluster *riak.Cluster, team, newCoach string) error {
}
```


```curl

# When using curl, the context object is attached to the X-Riak-Vclock header

curl -i http://localhost:8098/types/siblings/buckets/coaches/keys/packers

# In the resulting output, the header will look something like this:

X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=

# When performing a write to the same key, that same header needs to
# accompany the write for Riak to be able to use the context object

curl -XPUT \
-H "Content-Type: text/plain" \
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
-d "Vince Lombardi" \
http://localhost:8098/types/siblings/buckets/coaches/keys/packers
```

In the example above, you can see the three steps in action: first, the
object is read, which automatically fetches the object's causal context;
then the object is modified, i.e. the object's value is set to the name
Expand Down
39 changes: 39 additions & 0 deletions content/riak/kv/2.9.7/developing/usage/updating-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=

# When performing a write to the same key, that same header needs to
# accompany the write for Riak to be able to use the context object

curl -XPUT \
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
-d "Harlem Globetrotters" \
http://localhost:8098/types/sports/buckets/nba/keys/champion
```

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

## The Object Update Cycle

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

```curl
curl -XPUT \
-H "Content-Type: text/plain" \
-d "Pete Carroll" \
http://localhost:8098/types/siblings/buckets/coaches/keys/seahawks
```

Every once in a while, though, head coaches change in the NFL, which
means that our data would need to be updated. Below is an example
function for updating such objects:
Expand Down Expand Up @@ -612,6 +630,27 @@ func updateCoach(cluster *riak.Cluster, team, newCoach string) error {
}
```


```curl

# When using curl, the context object is attached to the X-Riak-Vclock header

curl -i http://localhost:8098/types/siblings/buckets/coaches/keys/packers

# In the resulting output, the header will look something like this:

X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=

# When performing a write to the same key, that same header needs to
# accompany the write for Riak to be able to use the context object

curl -XPUT \
-H "Content-Type: text/plain" \
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
-d "Vince Lombardi" \
http://localhost:8098/types/siblings/buckets/coaches/keys/packers
```

In the example above, you can see the three steps in action: first, the
object is read, which automatically fetches the object's causal context;
then the object is modified, i.e. the object's value is set to the name
Expand Down
39 changes: 39 additions & 0 deletions content/riak/kv/2.9.8/developing/usage/updating-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=

# When performing a write to the same key, that same header needs to
# accompany the write for Riak to be able to use the context object

curl -XPUT \
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
-d "Harlem Globetrotters" \
http://localhost:8098/types/sports/buckets/nba/keys/champion
```

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

## The Object Update Cycle

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

```curl
curl -XPUT \
-H "Content-Type: text/plain" \
-d "Pete Carroll" \
http://localhost:8098/types/siblings/buckets/coaches/keys/seahawks
```

Every once in a while, though, head coaches change in the NFL, which
means that our data would need to be updated. Below is an example
function for updating such objects:
Expand Down Expand Up @@ -612,6 +630,27 @@ func updateCoach(cluster *riak.Cluster, team, newCoach string) error {
}
```


```curl

# When using curl, the context object is attached to the X-Riak-Vclock header

curl -i http://localhost:8098/types/siblings/buckets/coaches/keys/packers

# In the resulting output, the header will look something like this:

X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=

# When performing a write to the same key, that same header needs to
# accompany the write for Riak to be able to use the context object

curl -XPUT \
-H "Content-Type: text/plain" \
-H "X-Riak-Vclock: a85hYGBgzGDKBVIcWu/1S4OVPaIymBIZ81gZbskuOMOXBQA=" \
-d "Vince Lombardi" \
http://localhost:8098/types/siblings/buckets/coaches/keys/packers
```

In the example above, you can see the three steps in action: first, the
object is read, which automatically fetches the object's causal context;
then the object is modified, i.e. the object's value is set to the name
Expand Down
Loading