Skip to content

Commit

Permalink
Merge branch 'master' into zcitc
Browse files Browse the repository at this point in the history
  • Loading branch information
1Shubham7 authored Jan 8, 2025
2 parents 6389bfb + cee77cc commit b52fde0
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/advanced/inclusterconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Please ref to [support in-cluster config proposal](https://github.com/kubeedge/k
When using `keadm init` to deploy CloudCore, please enable `dynamiccontroller` module and `requireAuthorization` featureGate:

```
keadm init --advertise-address="THE-EXPOSED-IP" --kubeedge-version=v1.17.0 --set cloudCore.modules.dynamicController.enable=true cloudCore.featureGates.requireAuthorization=true
keadm init --advertise-address="THE-EXPOSED-IP" --kubeedge-version=v1.17.0 --set cloudCore.modules.dynamicController.enable=true,cloudCore.featureGates.requireAuthorization=true
```

If you have already deployed CloudCore without set `dynamiccontroller` and featureGate, you can modify the configuration following these steps:
Expand Down Expand Up @@ -70,7 +70,7 @@ featureGates:
modules:
...
metaServer:
enable: false
enable: true
...
```

Expand Down
56 changes: 51 additions & 5 deletions docs/developer/mapper-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ Now we provide Influx2,Redis,TDengine database interfaces, we will add more data

#### Pull
The HTTP server was created to provide API services. It supports directly obtaining device data from the device.
The URLs listed below are given in the form of local IP. You can use these services from any network accessible to mapper.
The URLs listed below are given in the form of local IP. You can use these services from any network accessible to Mapper.

Port `7777` is enabled by default.
Port `7777` is enabled by default. User can change the Mapper API port in [config file](https://github.com/kubeedge/kubeedge/blob/master/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/config.yaml).

`deviceInstance-ID` according to your own CRD definition.
`deviceInstance-ID` according to your own CRD definition.
`propertyName` according to your own CRD definition.

#### Ping
Expand All @@ -119,7 +119,7 @@ Port `7777` is enabled by default.
#### Device Data
1. Get device's Data
Method=**GET**
Url: https://127.0.0.1:7777/api/v1/device/deviceInstance-ID/propertyName
Url: https://127.0.0.1:7777/api/v1/device/{deviceInstance-ID}/{propertyName}
Response:
```json
{
Expand All @@ -138,7 +138,7 @@ Port `7777` is enabled by default.
#### Device MetaData
1. Get device's Model
Method=**GET**
Url: https://127.0.0.1:7777/api/v1/meta/model/deviceInstance-ID
Url: https://127.0.0.1:7777/api/v1/meta/model/{deviceInstance-ID}
Response:
```json
{
Expand All @@ -159,6 +159,52 @@ Port `7777` is enabled by default.
}
```

#### Device Write
In version 1.19, the feature of Mapper supporting device writing is implemented, which enhances the original Mapper API capabilities.
Users can obtain all the device methods of a device that can be called externally through the API, and initiate a write request to
the device through the returned call command.

The URLs listed below are given as local IPs. You can use these services from any network accessible to Mapper.

Port `7777` is enabled by default. User can change the Mapper API port in [config file](https://github.com/kubeedge/kubeedge/blob/master/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/config.yaml).

`deviceInstance-ID` according to your own CRD definition.
`propertyName` according to your own CRD definition.

1. Get all device methods of a device
Url: https://127.0.0.1:7777/api/v1/devicemethod/{deviceInstance-ID}
Response:
```json
{
"Data": {
"Methods": [
{
"Name": "setValue",
"Path": "/api/v1/devicemethod/default/random-instance-01/setValue/{propertyName}/{data}",
"Parameters": [
{
"PropertyName": "random-int",
"ValueType": "int"
}
]
}
]
}
}
```

After obtaining the calling command of the device method, the user can create a device write request:

2. Create device write request
Url: https://127.0.0.1:7777/api/v1/devicemethod/{deviceInstance-ID}/{deviceMethodName}/{propertyName}/{data}
Response:
```json
{
"statusCode": 200,
"Message": "Write data ** to device ** successfully."
}
```




Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_
当您使用`keadm init`来安装CloudCore时,请打开`dynamiccontroller`模块以及`requireAuthorization`特性开关:

```
keadm init --advertise-address="THE-EXPOSED-IP" --kubeedge-version=v1.17.0 --set cloudCore.modules.dynamicController.enable=true cloudCore.featureGates.requireAuthorization=true
keadm init --advertise-address="THE-EXPOSED-IP" --kubeedge-version=v1.17.0 --set cloudCore.modules.dynamicController.enable=true,cloudCore.featureGates.requireAuthorization=true
```

如果您已经安装过CloudCore,并且在安装时没有配置`dynamiccontroller`模块以及`requireAuthorization`特性开关,请按照以下步骤修改配置:
Expand Down Expand Up @@ -70,7 +70,7 @@ featureGates:
modules:
...
metaServer:
enable: false
enable: true
...
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ spec:
#### 拉取数据
我们创建HTTP服务用以提供API拉取功能,支持直接从设备拉取设备数据。下面列出的 URL 以本地 IP 的形式给出。你可以从Mapper可访问的任何网络使用这些服务。

默认情况下启用端口“7777”。
默认情况下启用端口“7777”。你可以在Mapper的[config文件](https://github.com/kubeedge/kubeedge/blob/master/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/config.yaml)中自行设置端口号。

`deviceInstance-ID` 根据你自己的 CRD 定义。

Expand All @@ -109,7 +109,7 @@ spec:
#### 设备数据处理
1. 获取设备数据
Method=**GET**
Url: https://127.0.0.1:7777/api/v1/device/deviceInstance-ID/propertyName
Url: https://127.0.0.1:7777/api/v1/device/{deviceInstance-ID}/{propertyName}
Response:
```json
{
Expand All @@ -128,7 +128,7 @@ spec:
#### 设备元数据
1. 获取设备模型
Method=**GET**
Url: https://127.0.0.1:7777/api/v1/meta/model/deviceInstance-ID
Url: https://127.0.0.1:7777/api/v1/meta/model/{deviceInstance-ID}
Response:
```json
{
Expand All @@ -149,6 +149,52 @@ spec:
}
```

#### 设备写入
在1.19版本中实现了Mapper支持设备写入的特性,增强了原有Mapper API能力。用户能够通过API获取某个设备所有可供外部调用的设备方法,通过返回的调用命令向设备发起写入请求。
下面列出的 URL 以本地 IP 的形式给出。你可以从Mapper可访问的任何网络使用这些服务。

默认情况下启用端口“7777”。你可以在Mapper的[config文件](https://github.com/kubeedge/kubeedge/blob/master/staging/src/github.com/kubeedge/mapper-framework/_template/mapper/config.yaml)中自行制定端口号

`deviceInstance-ID` 根据你自己的 CRD 定义。

`propertyName` 根据你自己的 CRD 定义。

1. 获取设备的所有设备方法
Url: https://127.0.0.1:7777/api/v1/devicemethod/{deviceInstance-ID}
Response:
```json
{
"Data": {
"Methods": [
{
"Name": "setValue",
"Path": "/api/v1/devicemethod/default/random-instance-01/setValue/{propertyName}/{data}",
"Parameters": [
{
"PropertyName": "random-int",
"ValueType": "int"
}
]
}
]
}
}
```

获取设备方法的调用命令后,用户可以创建设备写入请求:

2. 创建设备写入请求
Url: https://127.0.0.1:7777/api/v1/devicemethod/{deviceInstance-ID}/{deviceMethodName}/{propertyName}/{data}
Response:
```json
{
"statusCode": 200,
"Message": "Write data ** to device ** successfully."
}
```






Expand Down

0 comments on commit b52fde0

Please sign in to comment.