Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api具体怎么调用?token怎么获取,module的value分别是什么意思?求一份文档,感谢 #8

Open
specialbiscuit opened this issue Dec 28, 2021 · 10 comments

Comments

@specialbiscuit
Copy link

api具体怎么调用?token怎么获取,module的value分别是什么意思?求一份文档,感谢

@specialbiscuit
Copy link
Author

@wushengyeyouya 大佬,帮忙解决下这个问题

@specialbiscuit
Copy link
Author

能知道怎么调用就行

@specialbiscuit
Copy link
Author

目前我的调用方式需要调用到5个服务:请求发起 -> /tokenQuery (没有拿到token) -> /execute/query_user(我的服务path, token直接数据库取得) -> /93/get (获取任务状态, status为Suucess就继续下一步) -> /getDirFileTrees(获取到path路径,为下一步提供入参) -> /openFile (获取结果) -> 请求结束。 不知道是不是这样,如果是这样,感觉调用一个服务要走这么多接口吗,还是说我理解错了,求大佬帮助

@specialbiscuit
Copy link
Author

楼上的 /execute/query_user操作,会经常性的返回status为Failed的结果,我对比了DSS后台的查询方式,看到了/get请求要反复查询的,这个对于外部系统没法这样调用,请问有别的调用方式吗

@liuyou2
Copy link
Contributor

liuyou2 commented Jan 4, 2022

Data service token from/queryById? Interface returns (page clicks into use), field is userToken. Access to all interfaces is GateWay certified. The token of a data service can only be used for the management process of a data service. Authentication using postman requires either cookies on the page or secret key authentication using linkis-gateway. Add Token-Code: XXX to the headThis specifies the login key for linkis-gateway Token-User: XXX This specifies the login user for linkis-gateway.

@specialbiscuit
Copy link
Author

Data service token from/queryById? Interface returns (page clicks into use), field is userToken. Access to all interfaces is GateWay certified. The token of a data service can only be used for the management process of a data service. Authentication using postman requires either cookies on the page or secret key authentication using linkis-gateway. Add Token-Code: XXX to the headThis specifies the login key for linkis-gateway Token-User: XXX This specifies the login user for linkis-gateway.

I did it according to this step, and also called execute/{path:*}, but in the step of {id}/get, the status returned was FAILED

@specialbiscuit
Copy link
Author

/openFile

Data service token from/queryById? Interface returns (page clicks into use), field is userToken. Access to all interfaces is GateWay certified. The token of a data service can only be used for the management process of a data service. Authentication using postman requires either cookies on the page or secret key authentication using linkis-gateway. Add Token-Code: XXX to the headThis specifies the login key for linkis-gateway Token-User: XXX This specifies the login user for linkis-gateway.

If I want to get the result set, do I have to call 5 interfaces, namely /tokenQuery, /execute/{path:*}, /{id}/get, /getDirFileTrees and /openFile, is this calling method correct?

@specialbiscuit
Copy link
Author

path: {id}/get
result:
{ "method": "/api/dss/apiservice/{id}/get", "status": 0, "message": "OK", "data": { "task": { "taskID": 93, "instance": "DEV-Hadoop-CDH-Node1:29104", "execId": "IDE_root_spark_27", "umUser": "root", "engineInstance": null, "executionCode": "import org.apache.spark.sql.DataFrame\nval executeCode = \"\"\"select * from jyh_ind.s_user_hive where id = ${id} limit 1\n\"\"\"\nval df = sqlContext.sql(executeCode)\nshow(df)\n", "progress": "1.0", "logPath": "hdfs:///tmp/linkis/root/log/IDE/2022-01-04/93.log", "resultLocation": null, "status": "Failed", "engineType": "spark", "errCode": null, "errDesc": null, "executeApplicationName": "spark", "requestApplicationName": "IDE", "runType": "scala", "paramsJson": "{\"configuration\":{\"runtime\":{\"wds.linkis.resultSet.store.path\":\"hdfs:///tmp/linkis/root/linkis/20220104_153226/IDE/93\",\"source\":{\"DSS-ApiService\":\"file:///appcom/linkis/root/show/select_02.sql\",\"requestIP\":\"10.168.10.50\"},\"job\":{\"resultsetIndex\":0,\"#rt_rs_store_path\":\"hdfs:///tmp/linkis/root/linkis/20220104_153226/IDE/93\"}}},\"variable\":{\"ApiServiceToken\":\"eyJhbGciOiJIUzI1NiJ9.eyJ0b2tlbkRldGFpbCI6eyJhcHBseVVzZXIiOiJyb290IiwiYXBwbHlUaW1lIjoxNjQxMjc4OTM0MDU0LCJhcGlTZXJ2aWNlSWQiOjEsInB1Ymxpc2hlciI6InJvb3QifSwiZXhwIjoxNjcyODE0OTM0LCJpYXQiOjE2NDEyNzg5MzR9.fB5QYqsfMiUzKQJXNYAmNkMGYPQjB9-sJDNwuLYDbqQ\",\"id\":1}}", "costTime": 0, "strongerExecId": "exec_id018026linkis-cg-entranceDEV-Hadoop-CDH-Node1:29104IDE_root_spark_27", "sourceJson": "{\"DSS-ApiService\":\"file:///appcom/linkis/root/show/select_02.sql\",\"requestIP\":\"10.168.10.50\"}", "sourceTailor": "file:///appcom/linkis/root/show/select_02.sql-10.168.10.50", "labels": null, "subJobs": null } } }

@wushengyeyouya
Copy link
Contributor

Please use execId to call Linkis Java SDK or RestAPI to fetch result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@liuyou2 @specialbiscuit @wushengyeyouya and others