Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
406 changes: 406 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions features/v1/logs_pipelines.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ Feature: Logs Pipelines
@generated @skip @team:DataDog/event-platform-experience
Scenario: Create a pipeline returns "Bad Request" response
Given new "CreateLogsPipeline" request
And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar\n", "support_rules": "rule_name_1 foo\nrule_name_2 bar\n"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []}
And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar", "support_rules": "rule_name_1 foo\nrule_name_2 bar"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/event-platform-experience
Scenario: Create a pipeline returns "OK" response
Given new "CreateLogsPipeline" request
And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar\n", "support_rules": "rule_name_1 foo\nrule_name_2 bar\n"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []}
And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar", "support_rules": "rule_name_1 foo\nrule_name_2 bar"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []}
When the request is sent
Then the response status is 200 OK

Expand Down Expand Up @@ -128,15 +128,15 @@ Feature: Logs Pipelines
Scenario: Update a pipeline returns "Bad Request" response
Given new "UpdateLogsPipeline" request
And request contains "pipeline_id" parameter from "REPLACE.ME"
And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar\n", "support_rules": "rule_name_1 foo\nrule_name_2 bar\n"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []}
And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar", "support_rules": "rule_name_1 foo\nrule_name_2 bar"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/event-platform-experience
Scenario: Update a pipeline returns "OK" response
Given new "UpdateLogsPipeline" request
And request contains "pipeline_id" parameter from "REPLACE.ME"
And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar\n", "support_rules": "rule_name_1 foo\nrule_name_2 bar\n"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []}
And body with value {"filter": {"query": "source:python"}, "name": "", "processors": [{"grok": {"match_rules": "rule_name_1 foo\nrule_name_2 bar", "support_rules": "rule_name_1 foo\nrule_name_2 bar"}, "is_enabled": false, "samples": [], "source": "message", "type": "grok-parser"}], "tags": []}
When the request is sent
Then the response status is 200 OK

Expand Down
24 changes: 24 additions & 0 deletions features/v2/static_analysis.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@endpoint(static-analysis) @endpoint(static-analysis-v2)
Feature: Static Analysis
API for static analysis

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "StaticAnalysis" API

@generated @skip @team:DataDog/k9-vm-sca
Scenario: POST request to resolve vulnerable symbols returns "OK" response
Given operation "CreateSCAResolveVulnerableSymbols" enabled
And new "CreateSCAResolveVulnerableSymbols" request
And body with value {"data": {"attributes": {"purls": []}, "type": "resolve-vulnerable-symbols-request"}}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/k9-vm-sca
Scenario: Post dependencies for analysis returns "OK" response
Given operation "CreateSCAResult" enabled
And new "CreateSCAResult" request
And body with value {"data": {"attributes": {"commit": {}, "dependencies": [{"exclusions": [], "locations": [{"block": {"end": {}, "start": {}}, "name": {"end": {}, "start": {}}, "namespace": {"end": {}, "start": {}}, "version": {"end": {}, "start": {}}}], "reachable_symbol_properties": [{}]}], "files": [{}], "relations": [{"depends_on": []}], "repository": {}, "vulnerabilities": [{"affects": [{}]}]}, "type": "scarequests"}}
When the request is sent
Then the response status is 200 OK
12 changes: 12 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3780,6 +3780,18 @@
"type": "safe"
}
},
"CreateSCAResult": {
"tag": "Static Analysis",
"undo": {
"type": "safe"
}
},
"CreateSCAResolveVulnerableSymbols": {
"tag": "Static Analysis",
"undo": {
"type": "safe"
}
},
"GetOnDemandConcurrencyCap": {
"tag": "Synthetics",
"undo": {
Expand Down
1 change: 1 addition & 0 deletions packages/datadog-api-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ apiInstance
| Spa | @datadog/datadog-api-client-spa | [README.md](../../services/spa/README.md) |
| Spans | @datadog/datadog-api-client-spans | [README.md](../../services/spans/README.md) |
| Spans Metrics | @datadog/datadog-api-client-spans-metrics | [README.md](../../services/spans-metrics/README.md) |
| Static Analysis | @datadog/datadog-api-client-static-analysis | [README.md](../../services/static-analysis/README.md) |
| Synthetics | @datadog/datadog-api-client-synthetics | [README.md](../../services/synthetics/README.md) |
| Tags | @datadog/datadog-api-client-tags | [README.md](../../services/tags/README.md) |
| Teams | @datadog/datadog-api-client-teams | [README.md](../../services/teams/README.md) |
Expand Down
14 changes: 14 additions & 0 deletions private/bdd_runner/src/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8151,6 +8151,20 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
},
operationResponseType: "SpansListResponse",
},
"StaticAnalysisApi.V2.CreateSCAResult": {
body: {
type: "ScaRequest",
format: "",
},
operationResponseType: "{}",
},
"StaticAnalysisApi.V2.CreateSCAResolveVulnerableSymbols": {
body: {
type: "ResolveVulnerableSymbolsRequest",
format: "",
},
operationResponseType: "ResolveVulnerableSymbolsResponse",
},
"SyntheticsApi.V2.GetOnDemandConcurrencyCap": {
operationResponseType: "OnDemandConcurrencyCapResponse",
},
Expand Down
1 change: 1 addition & 0 deletions services/static_analysis/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
43 changes: 43 additions & 0 deletions services/static_analysis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# @datadog/datadog-api-client-static-analysis

## Description

API for static analysis

## Navigation

- [Installation](#installation)
- [Getting Started](#getting-started)

## Installation

```sh
# NPM
npm install @datadog/datadog-api-client-static-analysis
# Yarn
yarn add @datadog/datadog-api-client-static-analysis
```

## Getting Started
```ts
import { createConfiguration } from "@datadog/datadog-api-client";
import { StaticAnalysisApiV2 } from "@datadog/datadog-api-client-static-analysis";

const configuration = createConfiguration();
// Enable unstable operations
const configurationOpts = {
unstableOperations: {
"StaticAnalysisApi.v2.createSCAResult": true
}
}

const configuration = createConfiguration(configurationOpts);
const apiInstance = new StaticAnalysisApiV2(configuration);
const params = {/* parameters */};

apiInstance.createSCAResult(params).then(() => {
console.log("API called successfully.");
}).catch((error) => {
console.error("Error calling API: " + error);
});
```
43 changes: 43 additions & 0 deletions services/static_analysis/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "@datadog/datadog-api-client-static-analysis",
"description": "",
"author": "",
"keywords": [
"api",
"fetch",
"typescript"
],
"license": "Apache-2.0",
"licenses": [
{
"type": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
],
"repository": {
"type": "git",
"url": "https://github.com/DataDog/datadog-api-client-typescript.git",
"directory": "services/static-analysis"
},
"files": [
"dist/**/*"
],
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"scripts": {
"prepack": "yarn workspace @datadog/datadog-api-client build && yarn build",
"build": "yarn generate-version-files && tsc",
"generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts"
},
"dependencies": {
"@datadog/datadog-api-client": "^2.0.0-beta.0"
},
"devDependencies": {
"typescript": "5.8.3"
},
"engines": {
"node": ">=18.0.0"
},
"version": "0.0.1",
"packageManager": "[email protected]"
}
3 changes: 3 additions & 0 deletions services/static_analysis/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * as v2 from "./v2";

export { StaticAnalysisApi as StaticAnalysisApiV2 } from "./v2/StaticAnalysisApi";
Loading