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/v1/job/watch/api/v1/job/watch没有返回结果 #386

Open
PlanetAndMars opened this issue Jul 19, 2024 · 9 comments
Open

请求/api/v1/job/watch/api/v1/job/watch没有返回结果 #386

PlanetAndMars opened this issue Jul 19, 2024 · 9 comments

Comments

@PlanetAndMars
Copy link

PlanetAndMars commented Jul 19, 2024

Issue Type

Api Usage

Search for existing issues similar to yours

No

Kuscia Version

0.7.0b0

Link to Relevant Documentation

No response

Question Details

通Curl命令请求kusciaAPI /api/v1/job/watch 未得到返回结果

image

@wangzul
Copy link
Contributor

wangzul commented Jul 22, 2024

你需要添加参数 job_id
job_id 可在pad执行[记录结果]获取 ------- 或通过kuscia容器内部kubectl get kj -A name字段获取
curl -k -X POST 'https://localhost:8082/api/v1/job/watch' --header "Token: $(cat ${CTR_CERTS_ROOT}/token)" --header 'Content-Type: application/json' --cert ${CTR_CERTS_ROOT}/kusciaapi-server.crt --key ${CTR_CERTS_ROOT}/kusciaapi-server.key --cacert ${CTR_CERTS_ROOT}/ca.crt -d '{
"job_id": "czcs"
}'

@PlanetAndMars
Copy link
Author

你需要添加参数 job_id job_id 可在pad执行[记录结果]获取 ------- 或通过kuscia容器内部kubectl get kj -A name字段获取 curl -k -X POST 'https://localhost:8082/api/v1/job/watch' --header "Token: (cat{CTR_CERTS_ROOT}/token)" --header 'Content-Type: application/json' --cert ${CTR_CERTS_ROOT}/kusciaapi-server.crt --key ${CTR_CERTS_ROOT}/kusciaapi-server.key --cacert ${CTR_CERTS_ROOT}/ca.crt -d '{ "job_id": "czcs" }'

image
官方文档里没有提到要加job_id,
并且加了JobId仍然掉不通
image

@wangzul
Copy link
Contributor

wangzul commented Jul 22, 2024

你需要添加参数 job_id job_id 可在pad执行[记录结果]获取 ------- 或通过kuscia容器内部kubectl get kj -A name字段获取 curl -k -X POST 'https://localhost:8082/api/v1/job/watch' --header "Token: (cat{CTR_CERTS_ROOT}/token)" --header 'Content-Type: application/json' --cert ${CTR_CERTS_ROOT}/kusciaapi-server.crt --key ${CTR_CERTS_ROOT}/kusciaapi-server.key --cacert ${CTR_CERTS_ROOT}/ca.crt -d '{ "job_id": "czcs" }'

image 官方文档里没有提到要加job_id, 并且加了JobId仍然掉不通 image

方便将你输入的命令curl 提供一下吗?

@PlanetAndMars
Copy link
Author

我执行的命令如下:
curl -k -X POST 'https://localhost:8082/api/v1/job/watch' --header "Token: (cat{CTR_CERTS_ROOT}/token)" --header 'Content-Type: application/json' --cert ${CTR_CERTS_ROOT}/kusciaapi-server.crt --key ${CTR_CERTS_ROOT}/kusciaapi-server.key --cacert ${CTR_CERTS_ROOT}/ca.crt -d '{ "job_id": "cwhj" }'

@PlanetAndMars
Copy link
Author

我执行的命令如下:
curl -k -X POST 'https://localhost:8082/api/v1/job/watch' --header "Token: (cat{CTR_CERTS_ROOT}/token)" --header 'Content-Type: application/json' --cert ${CTR_CERTS_ROOT}/kusciaapi-server.crt --key ${CTR_CERTS_ROOT}/kusciaapi-server.key --cacert ${CTR_CERTS_ROOT}/ca.crt -d '{ "job_id": "cwhj" }'

我执行的命令如下:
curl -k -X POST 'https://localhost:8082/api/v1/job/watch' --header "Token: (cat{CTR_CERTS_ROOT}/token)" --header 'Content-Type: application/json' --cert ${CTR_CERTS_ROOT}/kusciaapi-server.crt --key ${CTR_CERTS_ROOT}/kusciaapi-server.key --cacert ${CTR_CERTS_ROOT}/ca.crt -d '{ "job_id": "cwhj" }'

@wangzul
Copy link
Contributor

wangzul commented Jul 31, 2024

ca.crt

可以尝试通过前端页面创建一个任务流并运行,然后在使用这个API命令查询。
需要注意以下问题
1.如果是中心化模式部署则需要在master节点中执行Kuscia API

@PlanetAndMars
Copy link
Author

ca.crt

可以尝试通过前端页面创建一个任务流并运行,然后在使用这个API命令查询。 需要注意以下问题 1.如果是中心化模式部署则需要在master节点中执行Kuscia API

是点对点模式部署的,就用通过前端页面创建的,用这个API查询的呀

@wangzul
Copy link
Contributor

wangzul commented Jul 31, 2024

我执行的命令如下:
curl -k -X POST 'https://localhost:8082/api/v1/job/watch' --header "Token: (cat{CTR_CERTS_ROOT}/token)" --header 'Content-Type: application/json' --cert ${CTR_CERTS_ROOT}/kusciaapi-server.crt --key ${CTR_CERTS_ROOT}/kusciaapi-server.key --cacert ${CTR_CERTS_ROOT}/ca.crt -d '{ "job_id": "cwhj" }'

我执行的命令如下: curl -k -X POST 'https://localhost:8082/api/v1/job/watch' --header "Token: (cat{CTR_CERTS_ROOT}/token)" --header 'Content-Type: application/json' --cert ${CTR_CERTS_ROOT}/kusciaapi-server.crt --key ${CTR_CERTS_ROOT}/kusciaapi-server.key --cacert ${CTR_CERTS_ROOT}/ca.crt -d '{ "job_id": "cwhj" }'

1.你的命令中cat{CTR_CERTS_ROOT}/token) 少些了一个$应该是正确的命令应该是
curl -k -X POST 'https://localhost:8082/api/v1/job/watch' --header "Token: $(cat ${CTR_CERTS_ROOT}/token)" --header 'Content-Type: application/json' --cert ${CTR_CERTS_ROOT}/kusciaapi-server.crt --key ${CTR_CERTS_ROOT}/kusciaapi-server.key --cacert ${CTR_CERTS_ROOT}/ca.crt -d '{}'
2. 查看了api发现对于watch来说不需要传递任何参数-d '{}' 就可以。

@wangzul
Copy link
Contributor

wangzul commented Jul 31, 2024

我执行的命令如下:
curl -k -X POST 'https://localhost:8082/api/v1/job/watch' --header "Token: (cat{CTR_CERTS_ROOT}/token)" --header 'Content-Type: application/json' --cert ${CTR_CERTS_ROOT}/kusciaapi-server.crt --key ${CTR_CERTS_ROOT}/kusciaapi-server.key --cacert ${CTR_CERTS_ROOT}/ca.crt -d '{ "job_id": "cwhj" }'

我执行的命令如下: curl -k -X POST 'https://localhost:8082/api/v1/job/watch' --header "Token: (cat{CTR_CERTS_ROOT}/token)" --header 'Content-Type: application/json' --cert ${CTR_CERTS_ROOT}/kusciaapi-server.crt --key ${CTR_CERTS_ROOT}/kusciaapi-server.key --cacert ${CTR_CERTS_ROOT}/ca.crt -d '{ "job_id": "cwhj" }'

1.你的命令中cat{CTR_CERTS_ROOT}/token) 少些了一个$应该是正确的命令应该是 curl -k -X POST 'https://localhost:8082/api/v1/job/watch' --header "Token: (cat{CTR_CERTS_ROOT}/token)" --header 'Content-Type: application/json' --cert ${CTR_CERTS_ROOT}/kusciaapi-server.crt --key ${CTR_CERTS_ROOT}/kusciaapi-server.key --cacert ${CTR_CERTS_ROOT}/ca.crt -d '{}' 2. 查看了api发现对于watch来说不需要传递任何参数-d '{}' 就可以。

补充一下关于API请求可以通过/home/kuscia/var/logs/kusciaapi.log来查看日志信息。

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

2 participants