- 12.2 Open API
- 接口总览
- 接口详情
- GET api/v1/confgo/config/list
- GET api/v1/confgo/config/detail
- api/v1/confgo/config/diff
- api/v1/confgo/config/instance/list
- api/v1/confgo/config/history
- POST api/v1/confgo/config/create
- POST api/v1/confgo/config/update
- POST api/v1/confgo/config/publish
- api/v1/confgo/config/delete
- POST api/v1/confgo/config/diffVersion
- GET api/v1/resource/app_env_zone/list
12.2 Open API
Open API授权公共参数和签名方式请参考 API授权
本文档包含了主要的接口清单,详细文档正在编写中
接口总览
GET api/v1/confgo/config/list
GET api/v1/confgo/config/detail
GET api/v1/confgo/config/diff
GET api/v1/confgo/config/instance/list
GET api/v1/confgo/config/history
POST api/v1/confgo/config/create
POST api/v1/confgo/config/update
POST api/v1/confgo/config/publish
POST api/v1/confgo/config/delete
GET api/v1/confgo/config/diffVersion
GET api/v1/resource/app_env_zone/list
接口详情
GET api/v1/confgo/config/list
input
AppName string `query:"app_name"`
Env string `query:"env"`
output
[{
ID uint `json:"id"`
AID uint `json:"aid"`
Name string `json:"name"`
Format string `json:"format"` // Yaml/Toml
Env string `json:"env"` // 环境
Zone string `json:"zone"` // 机房Zone
CreatedAt time.Time `json:"created_time"`
UpdatedAt time.Time `json:"update_time"`
DeletedAt *time.Time `json:"deleted_at"`
PublishedAt *time.Time `json:"published"` // 未发布/发布时间
}]
GET api/v1/confgo/config/detail
input
ID uint `json:"id"`
output
ID uint `json:"id"`
AID uint `json:"aid"`
Name string `json:"name"`
Content string `json:"content"`
Format string `json:"format"` // Yaml/Toml
Env string `json:"env"` // 环境
Zone string `json:"zone"` // 机房Zone
CreatedAt time.Time `json:"created_time"`
UpdatedAt time.Time `json:"update_time"`
PublishedAt *time.Time `json:"published"` // 未发布/发布时间
api/v1/confgo/config/diff
input
ID uint `query:"id" valid:"required"` // 配置ID
HistoryID uint `query:"history_id" valid:"required"` // 版本ID
output
Origin *RespDetailConfig `json:"origin,omitempty"`
Modified RespDetailConfig `json:"modified"`
api/v1/confgo/config/instance/list
input
ConfigurationID uint `json:"id" query:"id" validate:"required"`
Env string `json:"env" query:"env" validate:"required"`
ZoneCode string `json:"zone_code" query:"zone_code" validate:"required"`
output
[{
ConfigurationStatusID uint `json:"configuration_status_id"`
Env string `json:"env"`
IP string `json:"ip"`
HostName string `json:"host_name"`
DeviceID int `json:"device_id"`
RegionCode string `json:"region_code"`
RegionName string `json:"region_name"`
ZoneCode string `json:"zone_code"`
ZoneName string `json:"zone_name"`
ConfigFilePath string `json:"config_file_path"`
ConfigFileUsed uint `json:"config_file_used"` // 1 supervisor 2 systemd
ConfigFileSynced uint `json:"config_file_synced"`
ConfigFileTakeEffect uint `json:"config_file_take_effect"`
SyncAt time.Time `json:"sync_at"`
}]
api/v1/confgo/config/history
input
ID uint `json:"id"` // 配置文件ID
Size uint `json:"size"`
Page uint `json:"page"`
output
{
Pagination {
Current int `json:"current"`
Total int `json:"total"`
PageSize int `json:"pageSize"`
} `json:"pagination"`
List[{
ID uint `json:"id"`
UID uint `json:"uid"` // 发布人ID
UserName string `json:"user_name"`
ChangeLog string `json:"change_log"`
ConfigurationID uint `json:"configuration_id"`
Version string `json:"version"` // 发布到Juno Proxy的版本号
CreatedAt time.Time `json:"created_at"`
}] `json:"list"`
}
POST api/v1/confgo/config/create
input
AppName string `json:"app_name"`
Env string `json:"env"`
Zone string `json:"zone"`
FileName string `json:"file_name"` // 文件名(不带后缀)
Format ConfigFormat `json:"format"` // 格式后缀名(比如: toml, yaml)
POST api/v1/confgo/config/update
input
ID uint `json:"id"`
Message string `json:"message"`
Content string `json:"content"`
POST api/v1/confgo/config/publish
input
ID uint `json:"id"` // 配置ID
Version *string `json:"version"` // 版本号
api/v1/confgo/config/delete
input
ID uint `json:"id"`
POST api/v1/confgo/config/diffVersion
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
ipList | 是 | []string | ip地址列表 |
appName | 是 | string | 应用名称 |
env | 是 | string | 环境名称 |
- 请求参数示例
{
http://10.117.22.35:50000/api/v1/confgo/config/diffVersion?ips=10.117.22.35&appName=jupiter-demo&env=live
}
- 返回值
{
"code": 0,
"msg": "",
"data": {
"hasNew": false,
"diffUrlList": [{
"name": "single-rexxx:qgion-admin",
"diffUrl": "http://jupiterxxxconsole.douyu.com/app?aid=1\u0026appName=jupiter-demo\u0026env=live\u0026tab=confgo\u0026publishVersion=\u0026serviceVersion=fa041303713cc4d198f6feb282f23a98"
}]
}
}
GET api/v1/resource/app_env_zone/list
input
AppName string `query:"app_name"`
output
[
{
Env string `json:"env"`
ZoneList []struct {
ZoneCode string `json:"zone_code"`
ZoneName string `json:"zone_name"`
} `json:"zone_list"`
}
]