Skip to content
Kapten
Esc
↑↓navigate↵open⌘Jpreview

Reorder pipeline stages

Sets the order in which a pipeline’s stages run, in one change. The request lists every stage of the pipeline exactly once.

PUT/project/{project_id}/environment/{environment_id}/pipelines/{pipeline_id}/stages/reorder
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT token passed in the Authorization header using the Bearer <token> format.

Path parameters
project_iduuidrequired

The unique identifier for the project

environment_iduuidrequired

The unique identifier of the environment

pipeline_iduuidrequired

The unique identifier for the pipeline

Request body
requiredapplication/json
stagesreorder_pipeline_stage_item[]required
min items 1
Show properties
Array of reorder_pipeline_stage_item
stage_iduuidrequired

A universally unique identifier (UUID) string

execution_orderintegerrequired
min 1
Responses
200

Pipeline stages reordered successfully

Array of pipeline_stage
iduuidrequired

A universally unique identifier (UUID) string

pipeline_iduuidrequired

A universally unique identifier (UUID) string

namestringrequired
descriptionstring
execution_orderintegerrequired
on_failurepipeline_stage_failure_policyrequired

Describes how the pipeline should behave after a stage failure.

Allowed:STOP_PIPELINECONTINUE_PIPELINE
componentspipeline_stage_component[]required
Show properties
Array of pipeline_stage_component
iduuidrequired

A universally unique identifier (UUID) string

stage_iduuidrequired

A universally unique identifier (UUID) string

component_iduuidrequired

A universally unique identifier (UUID) string

component_kindcomponent_kindrequired

Component kind for component-scoped variables

Allowed:KjobKApplicationKHelmKDatabase
is_requiredbooleanrequired
timeout_secondsinteger | null
created_atstring<date-time>required
created_atstring<date-time>required
updated_atstring<date-time>required
default

Error

codeinteger<int32>required
messagestringrequired
reasonstring

Optional stable machine-readable reason for programmatic error handling

Request
curl -X PUT 'https://api.kapten.io/project/497f6eca-6276-4993-bfeb-53cbbbba6f08/environment/497f6eca-6276-4993-bfeb-53cbbbba6f08/pipelines/497f6eca-6276-4993-bfeb-53cbbbba6f08/stages/reorder' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "stages": [
    {
      "stage_id": "f38d2b9c-0a0a-4eea-91a8-e974413bb670",
      "execution_order": 1
    }
  ]
}'
Response
[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
    "name": "string",
    "description": "string",
    "execution_order": 0,
    "on_failure": "STOP_PIPELINE",
    "components": [
      {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "stage_id": "f38d2b9c-0a0a-4eea-91a8-e974413bb670",
        "component_id": "41afafe5-2a48-424a-baef-34c2ad44ef7b",
        "component_kind": "Kjob",
        "is_required": true,
        "timeout_seconds": 0,
        "created_at": "2019-08-24T14:15:22Z"
      }
    ],
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
]

Was this page helpful?