Skip to content

Commit 3f03852

Browse files
document server properties (#183)
* document server properties * Update docs/technical-details/reference/globals.md Co-authored-by: Ethan Arrowood <[email protected]> * Update docs/technical-details/reference/globals.md Co-authored-by: Ethan Arrowood <[email protected]> * Update docs/technical-details/reference/globals.md Co-authored-by: Ethan Arrowood <[email protected]> * update docs --------- Co-authored-by: Ethan Arrowood <[email protected]>
1 parent d80f02b commit 3f03852

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

docs/technical-details/reference/globals.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,4 +282,25 @@ Find a resource that matches the path. For example:
282282
server.resources.getMatch('/NewResource/some-id');
283283
// or specify the export/protocol type, to allow it to be limited:
284284
server.resources.getMatch('/NewResource/some-id', 'my-protocol');
285-
```
285+
```
286+
287+
### `server.operation(operation: Object, context?: Object, authorize?: boolean)`
288+
289+
Execute an operation from the [Operations API](https://docs.harperdb.io/docs/developers/operations-api)
290+
291+
Parameters:
292+
293+
- **operation** - `Object` - Object matching desired operation's request body
294+
- **context** - `Object` - `{ username: string}` - _optional_ - The specified user
295+
- **authorize** - `boolean` - _optional_ - Indicate the operation should authorize the user or not. Defaults to `false`
296+
297+
Returns a `Promise` with the operation's response as per the [Operations API documentation](https://docs.harperdb.io/docs/developers/operations-api).
298+
299+
### `server.nodes`
300+
Returns an array of node objects registered in the cluster
301+
302+
### `server.shards`
303+
Returns map of shard number to an array of its associated nodes
304+
305+
### `server.hostname`
306+
Returns the hostname of the current node

0 commit comments

Comments
 (0)