Skip to content

Commit ad9c1bc

Browse files
committed
some code block (and related) cleanup
1 parent 00fd266 commit ad9c1bc

File tree

21 files changed

+92
-79
lines changed

21 files changed

+92
-79
lines changed

docs/developers/operations-api/clustering.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ _Operation is restricted to super_user roles only_
167167
"lastReceivedRemoteTime": "Wed, 12 Feb 2025 16:49:29 GMT",
168168
"lastReceivedLocalTime": "Wed, 12 Feb 2025 16:50:59 GMT",
169169
"lastSendTime": "Wed, 12 Feb 2025 16:50:59 GMT"
170-
},
170+
}
171+
]
171172
}
172173
],
173174
"node_name": "server-1.domain.com",

docs/developers/operations-api/components.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,12 @@ _Operation is restricted to super_user roles only_
462462
[
463463
{
464464
"name": "harperdb-private-component"
465-
},
466-
...
465+
}
467466
]
468467
```
469468

469+
_Note: Additional SSH keys would appear as more objects in this array_
470+
470471
---
471472

472473
## Set SSH Known Hosts

docs/developers/replication/sharding.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ Likewise, you can specify replicateTo and confirm parameters in the operation ob
6161

6262
or you can specify nodes:
6363

64-
```json
65-
...,
64+
```jsonc
65+
{
66+
// ...
6667
"replicateTo": ["node-1", "node-2"]
67-
...
68+
// ...
69+
}
6870
```
6971

7072
## Programmatic Replication Control

docs/developers/security/users-and-roles.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ There are two parts to a permissions set:
9898

9999
Each table that a role should be given some level of CRUD permissions to must be included in the `tables` array for its database in the roles permissions JSON passed to the API (_see example above_).
100100

101-
```json
101+
```jsonc
102102
{
103103
"table_name": { // the name of the table to define CRUD perms for
104104
"read": boolean, // access to read from this table
@@ -113,6 +113,7 @@ Each table that a role should be given some level of CRUD permissions to must be
113113
"update": boolean // access to update this attribute in the table
114114
}
115115
]
116+
}
116117
}
117118
```
118119

docs/getting-started/first-harper-app.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,20 @@ type Dog @table @export {
8888
}
8989
```
9090

91-
By default the application HTTP server port is `9926` (this can be [configured here](../deployments/configuration#http)), so the local URL would be `http:/localhost:9926/Dog/` with a full REST API. We can PUT or POST data into this table using this new path, and then GET or DELETE from it as well (you can even view data directly from the browser). If you have not added any records yet, we could use a PUT or POST to add a record. PUT is appropriate if you know the id, and POST can be used to assign an id:
91+
By default the application HTTP server port is `9926` (this can be [configured here](../deployments/configuration#http)), so the local URL would be `http://localhost:9926/Dog/` with a full REST API. We can PUT or POST data into this table using this new path, and then GET or DELETE from it as well (you can even view data directly from the browser). If you have not added any records yet, we could use a PUT or POST to add a record. PUT is appropriate if you know the id, and POST can be used to assign an id:
9292

93-
```json
94-
POST /Dog/
95-
Content-Type: application/json
96-
97-
{
98-
"name": "Harper",
99-
"breed": "Labrador",
100-
"age": 3,
101-
"tricks": ["sits"]
102-
}
93+
```bash
94+
curl -X POST http://localhost:9926/Dog/ \
95+
-H "Content-Type: application/json" \
96+
-d '{
97+
"name": "Harper",
98+
"breed": "Labrador",
99+
"age": 3,
100+
"tricks": ["sits"]
101+
}'
103102
```
104103

105-
With this a record will be created and the auto-assigned id will be available through the `Location` header. If you added a record, you can visit the path `/Dog/<id>` to view that record. Alternately, the curl command curl `http:/localhost:9926/Dog/<id>` will achieve the same thing.
104+
With this a record will be created and the auto-assigned id will be available through the `Location` header. If you added a record, you can visit the path `/Dog/<id>` to view that record. Alternately, the curl command `curl http://localhost:9926/Dog/<id>` will achieve the same thing.
106105

107106
## Authenticating Endpoints
108107

versioned_docs/version-4.1/security/users-and-roles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ There are two parts to a permissions set:
102102

103103
Each table that a role should be given some level of CRUD permissions to must be included in the `tables` array for its schema in the roles permissions JSON passed to the API (_see example above_).
104104

105-
```json
105+
```jsonc
106106
{
107107
"table_name": { // the name of the table to define CRUD perms for
108108
"read": boolean, // access to read from this table

versioned_docs/version-4.2/developers/security/users-and-roles.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ When creating a new, user-defined role in a HarperDB instance, you must provide
4747

4848
Example JSON for `add_role` request
4949

50-
```json
50+
```jsonc
5151
{
5252
"operation": "add_role",
5353
"role": "software_developer",
@@ -98,7 +98,7 @@ There are two parts to a permissions set:
9898

9999
Each table that a role should be given some level of CRUD permissions to must be included in the `tables` array for its schema in the roles permissions JSON passed to the API (_see example above_).
100100

101-
```json
101+
```jsonc
102102
{
103103
"table_name": { // the name of the table to define CRUD perms for
104104
"read": boolean, // access to read from this table

versioned_docs/version-4.3/developers/security/users-and-roles.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ When creating a new, user-defined role in a HarperDB instance, you must provide
4747

4848
Example JSON for `add_role` request
4949

50-
```json
50+
```jsonc
5151
{
5252
"operation": "add_role",
5353
"role": "software_developer",
@@ -98,7 +98,7 @@ There are two parts to a permissions set:
9898

9999
Each table that a role should be given some level of CRUD permissions to must be included in the `tables` array for its database in the roles permissions JSON passed to the API (_see example above_).
100100

101-
```json
101+
```jsonc
102102
{
103103
"table_name": { // the name of the table to define CRUD perms for
104104
"read": boolean, // access to read from this table

versioned_docs/version-4.4/developers/operations-api/components.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,11 +453,12 @@ _Operation is restricted to super_user roles only_
453453
[
454454
{
455455
"name": "harperdb-private-component"
456-
},
457-
...
456+
}
458457
]
459458
```
460459

460+
_Note: Additional SSH keys would appear as more objects in this array_
461+
461462
## Set SSH Known Hosts
462463

463464
Sets the SSH known_hosts file. This will overwrite the file.

versioned_docs/version-4.4/developers/replication/sharding.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ With the REST interface, replication levels and destinations can also specified
2525
PUT /MyTable/3
2626
X-Replicate-To: 2;confirm=1
2727
28-
...
28+
// ... }
2929
```
3030

3131
You can also explicitly specify destination nodes by providing a comma-separated list of node hostnames. For example, to specify that data should be replicated to nodes `node1` and `node2`, you can use the following header:
@@ -41,7 +41,7 @@ X-Replicate-To: node1,node2
4141

4242
Likewise, you can specify replicateTo and confirm parameters in the operation object when using the Harper API. For example, to specify that data should be replicated to two other nodes, and the response should be returned once confirmation is received from one other node, you can use the following operation object:
4343

44-
```json
44+
```jsonc
4545
{
4646
"operation": "update",
4747
"schema": "dev",
@@ -57,10 +57,12 @@ Likewise, you can specify replicateTo and confirm parameters in the operation ob
5757

5858
or you can specify nodes:
5959

60-
```json
61-
...,
60+
```jsonc
61+
{
62+
// ...
6263
"replicateTo": ["node-1", "node-2"]
63-
...
64+
// ...
65+
}
6466
```
6567

6668
## Programmatic Replication Control
@@ -104,7 +106,7 @@ MyTable.setResidencyById((id) => {
104106

105107
Normally sharding allows data to be stored in specific nodes, but still allows access to the data from any node. However, you can also disable cross-node access so that data is only returned if is stored on the node where it is accessed. To do this, you can set the `replicateFrom` property on the context of operation to `false`:
106108

107-
```json
109+
```jsonc
108110
{
109111
"operation": "search_by_id",
110112
"table": "MyTable",

0 commit comments

Comments
 (0)