-
Notifications
You must be signed in to change notification settings - Fork 35
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
MF-1125 - add provision service docs #33
Conversation
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Please remove |
docs/provision.md
Outdated
@@ -0,0 +1,162 @@ | |||
# Provision service | |||
|
|||
Provision service provides an HTTP API to interact with [Mainflux][mainflux]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tell us first what this service is, then what it provides.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe als explain why we neded this service, the complexity of manual provisioning, what are the manual steps that can be automated, etc...
docs/provision.md
Outdated
Provision service provides an HTTP API to interact with [Mainflux][mainflux]. | ||
Provision service is used to setup initial applications configuration i.e. things, channels, connections and certificates that will be required for the specific use case especially useful for gateway provision. | ||
|
||
For gateways to communicate with [Mainflux][mainflux] configuration is required (mqtt host, thing, channels, certificates...). To get the configuration gateway will send a request to [Bootstrap][bootstrap] service providing `<external_id>` and `<external_key>` in request. To make a request to [Bootstrap][bootstrap] service you can use [Agent][agent] service on a gateway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is unclear what is configuration gateway
. Yuo mean unconfigured gateway
maybe?
docs/provision.md
Outdated
|
||
For gateways to communicate with [Mainflux][mainflux] configuration is required (mqtt host, thing, channels, certificates...). To get the configuration gateway will send a request to [Bootstrap][bootstrap] service providing `<external_id>` and `<external_key>` in request. To make a request to [Bootstrap][bootstrap] service you can use [Agent][agent] service on a gateway. | ||
|
||
To create bootstrap configuration you can use [Bootstrap][bootstrap] or `Provision` service. [Mainflux UI][mfxui] uses [Bootstrap][bootstrap] service for creating gateway configurations. `Provision` service should provide an easy way of provisioning your gateways i.e creating bootstrap configuration and as many things and channels that your setup requires. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit confusing. Why UI uses Bootstrap when there is Provisioning? Maybe this is temporary slution, and UI will move to Provision?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is something that we need to consider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, once you reach the conclusion, please write it here as a note.
docs/provision.md
Outdated
| MF_PROVISION_BS_AUTO_WHITEIST | Should thing be auto whitelisted | true | | ||
| MF_PROVISION_BS_CONTENT | Bootstrap service content | {} | | ||
|
||
By default, call to `/mapping` endpoint will create one thing and two channels (`control` and `data`) and connect it. If there is a requirement for different provision layout we can use [config](docker/configs/config.toml) file in addition to environment variables. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take care with these links, they will not work in docs
repo, as they are relative
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
docs/provision.md
Outdated
|
||
For gateways to communicate with [Mainflux][mainflux] configuration is required (mqtt host, thing, channels, certificates...). To get the configuration gateway will send a request to [Bootstrap][bootstrap] service providing `<external_id>` and `<external_key>` in request. To make a request to [Bootstrap][bootstrap] service you can use [Agent][agent] service on a gateway. | ||
For provisioning we can use [Mainflux CLI](./cli.md) creating users and for each node in the edge (eg. gateway) required number of things, channels, connecting them and creating certificates if needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use https://github.com/mainflux/mainflux/tree/master/cli
here
docs/provision.md
Outdated
|
||
For gateways to communicate with [Mainflux][mainflux] configuration is required (mqtt host, thing, channels, certificates...). Gateway will send a request to [Bootstrap][bootstrap] service providing `<external_id>` and `<external_key>` in http request to get the configuration. To make a request to [Bootstrap][bootstrap] service you can use [Agent][agent] service on a gateway. | ||
|
||
To create bootstrap configuration you can use [Bootstrap][bootstrap] or `Provision` service. [Mainflux UI][mfxui] uses [Bootstrap][bootstrap] service for creating gateway configurations. `Provision` service should provide an easy way of provisioning your gateways i.e creating bootstrap configuration and as many things and channels that your setup requires. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove 1 white space before Provision service should provide
docs/provision.md
Outdated
|
||
To create bootstrap configuration you can use [Bootstrap][bootstrap] or `Provision` service. [Mainflux UI][mfxui] uses [Bootstrap][bootstrap] service for creating gateway configurations. `Provision` service should provide an easy way of provisioning your gateways i.e creating bootstrap configuration and as many things and channels that your setup requires. | ||
|
||
Also you may use provision service to create certificates for each thing. Each service running on gateway may require more than one thing and channel for communication. Let's say that you are using services [Agent][agent] and [Export][exp] on a gateway you will need two channels for `Agent` (`data` and `control`) and one for `Export` and one thing. Additionally if you enabled mtls each service will need its own thing and certificate for access to [Mainflux][mainflux]. Your setup could require any number of things and channels this kind of setup we can call `provision layout`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced about Let's say that
in docs.
Also, is this correct? you will need two channels for Agent (data and control) and one for Export and one thing.
docs/provision.md
Outdated
|
||
In `config.toml` we can enlist array of things and channels that we want to create and make connections between them which we call provision layout. | ||
|
||
Metadata can be whatever suits your needs except that at least one thing needs to have `external_id` (which is populated with value from [request](#example)). Thing that has `external_id` will be used for creating bootstrap configuration which can be fetched with [Agent][agent]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things Metadata must have an "external_id" field which is populated with...
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
docs/provision.md
Outdated
It is part of process of setting up IoT application where | ||
we connect devices on edge with platform in cloud. | ||
|
||
For provisioning we can use [Mainflux CLI][cli] for creating users |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this return new line after ...creating users
ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this new line will not be rendered, if that is what you mean
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
docs/provision.md
Outdated
|
||
Things Metadata can be whatever suits your needs. | ||
Thing that has metadata with `external_id` will have bootstrap configuration created, `external_id` value will be populated with value from [request](#example)). | ||
Bootstrap configuration which can be fetched with [Agent][agent]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bootstrap configuration
whichcan be fetched with [Agent][agent].
docs/provision.md
Outdated
# Provision service | ||
|
||
Provisioning is a process of configuration of an IoT platform in which system operator creates | ||
and sets-up different entities used in the platform - users, channels and things. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..., and things.
docs/provision.md
Outdated
|
||
Provisioning is a process of configuration of an IoT platform in which system operator creates | ||
and sets-up different entities used in the platform - users, channels and things. | ||
It is part of process of setting up IoT application where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applications (plural)
docs/provision.md
Outdated
we connect devices on edge with platform in cloud. | ||
|
||
For provisioning we can use [Mainflux CLI][cli] for creating users | ||
and for each node in the edge (eg. gateway) required number of things, channels, connecting them and creating certificates if needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..., and creating certificates...
docs/provision.md
Outdated
For provisioning we can use [Mainflux CLI][cli] for creating users | ||
and for each node in the edge (eg. gateway) required number of things, channels, connecting them and creating certificates if needed. | ||
|
||
Provision service is used to setup initial applications configuration once user is created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... is used to set up initial application...
docs/provision.md
Outdated
Provision service is used to setup initial applications configuration once user is created. | ||
Provision service creates things, channels, connections and certificates. | ||
Once user is created we can use provision to create setup for edge node | ||
in one http request instead of issuing several cli commands. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use capital letters in acronyms: HTTP request, MQTT protocol, CLI (commands), TLS, API... Check for these in the rest of the document, as well.
docs/provision.md
Outdated
Things Metadata can be whatever suits your needs. | ||
Thing that has metadata with `external_id` will have bootstrap configuration created, `external_id` value will be populated with value from [request](#example)). | ||
Bootstrap configuration which can be fetched with [Agent][agent]. | ||
For channels metadata `type` is reserved for `control` and `data` which we use with [Agent][agent]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For channels, metadata...
docs/provision.md
Outdated
Also you may use provision service to create certificates for each thing. | ||
Each service running on gateway may require more than one thing and channel for communication. | ||
If, for example, you are using services [Agent][agent] and [Export][exp] on a gateway you will need two channels for `Agent` (`data` and `control`) and one thing for `Export`. | ||
Additionally if you enabled mtls each service will need its own thing and certificate for access to [Mainflux][mainflux]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, if you enable mTLS...
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
docs/platform-management.md
Outdated
@@ -0,0 +1,324 @@ | |||
Provisioning is a process of configuration of an IoT platform in which system operator creates and sets-up different entities | |||
used in the platform - users, channels and things. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to break line here
docs/platform-management.md
Outdated
> This endpoint will be depreciated in 0.11.0. It will be replaced with the bulk endpoint currently found at /things/bulk. | ||
|
||
Things are created by executing request `POST /things` with a JSON payload. | ||
Note that you will also need `user_auth_token` in order to create things |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can move this to the upper line
docs/platform-management.md
Outdated
## System provisioning | ||
|
||
Before proceeding, make sure that you have created a new account, and obtained | ||
an authorization key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for line break here
docs/platform-management.md
Outdated
|
||
### Bulk provisioning channels | ||
|
||
Multiple channels can be created by executing a `POST /things/bulk` request with a JSON payload. The payload should contain a JSON array of the channels to be created. If there is an error any of the channels, none of the channels will be created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is actually good. Renders nicely, easy to read. Maybe align all to this style.
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
docs/platform-management.md
Outdated
@@ -1,5 +1,4 @@ | |||
Provisioning is a process of configuration of an IoT platform in which system operator creates and sets-up different entities | |||
used in the platform - users, channels and things. | |||
Provisioning is a process of configuration of an IoT platform in which system operator creates and sets-up different entities used in the platform - users, channels and things. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, and things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that this ,
is optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this comment about? Putting ,
before and
is gramatically incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is not
docs/platform-management.md
Outdated
@@ -116,29 +107,25 @@ Content-Length: 1105 | |||
} | |||
``` | |||
|
|||
You can specify `offset` and `limit` parameters in order to fetch specific | |||
group of things. In that case, your request should look like: | |||
You can specify `offset` and `limit` parameters in order to fetch specific group of things. In that case, your request should look like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...to fetch a specific group...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think that this is ok
docs/platform-management.md
Outdated
curl -s -S -i --cacert docker/ssl/certs/ca.crt -H "Authorization: <user_auth_token>" https://localhost/things?offset=0&limit=5 | ||
``` | ||
|
||
You can specify `name` and/or `metadata` parameters in order to fetch specific | ||
group of things. When specifiying metadata you can specify just a part of the metadata json you want to match | ||
You can specify `name` and/or `metadata` parameters in order to fetch specific group of things. When specifiying metadata you can specify just a part of the metadata json you want to match |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specifying, JSON
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, after match .
docs/provision.md
Outdated
|
||
For provisioning we can use [Mainflux CLI][cli] for creating users and for each node in the edge (eg. gateway) required number of things, channels, connecting them, and creating certificates if needed. | ||
|
||
Provision service is used to setup initial application configuration once user is created. Provision service creates things, channels, connections, and certificates. Once user is created we can use provision to create setup for edge node in one HTTP request instead of issuing several CLI commands. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provision service is used to set up...
...to create a setup...
docs/provision.md
Outdated
|
||
To create bootstrap configuration you can use [Bootstrap][bootstrap] or `Provision` service. [Mainflux UI][mfxui] uses [Bootstrap][bootstrap] service for creating gateway configurations. `Provision` service should provide an easy way of provisioning your gateways i.e creating bootstrap configuration and as many things and channels that your setup requires. | ||
|
||
Also you may use provision service to create certificates for each thing. Each service running on gateway may require more than one thing and channel for communication. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, you...
docs/provision.md
Outdated
|
||
Configuration can be specified in [config.toml][conftoml]. Config file can specify all the settings that environment variables can configure and in addition `/mapping` endpoint provision layout can be configured. | ||
|
||
In `config.toml` we can enlist array of things and channels that we want to create and make connections between them which we call provision layout. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... enlist an array...
docs/provision.md
Outdated
In order to create necessary entities provision service needs to authenticate against Mainflux. | ||
To provide authentication credentials to the provision service you can pass it in as an environment variable or in a config file as Mainflux user and password or as API token (that can be issued on `/users` or `/keys` endpoint of [authn][authn]. | ||
|
||
Additionally users or API token can be passed in Authorization header, this authentication takes precedence over others. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, ...
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* add provision service docs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update docs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add some desc on prov Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix layout, and minor text change Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix links Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add section, text change Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * lector fix Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix link Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renam file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reformat and fix typos Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix name Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renam file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update style Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small changes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
* add provision service docs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update docs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add some desc on prov Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix layout, and minor text change Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix links Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add section, text change Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * lector fix Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix link Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renam file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reformat and fix typos Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix name Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renam file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update style Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small changes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
* add provision service docs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update docs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add some desc on prov Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix layout, and minor text change Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix links Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add section, text change Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * lector fix Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix link Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renam file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reformat and fix typos Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix name Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renam file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update style Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small changes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
https://github.com/mainflux/mainflux/issues/1125