-
-
Notifications
You must be signed in to change notification settings - Fork 305
Restful API
minjie.zhou edited this page Jul 7, 2021
·
13 revisions
agileconfig支持json restful api来维护配置 。
本API入参跟出参为json格式,所以请求的时候需设置Content-Type头部为application/json 。
使用basic简单认证,设置Authorization头部为Basic base64(userName:password) 。
对节点进行操作
{
"address": "http://localhost:5000",
"remark": "this",
"status": 0, // 1=online 0=offile
"lastEchoTime": null
}
参数名 | 值 |
---|---|
url | /api/node |
method | GET |
status code | 200 |
response content | [model] |
参数名 | 值 |
---|---|
url | /api/node |
method | POST |
status code | 201 |
request body | model |
response content | 空 |
参数名 | 值 |
---|---|
url | /api/node?address={address} |
method | DELETE |
status code | 204 |
response content | 空 |
对应用进行操作
{
"id": "xxx",
"name": "测试程序3",
"secret": "",
"enabled": true, //是否启用
"inheritanced": true, //是否可以继承
"inheritancedApps": null //继承的app列表
}
参数名 | 值 |
---|---|
url | /api/app |
method | GET |
status code | 200 |
response content | [model] |
参数名 | 值 |
---|---|
url | /api/app/{appid} |
method | GET |
status code | 200 |
response content | model |
参数名 | 值 |
---|---|
url | /api/app |
method | POST |
status code | 201 |
request body | model |
response content | 空 |
参数名 | 值 |
---|---|
url | /api/app |
method | PUT |
status code | 200 |
request body | model |
response content | 空 |
参数名 | 值 |
---|---|
url | /api/app/{id} |
method | DELETE |
status code | 204 |
response content | 空 |
对配置进行操作
{
"id": "0986e7ed33c447618f28e92360394cea",
"appId": "xxx",
"group": "", //组
"key": "key1",
"value": "3333",
"description": null, //描述
"onlineStatus": 0, //是否在线 0=等待上线 1=在线
"status": 1 // 0=删除 1=正常
}
参数名 | 值 |
---|---|
url | /api/config |
method | GET |
status code | 200 |
response content | [model] |
参数名 | 值 |
---|---|
url | /api/config/{id} |
method | GET |
status code | 200 |
response content | model |
参数名 | 值 |
---|---|
url | /api/config |
method | POST |
status code | 201 |
request body | model |
response content | 空 |
参数名 | 值 |
---|---|
url | /api/config/{id} |
method | PUT |
status code | 200 |
request body | model |
response content | 空 |
参数名 | 值 |
---|---|
url | /api/config/{id} |
method | DELETE |
status code | 204 |
response content | 空 |
参数名 | 值 |
---|---|
url | /api/config/publish/{id} |
method | POST |
status code | 200 |
response content | 空 |
参数名 | 值 |
---|---|
url | /api/config/offline/{id} |
method | POST |
status code | 200 |
response content | 空 |