提交 a180bb69 编写于 作者: 麦壳饼's avatar 麦壳饼

write api docs

上级 65d9f78c
baseURL = "/"
languageCode = "en-US"
defaultContentLanguage = "en"
languageCode = "zh-cn"
defaultContentLanguage = "zh-cn"
title = "IoTSharp Documentation"
theme = "docs"
......@@ -37,9 +37,9 @@ url = "showcase"
weight = 11
[[Languages.en.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bookmark'></i> IoTSharp Documentation"
identifier = "iotsharpdoc"
url = "https://docs.iotsharp.io/"
name = "<i class='fas fa-fw fa-bookmark'></i> IoTSharp Home Page"
identifier = "iotsharhome"
url = "https://iotsharp.io/"
weight = 20
[[Languages.en.menu.shortcuts]]
......@@ -64,9 +64,9 @@ url = "/showcase"
weight = 11
[[Languages.zh-cn.menu.shortcuts]]
name = "<i class='fas fa-fw fa-bookmark'></i> IoTSharp 文档"
name = "<i class='fas fa-fw fa-bookmark'></i> IoTSharp 首页"
identifier = "iotsharpdoc"
url = "https://docs.iotsharp.io/"
url = "https://iotsharp.io/"
weight = 20
[[Languages.zh-cn.menu.shortcuts]]
......
---
title: Api
weight: 5
pre: "<b>1. </b>"
chapter: true
---
#
---
title: Api
weight: 5
pre: "<b>1. </b>"
chapter: true
---
### API 介绍
# MQTT API Description
## MQTT Validation:
The following authentication methods are currently supported:
AccessToken when a ACCESSTOKEN,MQTT connection is automatically generated when each device is created, the user name fills in the AccessToken value.
DevicePassword User name password login, in the connection to fill in the specified user name password can be.
X509Certificate X509 Encryption method, this method is being tested and validated.
## Introduction to Topic Rules
### Devices:
Attribute data /devices/me/attributes
Telemetry data /devices/me/telemetry
### Gateway:
Upload attribute data for the device itself /devices/me/attributes
Upload telemetry data for the device itself /devices/me/telemetry
Upload Child device attribute data /devices/<Child device Name>/attributes
Upload Child device Telemetry data /devices/<Child device Name>/telemetry
When uploading the properties and telemetry data of a child device, you first find out if the device exists and, if so, create a device, create a device's tenant and customer information inherited from the gateway, and automatically create a device that is no different from a normal device. Child device Name If you specify a child device that already has a device or other gateway, you cannot create it, that is, all device names for a customer are unique.
## Data Type
### XML :
Topic rules: /devices/me/attributes/xml/<KeyName>
KeyName is the key name, Playload content is a value, the pre-deposit program will use the XLM loader to try to load whether the correct XML, if there are any exceptions, it is not saved, if the format is correct to load properly, then save.
#### Binary:
主题规则: /devices/me/attributes/binary/<KeyName>
KeyName is the key name, and the Playload content is a binary array.
#### General type
The general data type is completely determined by the Json format in the Playload you send
Single KeyValue mode:
{"KeyName":"KeyValue"}
Array KeyValue mode:
[
{"KeyName": "KeyValue" },
{"IntKeyName": 32 },
{"JsonKeyName": {
​ "Name":"maike.ma"
​ ,"Age":35
​ }
}
]
## 数据存储
当有新数据进来后, 如果键值已经存在, 则修改键值对应的值 , 如果键值不存在, 则创建,并像历史数据中新增一条。
目前我们将所有数据都存在PostgreSQL , 如果数据量巨大, 可以根据情况存放在 *MongoDB**Cassandra* 等 NoSQL 数据库中。
\ No newline at end of file
......@@ -5,8 +5,9 @@ pre: "<b>1. </b>"
chapter: true
---
### Chapter 1
# Introduction
# Basics
# What is IoTSharp
IoTSharp is an open source IoT platform with data collection, data processing, data visualization, multi-tenant device management, and more
Discover what this IotSharp
......@@ -5,8 +5,9 @@ pre: "<b>1. </b>"
chapter: true
---
### 章节 1
### 介绍
# 基础
# 什么是IoTSharp
IoTSharp 是一个开源的物联网平台,具备数据收集、数据处理、数据可视化、多租户设备管理等
了解什么是IoTSharp
......@@ -3,3 +3,51 @@ date: 2016-04-09T16:50:16+02:00
title: Configuration
weight: 20
---
appsettings.json Configuration Instructions
DataBase
DataBase is used to specify which connection string in ConnectionStrings is currently used by the app, and in principle we support SQLite SQL Server and Pgsql, but we recommend Pgsql
"DataBase": "npgsql",
"ConnectionStrings": {
"mssql": "Server=localhost;Database=IoTSharp;Trusted_Connection=True;MultipleActiveResultSets=true",
"npgsql": "Server=localhost;Database=IoTSharp;Username=postgres;Password=future;",
"sqlite": "Data Source=:memory:"
}
Key settings and Expiration time settings for JWT
"JwtKey": "kissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissme",
"JwtExpireDays": 1,
"JwtIssuer": "IoTSharp.Hub",
"AllowedHosts": "*",
Health check settings, which have not yet been developed
"HealthChecks-UI": {
"HealthChecks": [
{
"Name": "HTTP-Api-Basic",
"Uri": "http://localhost:5000/health"
}
],
"Webhooks": [
{
"Name": "",
"Uri": "",
"Payload": "",
"RestoredPayload": ""
}
],
"EvaluationTimeOnSeconds": 10,
"MinimumSecondsBetweenFailureNotifications": 60
}
}
\ No newline at end of file
......@@ -3,3 +3,51 @@ date: 2016-04-09T16:50:16+02:00
title: 配置
weight: 20
---
appsettings.json 配置说明
数据库部分:
DataBase 用于指定目前应用使用ConnectionStrings中的哪个连接字符串,原则上我们支持 sqlite sqlserver 和 pgsql , 但我们推荐pgsql
"DataBase": "npgsql",
"ConnectionStrings": {
"mssql": "Server=localhost;Database=IoTSharp;Trusted_Connection=True;MultipleActiveResultSets=true",
"npgsql": "Server=localhost;Database=IoTSharp;Username=postgres;Password=future;",
"sqlite": "Data Source=:memory:"
}
JWT 的key 设置 和过期时间设置
"JwtKey": "kissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissmekissme",
"JwtExpireDays": 1,
"JwtIssuer": "IoTSharp.Hub",
"AllowedHosts": "*",
健康检查页面设置, 目前尚未开发完成
"HealthChecks-UI": {
"HealthChecks": [
{
"Name": "HTTP-Api-Basic",
"Uri": "http://localhost:5000/health"
}
],
"Webhooks": [
{
"Name": "",
"Uri": "",
"Payload": "",
"RestoredPayload": ""
}
],
"EvaluationTimeOnSeconds": 10,
"MinimumSecondsBetweenFailureNotifications": 60
}
}
\ No newline at end of file
......@@ -2,3 +2,22 @@
title: Installation
weight: 15
---
## How to install
### Linux
- mkdir /var/iotsharp
- cp ./* /var/iotsharp/
- chmod 777 IoTSharp
- cp iotsharp.service /etc/systemd/system/iotsharp.service
- sudo systemctl enable /etc/systemd/system/iotsharp.service
- sudo systemctl start iotsharp.service
- sudo journalctl -fu iotsharp.service
- http://127.0.0.1:5000/
### Windows
- sc create iotsharp binPath= "D:\iotsharp\IoTSharp.exe" displayname= "IoTSharp" start= auto
Later we will provide apt-get and rpm
\ No newline at end of file
......@@ -2,4 +2,22 @@
title: 安装
weight: 15
---
\ No newline at end of file
## 如何安装:
### Linux
- mkdir /var/iotsharp
- cp ./* /var/iotsharp/
- chmod 777 IoTSharp
- cp iotsharp.service /etc/systemd/system/iotsharp.service
- sudo systemctl enable /etc/systemd/system/iotsharp.service
- sudo systemctl start iotsharp.service
- sudo journalctl -fu iotsharp.service
- http://127.0.0.1:5000/
### Windows
- sc create iotsharp binPath= "D:\iotsharp\IoTSharp.exe" displayname= "IoTSharp" start= auto
注意: 后期我们将提供 apt-get 和 rpm 安装包 ,
\ No newline at end of file
......@@ -4,4 +4,12 @@ weight: 10
disableToc: true
---
\ No newline at end of file
The prerequisites for IoTSharp depend on the prerequisites for. Net Core 2.2, please refer to
Prerequisites for .NET Core on Windows <https://docs.microsoft.com/en-us/dotnet/core/windows-prerequisites?tabs=netcore2x>
Prerequisites for .NET Core on macOS <https://docs.microsoft.com/en-us/dotnet/core/macos-prerequisites?tabs=netcore2x>
Prerequisites for .NET Core on Linux <https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x>
\ No newline at end of file
......@@ -3,3 +3,13 @@ title: 系统必备
weight: 10
disableToc: true
---
IoTSharp的先决条件取决于.Net Core 2.2 的先决条件, 请参考:
在Windows 上先决条件 <https://docs.microsoft.com/zh-chs/dotnet/core/windows-prerequisites?tabs=netcore2x>
在 macOS 上先决条件 <https://docs.microsoft.com/zh-chs/dotnet/core/macos-prerequisites?tabs=netcore2x>
在Linux 上先决条件 <https://docs.microsoft.com/zh-chs/dotnet/core/linux-prerequisites?tabs=netcore2x>
\ No newline at end of file
---
title: Database
weight: 5
pre: "<b>1. </b>"
pre: "<b>2. </b>"
chapter: true
---
### Chapter 1
# Database
###
For more information, see https://www.postgresql.org/download/
---
title: 数据库
weight: 5
pre: "<b>1. </b>"
pre: "<b>2. </b>"
chapter: true
---
### 章节 1
# 数据库
关于数据库,请参考 https://www.postgresql.org/download/
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册