应用详情

获取 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    // 使用代理主机/请求主机作为上游地址
                    }
                ]
            }
        ]
    }
}