應用詳情
獲取 HTTP 應用詳情
URI
GET /admin-api/applications/http/{app-id}
URI 引數
detail
type: integer
is_necessary: no
description: 傳任意值顯示詳細資訊,不傳顯示簡略資訊
請求示例
Shell
curl 'https://{admin-site}/admin-api/applications/http/1?detail=1'
響應示例
Status: 200 OK
{
"status":0,
"data":{
"partitions":[
1 // app所屬分割槽
],
"_modified_unix":1615374769.5893,
"permission":{
"app.http.test":{ // 使用者許可權相關
"read":true,
"write":true,
"config_item":[
"read",
"write"
],
"path":"app.http.test"
}
},
"is_default":false, // 是否預設app
"creator":1,
"http_ports":[ // 監聽埠
80
],
"phases":{
"rewrite":{
"user_code":{ // edgelang規則
"after":"",
"before":"#true =>
# my Str $upstream = foreign-call(module: "custom_lua_module", func: "calc_upstream"),
# set-proxy-header("Host", "www.openresty.com.com"),
# set-upstream-addr(ip: $upstream, port: 80);
#say('nice try');"
},
"rules":[
{
"top":0, // 為1時規則優先順序最高
"actions":[
{
"set-proxy-header":{ // 設定代理頭
"value":"www.openresty.com",
"header":"Host"
},
"id":1,
"type":"set-proxy-header"
}
],
"comment":"",
"proxy":{
"read_timeout_unit":"s",
"send_timeout":60,
"balancer":{ // 負載均衡策略
"algorithm":"roundrobin"
},
"read_timeout":60,
"upstream":[ // 上游
{
"weight":1,
"cluster":1,
"id":1
}
],
"retries":1,
"upstream_el_code":"", // 使用edgelang配置代理規則
"retry_condition":[ // 重試條件
"error",
"timeout",
"invalid_header",
"http_500",
"http_502",
"http_504"
],
"connect_timeout_unit":"s",
"send_timeout_unit":"s",
"connect_timeout":60
},
"last":true,
"_modified_unix":1615360205.519,
"enable_rule":true,
"order":1, // 規則優先順序,數字越小,優先順序越高
"_created_unix":1615200423.6134,
"id":1
}
]
}
},
"_created_unix":1615200284.1803,
"id":1,
"config":{
"limiter":{
"check_post_args_type":true // 啟用後,將只獲取 `Content-Type` 為 `application/x-www-form-urlencoded` 的 POST 請求的引數
}
},
"https_ports":[
443
],
"domains":[
{
"id":1,
"is_wildcard":false, // 是否有萬用字元
"domain":"www.openresty.com"
}
],
"http2_status":"global", // 跟隨全域性配置
"clusters":[
{
"disable_ssl_verify":false, // 不校驗ssl證書
"creator":1,
"ssl":false,
"_created_unix":1615200393.1311,
"enable_checker":false, // 是否開啟健康檢查
"id":1,
"name":"openresty",
"_modified_unix":1615200393.1311,
"nodes":[
{
"weight":1, // 轉發權重
"_modified_unix":1615200393.1311,
"ip":"127.0.0.1",
"_created_unix":1615200393.1311,
"port":80,
"id":1,
"netns":"",
"status":1,
"name":"localhost.localdomain",
"use_proxy_host":false // 使用代理主機/請求主機作為上游地址
}
]
}
]
}
}