更新时间:2026-01-06 GMT+08:00
分享

关闭Session

  • 功能介绍:关闭一个指定的Session,用户需提供工作空间id和需要关闭Session的ID。
  • 方法定义:closeSession(workspaceId, sessionId, timeout)
  • 参数说明:
    表1 closeSession参数说明

    参数名称

    参数类型

    是否必选

    描述

    workspaceId

    str

    必选

    用户创建的Fabric的工作空间的ID。

    sessionId

    str

    必选

    指定要关闭Session的ID。

    timeout

    float

    可选

    请求超时时间。

  • 响应体说明:空响应体Response
  • 示例代码:
import os
from fabricsql.SQLClient import FabricSQLClient
from fabricsql.SQLRequests import SessionRequest, QueryRequest
if __name__ == "__main__":
    # AK/SK属于敏感信息,推荐通过环境变量方式获取,避免直接明文编码在程序中
    endpoint = 'xxxxxxxxxxxxxx'
    accessKey = 'xxxxxxxxxxxxxx'
    secretKey = 'xxxxxxxxxxxxxxx'
    workspace_id = 'xxxxxxxxxxxxx'
    client = FabricSQLClient(endpoint, accessKey, secretKey)
    session_id = 'xxxxxxxxxxx'
    response = client.closeSession(workspace_id, session_id)

相关文档