Skip to content

Commit ea77bdc

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add running pipelines on custom pipelines API (#2573)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent d824268 commit ea77bdc

22 files changed

+2337
-937
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:07.595482",
8-
"spec_repo_commit": "f35e3502"
7+
"regenerated": "2024-12-10 19:50:18.230257",
8+
"spec_repo_commit": "5da0cd35"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-12-10 17:29:07.616601",
13-
"spec_repo_commit": "f35e3502"
12+
"regenerated": "2024-12-10 19:50:18.249357",
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.

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

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.datadog.api.client.v2.model.CIAppCreatePipelineEventRequestData;
99
import com.datadog.api.client.v2.model.CIAppCreatePipelineEventRequestDataType;
1010
import com.datadog.api.client.v2.model.CIAppGitInfo;
11+
import com.datadog.api.client.v2.model.CIAppPipelineEventFinishedPipeline;
1112
import com.datadog.api.client.v2.model.CIAppPipelineEventPipeline;
1213
import com.datadog.api.client.v2.model.CIAppPipelineEventPipelineLevel;
1314
import com.datadog.api.client.v2.model.CIAppPipelineEventPipelineStatus;
@@ -26,22 +27,23 @@ public static void main(String[] args) {
2627
new CIAppCreatePipelineEventRequestAttributes()
2728
.resource(
2829
new CIAppCreatePipelineEventRequestAttributesResource(
29-
new CIAppPipelineEventPipeline()
30-
.end(OffsetDateTime.now().plusSeconds(-30))
31-
.level(CIAppPipelineEventPipelineLevel.PIPELINE)
32-
.name("Deploy to AWS")
33-
.partialRetry(false)
34-
.start(OffsetDateTime.now().plusSeconds(-120))
35-
.status(CIAppPipelineEventPipelineStatus.SUCCESS)
36-
.uniqueId("3eacb6f3-ff04-4e10-8a9c-46e6d054024a")
37-
.url(
38-
"https://my-ci-provider.example/pipelines/my-pipeline/run/1")
39-
.git(
40-
new CIAppGitInfo()
41-
.repositoryUrl(
42-
"https://github.com/DataDog/datadog-agent")
43-
.sha("7f263865994b76066c4612fd1965215e7dcb4cd2")
44-
.authorEmail("john.doe@email.com")))))
30+
new CIAppPipelineEventPipeline(
31+
new CIAppPipelineEventFinishedPipeline()
32+
.level(CIAppPipelineEventPipelineLevel.PIPELINE)
33+
.uniqueId("3eacb6f3-ff04-4e10-8a9c-46e6d054024a")
34+
.name("Deploy to AWS")
35+
.url(
36+
"https://my-ci-provider.example/pipelines/my-pipeline/run/1")
37+
.start(OffsetDateTime.now().plusSeconds(-120))
38+
.end(OffsetDateTime.now().plusSeconds(-30))
39+
.status(CIAppPipelineEventPipelineStatus.SUCCESS)
40+
.partialRetry(false)
41+
.git(
42+
new CIAppGitInfo()
43+
.repositoryUrl(
44+
"https://github.com/DataDog/datadog-agent")
45+
.sha("7f263865994b76066c4612fd1965215e7dcb4cd2")
46+
.authorEmail("john.doe@email.com"))))))
4547
.type(CIAppCreatePipelineEventRequestDataType.CIPIPELINE_RESOURCE_REQUEST));
4648

4749
try {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ public static void main(String[] args) {
2626
.resource(
2727
new CIAppCreatePipelineEventRequestAttributesResource(
2828
new CIAppPipelineEventJob()
29-
.end(OffsetDateTime.now().plusSeconds(-30))
3029
.level(CIAppPipelineEventJobLevel.JOB)
31-
.name("Build image")
32-
.start(OffsetDateTime.now().plusSeconds(-120))
33-
.status(CIAppPipelineEventJobStatus.ERROR)
3430
.id("cf9456de-8b9e-4c27-aa79-27b1e78c1a33")
31+
.name("Build image")
3532
.pipelineUniqueId("3eacb6f3-ff04-4e10-8a9c-46e6d054024a")
3633
.pipelineName("Deploy to AWS")
34+
.start(OffsetDateTime.now().plusSeconds(-120))
35+
.end(OffsetDateTime.now().plusSeconds(-30))
36+
.status(CIAppPipelineEventJobStatus.ERROR)
3737
.url("https://my-ci-provider.example/jobs/my-jobs/run/1"))))
3838
.type(CIAppCreatePipelineEventRequestDataType.CIPIPELINE_RESOURCE_REQUEST));
3939

0 commit comments

Comments
 (0)