-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit 9b78f561 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Jan 9, 2025
1 parent
4c885eb
commit 3c8e8c6
Showing
7 changed files
with
133 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...h-custom-provider-returns-Request-accepted-for-processing-response_2179150053/frozen.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"2025-01-08T08:57:29.599Z" |
67 changes: 67 additions & 0 deletions
67
...custom-provider-returns-Request-accepted-for-processing-response_2179150053/recording.har
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"log": { | ||
"_recordingName": "CI Visibility Pipelines/Send pipeline event with custom provider returns \"Request accepted for processing\" response", | ||
"creator": { | ||
"comment": "persister:fs", | ||
"name": "Polly.JS", | ||
"version": "6.0.5" | ||
}, | ||
"entries": [ | ||
{ | ||
"_id": "c3f1f2457eca522f3006d46cf4c7d02e", | ||
"_order": 0, | ||
"cache": {}, | ||
"request": { | ||
"bodySize": 532, | ||
"cookies": [], | ||
"headers": [ | ||
{ | ||
"_fromType": "array", | ||
"name": "accept", | ||
"value": "application/json" | ||
}, | ||
{ | ||
"_fromType": "array", | ||
"name": "content-type", | ||
"value": "application/json" | ||
} | ||
], | ||
"headersSize": 508, | ||
"httpVersion": "HTTP/1.1", | ||
"method": "POST", | ||
"postData": { | ||
"mimeType": "application/json", | ||
"params": [], | ||
"text": "{\"data\":{\"attributes\":{\"provider_name\":\"example-provider\",\"resource\":{\"end\":\"2025-01-08T08:56:59.599Z\",\"git\":{\"author_email\":\"[email protected]\",\"repository_url\":\"https://github.com/DataDog/datadog-agent\",\"sha\":\"7f263865994b76066c4612fd1965215e7dcb4cd2\"},\"level\":\"pipeline\",\"name\":\"Deploy to AWS\",\"partial_retry\":false,\"start\":\"2025-01-08T08:55:29.599Z\",\"status\":\"success\",\"unique_id\":\"3eacb6f3-ff04-4e10-8a9c-46e6d054024a\",\"url\":\"https://my-ci-provider.example/pipelines/my-pipeline/run/1\"}},\"type\":\"cipipeline_resource_request\"}}" | ||
}, | ||
"queryString": [], | ||
"url": "https://api.datadoghq.com/api/v2/ci/pipeline" | ||
}, | ||
"response": { | ||
"bodySize": 13, | ||
"content": { | ||
"mimeType": "application/vnd.api+json", | ||
"size": 13, | ||
"text": "{\"data\":null}" | ||
}, | ||
"cookies": [], | ||
"headers": [ | ||
{ | ||
"name": "content-type", | ||
"value": "application/vnd.api+json" | ||
} | ||
], | ||
"headersSize": 676, | ||
"httpVersion": "HTTP/1.1", | ||
"redirectURL": "", | ||
"status": 202, | ||
"statusText": "Accepted" | ||
}, | ||
"startedDateTime": "2025-01-08T08:57:29.994Z", | ||
"time": 254 | ||
} | ||
], | ||
"pages": [], | ||
"version": "1.2" | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_819339921.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Send pipeline event with custom provider returns "Request accepted for processing" response | ||
*/ | ||
|
||
import { client, v2 } from "@datadog/datadog-api-client"; | ||
|
||
const configuration = client.createConfiguration(); | ||
const apiInstance = new v2.CIVisibilityPipelinesApi(configuration); | ||
|
||
const params: v2.CIVisibilityPipelinesApiCreateCIAppPipelineEventRequest = { | ||
body: { | ||
data: { | ||
attributes: { | ||
providerName: "example-provider", | ||
resource: { | ||
level: "pipeline", | ||
uniqueId: "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", | ||
name: "Deploy to AWS", | ||
url: "https://my-ci-provider.example/pipelines/my-pipeline/run/1", | ||
start: new Date(new Date().getTime() + -120 * 1000), | ||
end: new Date(new Date().getTime() + -30 * 1000), | ||
status: "success", | ||
partialRetry: false, | ||
git: { | ||
repositoryUrl: "https://github.com/DataDog/datadog-agent", | ||
sha: "7f263865994b76066c4612fd1965215e7dcb4cd2", | ||
authorEmail: "[email protected]", | ||
}, | ||
}, | ||
}, | ||
type: "cipipeline_resource_request", | ||
}, | ||
}, | ||
}; | ||
|
||
apiInstance | ||
.createCIAppPipelineEvent(params) | ||
.then((data: any) => { | ||
console.log( | ||
"API called successfully. Returned data: " + JSON.stringify(data) | ||
); | ||
}) | ||
.catch((error: any) => console.error(error)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,13 @@ Feature: CI Visibility Pipelines | |
When the request is sent | ||
Then the response status is 202 Request accepted for processing | ||
|
||
@team:Datadog/ci-app-backend | ||
Scenario: Send pipeline event with custom provider returns "Request accepted for processing" response | ||
Given new "CreateCIAppPipelineEvent" request | ||
And body with value {"data": {"attributes": {"provider_name": "example-provider", "resource": {"level": "pipeline","unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a","name": "Deploy to AWS","url": "https://my-ci-provider.example/pipelines/my-pipeline/run/1","start": "{{ timeISO('now - 120s') }}","end": "{{ timeISO('now - 30s') }}","status": "success","partial_retry": false,"git": {"repository_url": "https://github.com/DataDog/datadog-agent","sha": "7f263865994b76066c4612fd1965215e7dcb4cd2","author_email": "[email protected]"}}},"type": "cipipeline_resource_request"}} | ||
When the request is sent | ||
Then the response status is 202 Request accepted for processing | ||
|
||
@skip @team:Datadog/ci-app-backend | ||
Scenario: Send pipeline job event returns "Request accepted for processing" response | ||
Given new "CreateCIAppPipelineEvent" request | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters