본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

API 예제 (API Examples)

원문 보기 위키 갱신

이 문서에는 argo-server REST API를 통해 제출할 수 있는 워크플로 JSON 예제 몇 가지가 들어 있습니다.

v2.5 이상

출처: Argo Workflows 문서

본문

다음을 가정합니다:

  • argo-server의 네임스페이스는 argo입니다
  • 인증이 꺼져 있습니다(그렇지 않다면 Authorization 헤더를 제공하세요)
  • argo-server는 localhost:2746에서 접근 가능합니다

워크플로 제출 (Submitting workflow)

curl --request POST \
  --url https://localhost:2746/api/v1/workflows/argo \
  --header 'content-type: application/json' \
  --data '{
  "namespace": "argo",
  "serverDryRun": false,
  "workflow": {
      "metadata": {
        "generateName": "hello-world-",
        "namespace": "argo",
        "labels": {
          "workflows.argoproj.io/completed": "false"
         }
      },
     "spec": {
       "templates": [
        {
         "name": "hello-world",
         "arguments": {},
         "inputs": {},
         "outputs": {},
         "metadata": {},
         "container": {
          "name": "",
          "image": "busybox",
          "command": [
            "echo"
          ],
          "args": [
            "hello world"
          ],
          "resources": {}
        }
      }
    ],
    "entrypoint": "hello-world",
    "arguments": {}
  }
}
}'

네임스페이스 argo의 워크플로 조회 (Getting workflows for namespace argo)

curl --request GET \
  --url https://localhost:2746/api/v1/workflows/argo

네임스페이스 argo의 단일 워크플로 조회 (Getting single workflow for namespace argo)

curl --request GET \
  --url https://localhost:2746/api/v1/workflows/argo/abc-dthgt

네임스페이스 argo의 단일 워크플로 삭제 (Deleting single workflow for namespace argo)

curl --request DELETE \
  --url https://localhost:2746/api/v1/workflows/argo/abc-dthgt

더 알아보기 (Learn more)

  • 워크플로 제출은 /api/v1/workflows/{namespace}로 POST하며, 본문에 namespace와 workflow 객체를 담습니다.
  • 인증이 켜져 있다면 Authorization 헤더에 베어러 토큰을 넣어야 합니다.
  • 조회·삭제는 같은 경로에서 HTTP 메서드(GET/DELETE)만 바꿔 사용합니다.