跳到主要内容

算盘 SDK 约定

对象存储路径约定

对象存储路径在 python sdk 中以 storage.getKeyIn... 的接口获取,getKeyInApp... 得到 APP (模板)相关路径,getKeyInNode... 得到 Node (节点)相关路径。

全局共享路径

用于特殊业务需求下文件全局共享,存储路径: studio/global/

!!! info "提示"

python sdk 接口: storage.getKeyInGlobalStore(*paths)

用户路径

User 路径: studio/{user_id}/

组件路径

Component 路径: studio/{user_id}/component/{component_id}/

APP 路径

APP 路径: studio/{user_id}/{app_id}/

!!! info "提示"

python sdk 接口: storage.getKeyInAppStore(*paths)

Node 路径

APP 路径: studio/{user_id}/{app_id}/{node_id}/

!!! info "提示"

python sdk 接口: storage.getKeyInNodeStore(*paths)

Port 路径

APP 路径: studio/{user_id}/{app_id}/{node_id}/{port_id}

日志路径

Logs 路径: studio/{user_id}/logs/

APP Logs 路径: studio/{user_id}/logs/{app_id}/

!!! info "提示"

python sdk 接口: storage.getKeyInAppLogsStore(*paths)

Node Logs 路径: studio/{user_id}/logs/{app_id}/{node_id}/

!!! info "提示"

python sdk 接口: storage.getKeyInNodeLogsStore(*paths)

临时文件路径(可以针对不同层级直接删除文件夹)

APP 临时文件路径: studio/{user_id}/tmp/{app_id}/

!!! info "提示"

python sdk 接口: storage.getKeyInAppTmpStore(requestID, *paths)

Node 临时文件路径: studio/{user_id}/tmp/{app_id}/{request_id}/{node_id}/

!!! info "提示"

python sdk 接口: storage.getKeyInNodeTmpStore(requestID, *paths)

Port 临时文件路径: studio/{user_id}/tmp/{app_id}/{request_id}/{node_id}/{port_id}/

持久文件路径

APP 持久文件路径: studio/{user_id}/share/{app_id}/{component_alias}/

!!! info "提示"

python sdk 接口: storage.getKeyInAppDataStore(*paths)

Node 持久文件路径: studio/{user_id}/share/{app_id}/{node_id}/{component_alias}/

!!! info "提示"

python sdk 接口: storage.getKeyInNodeDataStore(*paths)

Port 持久文件路径: studio/{user_id}/share/{app_id}/{node_id}/{port_id}/{component_alias}/

配置文件路径(边缘部署同步此文件夹)

APP 配置文件路径: studio/{user_id}/configs/{app_id}/

!!! info "提示"

python sdk 接口: storage.getKeyInAppConfigsStore(*paths)

Node 配置文件路径: studio/{user_id}/configs/{app_id}/{node_id}/

!!! info "提示"

python sdk 接口: storage.getKeyInNodeConfigsStore(*paths)

Port 配置文件路径: studio/{user_id}/configs/{app_id}/{node_id}/{port_id}/

前面板静态文件路径(边缘部署同步此文件夹)

APP 配置文件路径: studio/{user_id}/dashboard/{app_id}/

本地文件路径约定

本地文件即容器内组件程序能读取的文件路径,sdk 从对象存储下载文件之后会按如下约定存到对应文件夹。

本地文件存储路径在 python sdk 中以 storage.getPathIn... 的接口获取,getPathInApp... 得到 APP (模板)相关路径,getPathInNode... 得到 Node (节点)相关路径。

临时文件路径(用于与对象存储文件对应)

临时文件路径: /suanpan

例如: studio/{user_id}/data/{app_id}/ -> /suanpan/studio/{user_id}/data/{app_id}/

Tips: 临时文件路径由算盘配置,通过 storage 参数传递

全局文件路径(仅针对私有化部署)

全局文件路径: /global/

全局持久文件路径: /global/data/

全局配置文件路径: /global/configs/

Tips: 临时文件路径由算盘配置,通过 storage 参数传递