Skip to content

Commit

Permalink
Regenerate client from commit 274877db of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Jan 8, 2025
1 parent e390ba0 commit 8ff96c6
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-07 19:53:42.897987",
"spec_repo_commit": "d63fa330"
"regenerated": "2025-01-08 08:58:36.798230",
"spec_repo_commit": "274877db"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-07 19:53:42.913387",
"spec_repo_commit": "d63fa330"
"regenerated": "2025-01-08 08:58:36.813747",
"spec_repo_commit": "274877db"
}
}
}
3 changes: 3 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3331,6 +3331,9 @@ components:
env:
description: The Datadog environment.
type: string
provider_name:
description: The name of the CI provider. By default is "custom".
type: string
resource:
$ref: '#/components/schemas/CIAppCreatePipelineEventRequestAttributesResource'
service:
Expand Down
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));
7 changes: 7 additions & 0 deletions features/v2/ci_visibility_pipelines.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export class CIAppCreatePipelineEventRequestAttributes {
* The Datadog environment.
*/
"env"?: string;
/**
* The name of the CI provider. By default is "custom".
*/
"providerName"?: string;
/**
* Details of the CI pipeline event.
*/
Expand Down Expand Up @@ -44,6 +48,10 @@ export class CIAppCreatePipelineEventRequestAttributes {
baseName: "env",
type: "string",
},
providerName: {
baseName: "provider_name",
type: "string",
},
resource: {
baseName: "resource",
type: "CIAppCreatePipelineEventRequestAttributesResource",
Expand Down

0 comments on commit 8ff96c6

Please sign in to comment.