更新服务插件
本地
本地
PUT
http://127.0.0.1:9999/api/v1/service
请求参数
Header 参数
x-token
string
可选
默认值:
{{x-token}}
Body 参数application/json
id
string
服务id
service_config
string
服务配置
接入协议 service_config JSON 结构体
{
"device_type": 1, // 设备类型: 1-设备, 2-网关 (必填)
"access_address": "http://example.com/access", // 接入地址 (可选)
"http_address": "http://example.com/service", // HTTP服务地址 (必填)
"sub_topic_prefix": "topic_prefix" // 服务订阅主题前缀 (必填)
}
接入服务 service_config JSON 结构体
{
"http_address": "http://example.com/service", // HTTP服务地址 (必填)
"sub_topic_prefix": "topic_prefix" // 服务订阅主题前缀 (必填)
}
name
string
服务名
service_identifier
string
服务标识
service_type
integer
服务类型
version
string
版本号
description
string
描述
remark
string
备注
示例
{
"id": "025e46d1-4643-2558-e905-1ef0d7c9aab0",
"service_config": "{\"service_config\":\"tttttt\"}",
"name": "服务测试",
"service_identifier": "服务标识",
"service_type": 1,
"version": "1.0.0",
"description": "描述",
"remark": "备注"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request PUT 'http://127.0.0.1:9999/api/v1/service' \
--header 'x-token: {{x-token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"id":"025e46d1-4643-2558-e905-1ef0d7c9aab0",
"service_config": "{\"service_config\":\"tttttt\"}",
"name" : "服务测试",
"service_identifier" : "服务标识",
"service_type" : 1,
"version" : "1.0.0",
"description" : "描述",
"remark" : "备注"
}'
返回响应
🟢200成功
application/json
Body
object {0}
示例
{}
修改于 2025-03-25 02:11:25