Skip to content

Commit 1af2fa9

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 11651645 of spec repo
1 parent 2dfdb7e commit 1af2fa9

File tree

10 files changed

+1124
-496
lines changed

10 files changed

+1124
-496
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-11-14 18:22:40.655215",
8-
"spec_repo_commit": "f35f7750"
7+
"regenerated": "2024-11-15 12:35:48.662255",
8+
"spec_repo_commit": "11651645"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-11-14 18:22:40.673754",
13-
"spec_repo_commit": "f35f7750"
12+
"regenerated": "2024-11-15 12:35:48.680797",
13+
"spec_repo_commit": "11651645"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
body = DatadogAPIClient::V2::CIAppCreatePipelineEventRequest.new({
77
data: DatadogAPIClient::V2::CIAppCreatePipelineEventRequestData.new({
88
attributes: DatadogAPIClient::V2::CIAppCreatePipelineEventRequestAttributes.new({
9-
resource: DatadogAPIClient::V2::CIAppPipelineEventPipeline.new({
9+
resource: DatadogAPIClient::V2::CIAppPipelineEventFinishedPipeline.new({
1010
_end: (Time.now + -30),
1111
level: DatadogAPIClient::V2::CIAppPipelineEventPipelineLevel::PIPELINE,
1212
name: "Deploy to AWS",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Send running pipeline event returns "Request accepted for processing" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::CIVisibilityPipelinesAPI.new
5+
6+
body = DatadogAPIClient::V2::CIAppCreatePipelineEventRequest.new({
7+
data: DatadogAPIClient::V2::CIAppCreatePipelineEventRequestData.new({
8+
attributes: DatadogAPIClient::V2::CIAppCreatePipelineEventRequestAttributes.new({
9+
resource: DatadogAPIClient::V2::CIAppPipelineEventInProgressPipeline.new({
10+
level: DatadogAPIClient::V2::CIAppPipelineEventPipelineLevel::PIPELINE,
11+
name: "Deploy to AWS",
12+
partial_retry: false,
13+
start: (Time.now + -120),
14+
status: DatadogAPIClient::V2::CIAppPipelineEventPipelineInProgressStatus::RUNNING,
15+
unique_id: "3eacb6f3-ff04-4e10-8a9c-46e6d054024a",
16+
url: "https://my-ci-provider.example/pipelines/my-pipeline/run/1",
17+
git: DatadogAPIClient::V2::CIAppGitInfo.new({
18+
repository_url: "https://github.com/DataDog/datadog-agent",
19+
sha: "7f263865994b76066c4612fd1965215e7dcb4cd2",
20+
author_email: "[email protected]",
21+
}),
22+
}),
23+
}),
24+
type: DatadogAPIClient::V2::CIAppCreatePipelineEventRequestDataType::CIPIPELINE_RESOURCE_REQUEST,
25+
}),
26+
})
27+
p api_instance.create_ci_app_pipeline_event(body)

features/v2/ci_visibility_pipelines.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,10 @@ Feature: CI Visibility Pipelines
114114
And body with value {"data": {"attributes": {"resource": {"end": "{{ timeISO('now - 30s') }}", "level": "job", "name": "Build image", "start": "{{ timeISO('now - 120s') }}", "status": "error", "id": "cf9456de-8b9e-4c27-aa79-27b1e78c1a33", "pipeline_unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", "pipeline_name": "Deploy to AWS", "url": "https://my-ci-provider.example/jobs/my-jobs/run/1"}}, "type": "cipipeline_resource_request"}}
115115
When the request is sent
116116
Then the response status is 202 Request accepted for processing
117+
118+
@team:Datadog/ci-app-backend
119+
Scenario: Send running pipeline event returns "Request accepted for processing" response
120+
Given new "CreateCIAppPipelineEvent" request
121+
And body with value {"data": {"attributes": {"resource": {"level": "pipeline", "name": "Deploy to AWS", "partial_retry": false, "start": "{{ timeISO('now - 120s') }}", "status": "running", "unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", "url": "https://my-ci-provider.example/pipelines/my-pipeline/run/1","git":{"repository_url":"https://github.com/DataDog/datadog-agent","sha":"7f263865994b76066c4612fd1965215e7dcb4cd2","author_email":"[email protected]"}}}, "type": "cipipeline_resource_request"}}
122+
When the request is sent
123+
Then the response status is 202 Request accepted for processing

lib/datadog_api_client/inflector.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,11 +1109,14 @@ def overrides
11091109
"v2.ci_app_host_info" => "CIAppHostInfo",
11101110
"v2.ci_app_pipeline_event" => "CIAppPipelineEvent",
11111111
"v2.ci_app_pipeline_event_attributes" => "CIAppPipelineEventAttributes",
1112+
"v2.ci_app_pipeline_event_finished_pipeline" => "CIAppPipelineEventFinishedPipeline",
1113+
"v2.ci_app_pipeline_event_in_progress_pipeline" => "CIAppPipelineEventInProgressPipeline",
11121114
"v2.ci_app_pipeline_event_job" => "CIAppPipelineEventJob",
11131115
"v2.ci_app_pipeline_event_job_level" => "CIAppPipelineEventJobLevel",
11141116
"v2.ci_app_pipeline_event_job_status" => "CIAppPipelineEventJobStatus",
11151117
"v2.ci_app_pipeline_event_parent_pipeline" => "CIAppPipelineEventParentPipeline",
11161118
"v2.ci_app_pipeline_event_pipeline" => "CIAppPipelineEventPipeline",
1119+
"v2.ci_app_pipeline_event_pipeline_in_progress_status" => "CIAppPipelineEventPipelineInProgressStatus",
11171120
"v2.ci_app_pipeline_event_pipeline_level" => "CIAppPipelineEventPipelineLevel",
11181121
"v2.ci_app_pipeline_event_pipeline_status" => "CIAppPipelineEventPipelineStatus",
11191122
"v2.ci_app_pipeline_event_previous_pipeline" => "CIAppPipelineEventPreviousPipeline",

0 commit comments

Comments
 (0)