Commit a18e8f7c authored by Corey O'Connor's avatar Corey O'Connor
Browse files

Update README.md

parent a9ec6ac7
......@@ -19,8 +19,8 @@ Sound good so far? Excellent! Let's start with basic, interactive usage of the s
This document is focused on usage and not extension of the application. Developers may be more interested in the
- [development guide](https://gitlab.com/glngn/glngn-server-examples/blob/master/docs/Customization.md)
- [development error help](https://gitlab.com/glngn/glngn-server-examples/blob/master/docs/CompileErrorHelp.md)
- [development guide](docs/Customization.md)
- [development error help](docs/CompileErrorHelp.md)
The implementation and extension API is familiar to Scala service developers. To a large
degree, glngn server is a friendly, constrained, pre-configured typed akka plus ZIO server. A few of the niceties
......@@ -35,11 +35,11 @@ included:
prerequisites:
- java runtime version 8 or above.
- agreement to the [Developer License](https://gitlab.com/glngn/glngn-server-examples/blob/master/docs/Developer%20License%20v1.rtf?inline=false) This license is also included in the jar archive.
- agreement to the [Developer License](docs/Developer%20License%20v1.rtf?inline=false) This license is also included in the jar archive.
## Download
Prior to downloading, read and agree to the [Developer License agreement](https://gitlab.com/glngn/glngn-server-examples/raw/master/docs/Developer%20License%20v1.rtf?inline=false).
Prior to downloading, read and agree to the [Developer License agreement](docs/Developer%20License%20v1.rtf?inline=false).
- download [the latest release](https://glngn-server-releases.s3.amazonaws.com/assemblies/glngn/glngn-server-assembly_2.12/0.3.139/jars/glngn-server-assembly_2.12-assembly.jar)
......@@ -183,7 +183,7 @@ The API conventions enforced by glngn server:
- These are always available
- EG: `/_ops/groups`: query and modify the available groups
- `/$GROUP/_ops`
- Group `_ops` routes. These require a group, `$GROUP`, to be created
- Group `_ops` routes. These require a group with id, `$GROUP`, to be created
- `/$GROUP/$SERVICE/_ops`
- Service fragment `_ops` routes, `/$GROUP/$SERVICE/_ops`, require the service fragment to be
instantiated under the group
......@@ -191,15 +191,15 @@ The API conventions enforced by glngn server:
- `/$GROUP/$SERVICE/...`
- All other routes under a service are provided by a Service Fragment's `endpoints`
### Create a Groups
#### Create a Group
The `/_ops/groups` endpoint is used to query the existing groups and create new groups.
All services are namespaced under a group. Before we can instantiate and use a service we must
first create a group:
All services are namespaced under a group. Before we can instantiate and use a service we must first create a group:
~~~
$ curl --data '{ "id": "accounts", "name": "Client Accounts" }' localhost:10000/_ops/groups
{
"enabled" : true,
"id" : {
"txt" : "accounts"
},
......@@ -217,6 +217,7 @@ Which we can confirm by querying the `/_ops/groups` endpoint again:
$ curl localhost:10000/_ops/groups
{
"accounts" : {
"enabled" : true,
"id" : {
"txt" : "accounts"
},
......@@ -229,18 +230,55 @@ $ curl localhost:10000/_ops/groups
Note the `operators` attribute. Using the premium license server this would contain the users
authorized to access that group. The free license server ignores this attribute.
### Instantiate a Service Fragment
#### Groups Extend the API
By creating a group we've extended the provided API. Query the `openapi.json` route again
and note the `/accounts/_ops` route:
~~~
$ curl localhost:10000/openapi.json
{
"openapi" : "3.0.1",
"info" : {
"title" : "dynamic",
"version" : "0.1"
},
"paths" : {
"/accounts/_ops" : {
"get" : {
"operationId" : "getAccounts_ops",
"responses" : {
"200" : {
...
}
}
}
}
}
}
~~~
##### Note: Groups Persist
If you were to restart the `java -jar ./glngn-server-assembly.jar` process then you can
note the group remains. `glngn-server` persists the created group to the provided state
storage.
In the example above the state storage is the `starter-state` directory provided to the
`--state-dir` option.
#### Instantiate a Service Fragment
TODO: show dynamic instantiation of a service fragment under a group
### Use a Service Fragment
#### Use a Service
TODO:
1. show dynamic instantiation of a service fragment in OpenAPI schema.
2. demo using the counter service fragment
### Capturing Events
#### Capturing Events
TODO:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment