tds获取任务的目录树

  其他常见问题
内容纲要

概要描述


本文主要介绍如何通过api接口 / 元数据sql,获取加载/调度任务的目录树。

详细说明


解决方案


API方式:

1. getTestToken
  • 使用登录foundation-gateway页面的用户名密码作为userNamepassword
curl -X POST "https://kv4:28190/studio/api/auth/v1/token/getTestToken" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"clientId\":\"app\",\"clientSecret\":\"secret\",\"password\":\"admin\",\"userName\":\"admin\"}"

file

2. 查询加载任务的uuid
select unique_id,t.* from tdt_solution t where name = 'testlkw01';

file

3. 使用前面的token和uuid带入到下面的接口中
  • 使用step1获取的token代入到下面的 Authorization 部分 (Bearer加空格的后面)
  • 使用step2获取的unique_id代入到下面的 -d 部分
curl -X POST "https://kv4:28190/studio/api/navigator/v1/common/getPathByUuid?noWorkspacePath=false" -H "accept: application/json" -H "Authorization: Bearer 8177ee8b-88bb-40c4-8a72-d7a45871aebb" -H "Content-Type: application/json" -d "[\"efc8c17eb1dc4a9fa2fbd5eeaf4a48a8\"]"

file

即可得到完整的path。

SQL方式:

以如下任务流目录树为例:

file

WITH RECURSIVE cte AS (
    SELECT uuid, name, parent_uuid,name AS full_path FROM workflow_workflow1.navigator_navigation  WHERE name='任务流a' and category='WORKFLOW' 
    UNION ALL
    SELECT t.uuid, t.name, t.parent_uuid ,CONCAT(t.name,'/',cte.full_path ) AS full_path FROM  workflow_workflow1.navigator_navigation t
    JOIN cte
    ON t.uuid = cte.parent_uuid
)
SELECT *  FROM cte 
where parent_uuid='-';

file

这篇文章对您有帮助吗?

平均评分 0 / 5. 次数: 0

尚无评价,您可以第一个评哦!

非常抱歉,这篇文章对您没有帮助.

烦请您告诉我们您的建议与意见,以便我们改进,谢谢您。