Skip to content

Commit 977d2fa

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add running pipelines on custom pipelines API (#2266)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent efcc8c0 commit 977d2fa

File tree

25 files changed

+848
-334
lines changed

25 files changed

+848
-334
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-12-10 17:29:08.319276",
8-
"spec_repo_commit": "f35e3502"
7+
"regenerated": "2024-12-10 19:50:09.732319",
8+
"spec_repo_commit": "5da0cd35"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-12-10 17:29:08.337320",
13-
"spec_repo_commit": "f35e3502"
12+
"regenerated": "2024-12-10 19:50:09.751594",
13+
"spec_repo_commit": "5da0cd35"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 188 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -3259,6 +3259,183 @@ components:
32593259
tags:
32603260
$ref: '#/components/schemas/TagsEventAttribute'
32613261
type: object
3262+
CIAppPipelineEventFinishedPipeline:
3263+
description: Details of a finished pipeline.
3264+
properties:
3265+
end:
3266+
description: Time when the pipeline run finished. It cannot be older than
3267+
18 hours in the past from the current time. The time format must be RFC3339.
3268+
example: '2023-05-31T15:30:00Z'
3269+
format: date-time
3270+
type: string
3271+
error:
3272+
$ref: '#/components/schemas/CIAppCIError'
3273+
git:
3274+
$ref: '#/components/schemas/CIAppGitInfo'
3275+
is_manual:
3276+
description: Whether or not the pipeline was triggered manually by the user.
3277+
example: false
3278+
nullable: true
3279+
type: boolean
3280+
is_resumed:
3281+
description: Whether or not the pipeline was resumed after being blocked.
3282+
example: false
3283+
nullable: true
3284+
type: boolean
3285+
level:
3286+
$ref: '#/components/schemas/CIAppPipelineEventPipelineLevel'
3287+
metrics:
3288+
$ref: '#/components/schemas/CIAppPipelineEventMetrics'
3289+
name:
3290+
description: Name of the pipeline. All pipeline runs for the builds should
3291+
have the same name.
3292+
example: Deploy to AWS
3293+
type: string
3294+
node:
3295+
$ref: '#/components/schemas/CIAppHostInfo'
3296+
parameters:
3297+
$ref: '#/components/schemas/CIAppPipelineEventParameters'
3298+
parent_pipeline:
3299+
$ref: '#/components/schemas/CIAppPipelineEventParentPipeline'
3300+
partial_retry:
3301+
description: 'Whether or not the pipeline was a partial retry of a previous
3302+
attempt. A partial retry is one
3303+
3304+
which only runs a subset of the original jobs.'
3305+
example: false
3306+
type: boolean
3307+
pipeline_id:
3308+
description: 'Any ID used in the provider to identify the pipeline run even
3309+
if it is not unique across retries.
3310+
3311+
If the `pipeline_id` is unique, then both `unique_id` and `pipeline_id`
3312+
can be set to the same value.'
3313+
example: '#023'
3314+
type: string
3315+
previous_attempt:
3316+
$ref: '#/components/schemas/CIAppPipelineEventPreviousPipeline'
3317+
queue_time:
3318+
description: The queue time in milliseconds, if applicable.
3319+
example: 1004
3320+
format: int64
3321+
minimum: 0
3322+
nullable: true
3323+
type: integer
3324+
start:
3325+
description: Time when the pipeline run started (it should not include any
3326+
queue time). The time format must be RFC3339.
3327+
example: '2023-05-31T15:30:00Z'
3328+
format: date-time
3329+
type: string
3330+
status:
3331+
$ref: '#/components/schemas/CIAppPipelineEventPipelineStatus'
3332+
tags:
3333+
$ref: '#/components/schemas/CIAppPipelineEventTags'
3334+
unique_id:
3335+
description: 'UUID of the pipeline run. The ID has to be unique across retries
3336+
and pipelines,
3337+
3338+
including partial retries.'
3339+
example: 3eacb6f3-ff04-4e10-8a9c-46e6d054024a
3340+
type: string
3341+
url:
3342+
description: The URL to look at the pipeline in the CI provider UI.
3343+
example: https://my-ci-provider.example/pipelines/my-pipeline/run/1
3344+
type: string
3345+
required:
3346+
- level
3347+
- unique_id
3348+
- name
3349+
- url
3350+
- start
3351+
- end
3352+
- status
3353+
- partial_retry
3354+
type: object
3355+
CIAppPipelineEventInProgressPipeline:
3356+
description: Details of a running pipeline.
3357+
properties:
3358+
error:
3359+
$ref: '#/components/schemas/CIAppCIError'
3360+
git:
3361+
$ref: '#/components/schemas/CIAppGitInfo'
3362+
is_manual:
3363+
description: Whether or not the pipeline was triggered manually by the user.
3364+
example: false
3365+
nullable: true
3366+
type: boolean
3367+
is_resumed:
3368+
description: Whether or not the pipeline was resumed after being blocked.
3369+
example: false
3370+
nullable: true
3371+
type: boolean
3372+
level:
3373+
$ref: '#/components/schemas/CIAppPipelineEventPipelineLevel'
3374+
metrics:
3375+
$ref: '#/components/schemas/CIAppPipelineEventMetrics'
3376+
name:
3377+
description: Name of the pipeline. All pipeline runs for the builds should
3378+
have the same name.
3379+
example: Deploy to AWS
3380+
type: string
3381+
node:
3382+
$ref: '#/components/schemas/CIAppHostInfo'
3383+
parameters:
3384+
$ref: '#/components/schemas/CIAppPipelineEventParameters'
3385+
parent_pipeline:
3386+
$ref: '#/components/schemas/CIAppPipelineEventParentPipeline'
3387+
partial_retry:
3388+
description: 'Whether or not the pipeline was a partial retry of a previous
3389+
attempt. A partial retry is one
3390+
3391+
which only runs a subset of the original jobs.'
3392+
example: false
3393+
type: boolean
3394+
pipeline_id:
3395+
description: 'Any ID used in the provider to identify the pipeline run even
3396+
if it is not unique across retries.
3397+
3398+
If the `pipeline_id` is unique, then both `unique_id` and `pipeline_id`
3399+
can be set to the same value.'
3400+
example: '#023'
3401+
type: string
3402+
previous_attempt:
3403+
$ref: '#/components/schemas/CIAppPipelineEventPreviousPipeline'
3404+
queue_time:
3405+
description: The queue time in milliseconds, if applicable.
3406+
example: 1004
3407+
format: int64
3408+
minimum: 0
3409+
nullable: true
3410+
type: integer
3411+
start:
3412+
description: Time when the pipeline run started (it should not include any
3413+
queue time). The time format must be RFC3339.
3414+
example: '2023-05-31T15:30:00Z'
3415+
format: date-time
3416+
type: string
3417+
status:
3418+
$ref: '#/components/schemas/CIAppPipelineEventPipelineInProgressStatus'
3419+
tags:
3420+
$ref: '#/components/schemas/CIAppPipelineEventTags'
3421+
unique_id:
3422+
description: UUID of the pipeline run. The ID has to be the same as the
3423+
finished pipeline.
3424+
example: 3eacb6f3-ff04-4e10-8a9c-46e6d054024a
3425+
type: string
3426+
url:
3427+
description: The URL to look at the pipeline in the CI provider UI.
3428+
example: https://my-ci-provider.example/pipelines/my-pipeline/run/1
3429+
type: string
3430+
required:
3431+
- level
3432+
- unique_id
3433+
- name
3434+
- url
3435+
- start
3436+
- status
3437+
- partial_retry
3438+
type: object
32623439
CIAppPipelineEventJob:
32633440
description: Details of a CI job.
32643441
properties:
@@ -3407,97 +3584,17 @@ components:
34073584
type: object
34083585
CIAppPipelineEventPipeline:
34093586
description: Details of the top level pipeline, build, or workflow of your CI.
3410-
properties:
3411-
end:
3412-
description: Time when the pipeline run finished. It cannot be older than
3413-
18 hours in the past from the current time. The time format must be RFC3339.
3414-
example: '2023-05-31T15:30:00Z'
3415-
format: date-time
3416-
type: string
3417-
error:
3418-
$ref: '#/components/schemas/CIAppCIError'
3419-
git:
3420-
$ref: '#/components/schemas/CIAppGitInfo'
3421-
is_manual:
3422-
description: Whether or not the pipeline was triggered manually by the user.
3423-
example: false
3424-
nullable: true
3425-
type: boolean
3426-
is_resumed:
3427-
description: Whether or not the pipeline was resumed after being blocked.
3428-
example: false
3429-
nullable: true
3430-
type: boolean
3431-
level:
3432-
$ref: '#/components/schemas/CIAppPipelineEventPipelineLevel'
3433-
metrics:
3434-
$ref: '#/components/schemas/CIAppPipelineEventMetrics'
3435-
name:
3436-
description: Name of the pipeline. All pipeline runs for the builds should
3437-
have the same name.
3438-
example: Deploy to AWS
3439-
type: string
3440-
node:
3441-
$ref: '#/components/schemas/CIAppHostInfo'
3442-
parameters:
3443-
$ref: '#/components/schemas/CIAppPipelineEventParameters'
3444-
parent_pipeline:
3445-
$ref: '#/components/schemas/CIAppPipelineEventParentPipeline'
3446-
partial_retry:
3447-
description: 'Whether or not the pipeline was a partial retry of a previous
3448-
attempt. A partial retry is one
3449-
3450-
which only runs a subset of the original jobs.'
3451-
example: false
3452-
type: boolean
3453-
pipeline_id:
3454-
description: 'Any ID used in the provider to identify the pipeline run even
3455-
if it is not unique across retries.
3456-
3457-
If the `pipeline_id` is unique, then both `unique_id` and `pipeline_id`
3458-
can be set to the same value.'
3459-
example: '#023'
3460-
type: string
3461-
previous_attempt:
3462-
$ref: '#/components/schemas/CIAppPipelineEventPreviousPipeline'
3463-
queue_time:
3464-
description: The queue time in milliseconds, if applicable.
3465-
example: 1004
3466-
format: int64
3467-
minimum: 0
3468-
nullable: true
3469-
type: integer
3470-
start:
3471-
description: Time when the pipeline run started (it should not include any
3472-
queue time). The time format must be RFC3339.
3473-
example: '2023-05-31T15:30:00Z'
3474-
format: date-time
3475-
type: string
3476-
status:
3477-
$ref: '#/components/schemas/CIAppPipelineEventPipelineStatus'
3478-
tags:
3479-
$ref: '#/components/schemas/CIAppPipelineEventTags'
3480-
unique_id:
3481-
description: 'UUID of the pipeline run. The ID has to be unique across retries
3482-
and pipelines,
3483-
3484-
including partial retries.'
3485-
example: 3eacb6f3-ff04-4e10-8a9c-46e6d054024a
3486-
type: string
3487-
url:
3488-
description: The URL to look at the pipeline in the CI provider UI.
3489-
example: https://my-ci-provider.example/pipelines/my-pipeline/run/1
3490-
type: string
3491-
required:
3492-
- level
3493-
- unique_id
3494-
- name
3495-
- url
3496-
- start
3497-
- end
3498-
- status
3499-
- partial_retry
3500-
type: object
3587+
oneOf:
3588+
- $ref: '#/components/schemas/CIAppPipelineEventFinishedPipeline'
3589+
- $ref: '#/components/schemas/CIAppPipelineEventInProgressPipeline'
3590+
CIAppPipelineEventPipelineInProgressStatus:
3591+
description: The in progress status of the pipeline.
3592+
enum:
3593+
- running
3594+
example: running
3595+
type: string
3596+
x-enum-varnames:
3597+
- RUNNING
35013598
CIAppPipelineEventPipelineLevel:
35023599
default: pipeline
35033600
description: Used to distinguish between pipelines, stages, jobs, and steps.

docs/datadog_api_client.v2.model.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,20 @@ datadog\_api\_client.v2.model.ci\_app\_pipeline\_event\_attributes module
14741474
:members:
14751475
:show-inheritance:
14761476

1477+
datadog\_api\_client.v2.model.ci\_app\_pipeline\_event\_finished\_pipeline module
1478+
---------------------------------------------------------------------------------
1479+
1480+
.. automodule:: datadog_api_client.v2.model.ci_app_pipeline_event_finished_pipeline
1481+
:members:
1482+
:show-inheritance:
1483+
1484+
datadog\_api\_client.v2.model.ci\_app\_pipeline\_event\_in\_progress\_pipeline module
1485+
-------------------------------------------------------------------------------------
1486+
1487+
.. automodule:: datadog_api_client.v2.model.ci_app_pipeline_event_in_progress_pipeline
1488+
:members:
1489+
:show-inheritance:
1490+
14771491
datadog\_api\_client.v2.model.ci\_app\_pipeline\_event\_job module
14781492
------------------------------------------------------------------
14791493

@@ -1516,6 +1530,13 @@ datadog\_api\_client.v2.model.ci\_app\_pipeline\_event\_pipeline module
15161530
:members:
15171531
:show-inheritance:
15181532

1533+
datadog\_api\_client.v2.model.ci\_app\_pipeline\_event\_pipeline\_in\_progress\_status module
1534+
---------------------------------------------------------------------------------------------
1535+
1536+
.. automodule:: datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_in_progress_status
1537+
:members:
1538+
:show-inheritance:
1539+
15191540
datadog\_api\_client.v2.model.ci\_app\_pipeline\_event\_pipeline\_level module
15201541
------------------------------------------------------------------------------
15211542

examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@
1515
CIAppCreatePipelineEventRequestDataType,
1616
)
1717
from datadog_api_client.v2.model.ci_app_git_info import CIAppGitInfo
18-
from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline import CIAppPipelineEventPipeline
18+
from datadog_api_client.v2.model.ci_app_pipeline_event_finished_pipeline import CIAppPipelineEventFinishedPipeline
1919
from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_level import CIAppPipelineEventPipelineLevel
2020
from datadog_api_client.v2.model.ci_app_pipeline_event_pipeline_status import CIAppPipelineEventPipelineStatus
2121

2222
body = CIAppCreatePipelineEventRequest(
2323
data=CIAppCreatePipelineEventRequestData(
2424
attributes=CIAppCreatePipelineEventRequestAttributes(
25-
resource=CIAppPipelineEventPipeline(
26-
end=(datetime.now() + relativedelta(seconds=-30)),
25+
resource=CIAppPipelineEventFinishedPipeline(
2726
level=CIAppPipelineEventPipelineLevel.PIPELINE,
27+
unique_id="3eacb6f3-ff04-4e10-8a9c-46e6d054024a",
2828
name="Deploy to AWS",
29-
partial_retry=False,
29+
url="https://my-ci-provider.example/pipelines/my-pipeline/run/1",
3030
start=(datetime.now() + relativedelta(seconds=-120)),
31+
end=(datetime.now() + relativedelta(seconds=-30)),
3132
status=CIAppPipelineEventPipelineStatus.SUCCESS,
32-
unique_id="3eacb6f3-ff04-4e10-8a9c-46e6d054024a",
33-
url="https://my-ci-provider.example/pipelines/my-pipeline/run/1",
33+
partial_retry=False,
3434
git=CIAppGitInfo(
3535
repository_url="https://github.com/DataDog/datadog-agent",
3636
sha="7f263865994b76066c4612fd1965215e7dcb4cd2",

examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
data=CIAppCreatePipelineEventRequestData(
2323
attributes=CIAppCreatePipelineEventRequestAttributes(
2424
resource=CIAppPipelineEventJob(
25-
end=(datetime.now() + relativedelta(seconds=-30)),
2625
level=CIAppPipelineEventJobLevel.JOB,
27-
name="Build image",
28-
start=(datetime.now() + relativedelta(seconds=-120)),
29-
status=CIAppPipelineEventJobStatus.ERROR,
3026
id="cf9456de-8b9e-4c27-aa79-27b1e78c1a33",
27+
name="Build image",
3128
pipeline_unique_id="3eacb6f3-ff04-4e10-8a9c-46e6d054024a",
3229
pipeline_name="Deploy to AWS",
30+
start=(datetime.now() + relativedelta(seconds=-120)),
31+
end=(datetime.now() + relativedelta(seconds=-30)),
32+
status=CIAppPipelineEventJobStatus.ERROR,
3333
url="https://my-ci-provider.example/jobs/my-jobs/run/1",
3434
),
3535
),

0 commit comments

Comments
 (0)