{
  "tags": [
    "四层转发"
  ],
  "description": "获取指定四层转发的完整配置、套餐、线路和任务状态。普通用户仅能查看自己的转发；查询其他用户的转发需要管理员权限。监听、源站和 ACL 等配置字段按数据库原值以 JSON 字符串返回。",
  "operationId": "user_get_v1_streams_stream_id",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "请求已被处理。成功时 `code` 为 0、`msg` 为空字符串、`data` 为转发详情；转发不存在或无权限时仍返回 HTTP 200。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "code",
              "msg",
              "data"
            ],
            "properties": {
              "code": {
                "type": "integer",
                "description": "业务状态码；成功为 0。",
                "example": 0
              },
              "msg": {
                "type": "string",
                "description": "成功时为空字符串，失败时为错误说明。",
                "example": ""
              },
              "data": {
                "type": "object",
                "description": "四层转发详情。配置字段为 JSON 字符串。",
                "required": [
                  "id",
                  "uid",
                  "listen",
                  "backend",
                  "enable",
                  "stream_state"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "转发 ID。"
                  },
                  "uid": {
                    "type": "integer",
                    "description": "归属用户 ID。"
                  },
                  "name": {
                    "type": "string",
                    "description": "归属用户名。"
                  },
                  "des": {
                    "type": "string",
                    "description": "转发备注。"
                  },
                  "listen": {
                    "type": "string",
                    "description": "监听配置 JSON 字符串。"
                  },
                  "backend": {
                    "type": "string",
                    "description": "源站配置 JSON 字符串。"
                  },
                  "backend_port": {
                    "type": "integer",
                    "description": "回源端口。"
                  },
                  "balance_way": {
                    "type": "string",
                    "description": "负载均衡方式。"
                  },
                  "proxy_protocol": {
                    "type": "integer",
                    "description": "是否启用 PROXY protocol。"
                  },
                  "conn_limit": {
                    "type": "integer",
                    "nullable": true,
                    "description": "连接数限制。"
                  },
                  "acl": {
                    "type": "string",
                    "nullable": true,
                    "description": "访问控制配置 JSON 字符串。"
                  },
                  "block_region": {
                    "type": "string",
                    "description": "地域拦截配置。"
                  },
                  "enable": {
                    "type": "integer",
                    "enum": [
                      0,
                      1
                    ],
                    "description": "是否启用。"
                  },
                  "stream_state": {
                    "type": "string",
                    "description": "转发自身状态。"
                  },
                  "sync_state": {
                    "type": "string",
                    "nullable": true,
                    "description": "同步任务状态。"
                  },
                  "task_id": {
                    "type": "integer",
                    "nullable": true,
                    "description": "同步任务 ID。"
                  },
                  "user_package": {
                    "type": "integer",
                    "description": "用户套餐 ID。"
                  },
                  "package_name": {
                    "type": "string",
                    "description": "用户套餐名称。"
                  },
                  "end_at": {
                    "type": "string",
                    "nullable": true,
                    "description": "套餐到期时间。"
                  },
                  "region_id": {
                    "type": "integer",
                    "description": "区域 ID。"
                  },
                  "region_name": {
                    "type": "string",
                    "description": "区域名称。"
                  },
                  "node_group_id": {
                    "type": "integer",
                    "description": "主线路组 ID。"
                  },
                  "node_group_name": {
                    "type": "string",
                    "description": "主线路组名称。"
                  },
                  "node_group_ipv6": {
                    "type": "integer",
                    "enum": [
                      0,
                      1
                    ],
                    "description": "主线路组是否有 IPv6 节点。"
                  },
                  "backup_node_group": {
                    "type": "integer",
                    "nullable": true,
                    "description": "备用线路组 ID。"
                  },
                  "backup_node_group_name": {
                    "type": "string",
                    "nullable": true,
                    "description": "备用线路组名称。"
                  },
                  "enable_backup_group": {
                    "type": "integer",
                    "description": "是否启用备用线路组。"
                  },
                  "enable_ipv6": {
                    "type": "integer",
                    "description": "是否启用 IPv6。"
                  },
                  "cname_mode": {
                    "type": "string",
                    "description": "CNAME 使用方式。"
                  },
                  "cname_hostname": {
                    "type": "string",
                    "description": "CNAME 主机名。"
                  },
                  "cname_domain": {
                    "type": "string",
                    "nullable": true,
                    "description": "转发 CNAME 域名。"
                  },
                  "up_cname_domain": {
                    "type": "string",
                    "nullable": true,
                    "description": "套餐 CNAME 域名。"
                  },
                  "up_cname_hostname": {
                    "type": "string",
                    "nullable": true,
                    "description": "套餐 CNAME 主机名。"
                  },
                  "cname_task_id": {
                    "type": "integer",
                    "nullable": true,
                    "description": "CNAME 任务 ID。"
                  },
                  "cname_state": {
                    "type": "string",
                    "nullable": true,
                    "description": "CNAME 任务状态。"
                  },
                  "groups": {
                    "type": "string",
                    "nullable": true,
                    "description": "关联转发组 ID 的逗号分隔字符串。"
                  },
                  "create_at2": {
                    "type": "string",
                    "description": "创建时间。"
                  },
                  "update_at2": {
                    "type": "string",
                    "description": "更新时间。"
                  },
                  "version": {
                    "type": "integer",
                    "description": "配置版本号。"
                  }
                }
              }
            }
          },
          "examples": {
            "success": {
              "summary": "查询成功",
              "value": {
                "code": 0,
                "msg": "",
                "data": {
                  "id": 101,
                  "uid": 12,
                  "listen": "[{\"port\":443,\"protocol\":\"tcp\"}]",
                  "backend": "[{\"addr\":\"198.51.100.10\",\"weight\":1,\"state\":\"up\"}]",
                  "enable": 1,
                  "stream_state": "done"
                }
              }
            },
            "notFound": {
              "summary": "转发不存在",
              "value": {
                "code": "stream-58",
                "msg": "转发不存在",
                "data": ""
              }
            }
          },
          "example": {
            "code": 0,
            "msg": "",
            "data": {
              "id": 101,
              "uid": 12,
              "listen": "[{\"port\":443,\"protocol\":\"tcp\"}]",
              "backend": "[{\"addr\":\"198.51.100.10\",\"weight\":1,\"state\":\"up\"}]",
              "enable": 1,
              "stream_state": "done"
            }
          }
        }
      }
    }
  },
  "x-python-handler": "stream.StreamAPI",
  "x-python-route-line": 638,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [
    {
      "name": "stream_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "integer",
        "minimum": 1,
        "example": 101
      },
      "description": "要查询的四层转发 ID；必须存在且当前用户有权限查看。"
    }
  ],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "stream.StreamAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 638
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "user"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "get",
  "path": "/v1/streams/{stream_id}",
  "servers": [
    {
      "url": "https://master.example.invalid",
      "description": "不可调用的示例地址；复制示例后替换为自己的主控域名。"
    }
  ],
  "securitySchemes": {
    "AccessToken": {
      "type": "apiKey",
      "in": "header",
      "name": "access-token",
      "description": "通过登录接口获得的短期访问令牌。"
    },
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "api-key",
      "description": "API Key；必须和 api-secret 同时发送。"
    },
    "ApiSecret": {
      "type": "apiKey",
      "in": "header",
      "name": "api-secret",
      "description": "API Secret；必须和 api-key 同时发送。"
    }
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "获取四层转发详情",
    "description": {
      "content": "获取指定四层转发的完整配置、套餐、线路和任务状态。普通用户仅能查看自己的转发；查询其他用户的转发需要管理员权限。监听、源站和 ACL 等配置字段按数据库原值以 JSON 字符串返回。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "streams",
        ":stream_id"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": [
        {
          "disabled": false,
          "description": {
            "content": "(Required) 要查询的四层转发 ID；必须存在且当前用户有权限查看。",
            "type": "text/plain"
          },
          "type": "any",
          "value": "",
          "key": "stream_id"
        }
      ]
    },
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "method": "GET",
    "auth": {
      "type": "apikey",
      "apikey": [
        {
          "type": "any",
          "value": "access-token",
          "key": "key"
        },
        {
          "type": "any",
          "value": "{{apiKey}}",
          "key": "value"
        },
        {
          "type": "any",
          "value": "header",
          "key": "in"
        }
      ]
    }
  }
}