Skip to content

Commit a7a1698

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 77956c4 of spec repo
1 parent dddddac commit a7a1698

38 files changed

+4038
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 647 additions & 0 deletions
Large diffs are not rendered by default.

features/v2/given.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,19 @@
651651
"tag": "Logs Metrics",
652652
"operationId": "CreateLogsMetric"
653653
},
654+
{
655+
"parameters": [
656+
{
657+
"name": "body",
658+
"origin": "request",
659+
"value": "{\n \"data\": {\n \"type\": \"logs_restriction_queries\",\n \"attributes\": {\n \"restriction_query\": \"env:staging\"\n }\n }\n}"
660+
}
661+
],
662+
"step": "there is a valid \"restriction_query\" in the system",
663+
"key": "restriction_query",
664+
"tag": "Logs Restriction Queries",
665+
"operationId": "CreateRestrictionQuery"
666+
},
654667
{
655668
"parameters": [
656669
{

features/v2/logs_restriction_queries.feature

Lines changed: 331 additions & 0 deletions
Large diffs are not rendered by default.

features/v2/undo.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,6 +2377,73 @@
23772377
"type": "idempotent"
23782378
}
23792379
},
2380+
"ListRestrictionQueries": {
2381+
"tag": "Logs Restriction Queries",
2382+
"undo": {
2383+
"type": "safe"
2384+
}
2385+
},
2386+
"CreateRestrictionQuery": {
2387+
"tag": "Logs Restriction Queries",
2388+
"undo": {
2389+
"operationId": "DeleteRestrictionQuery",
2390+
"parameters": [
2391+
{
2392+
"name": "restriction_query_id",
2393+
"source": "data.id"
2394+
}
2395+
],
2396+
"type": "unsafe"
2397+
}
2398+
},
2399+
"GetRoleRestrictionQuery": {
2400+
"tag": "Logs Restriction Queries",
2401+
"undo": {
2402+
"type": "safe"
2403+
}
2404+
},
2405+
"ListUserRestrictionQueries": {
2406+
"tag": "Logs Restriction Queries",
2407+
"undo": {
2408+
"type": "safe"
2409+
}
2410+
},
2411+
"DeleteRestrictionQuery": {
2412+
"tag": "Logs Restriction Queries",
2413+
"undo": {
2414+
"type": "idempotent"
2415+
}
2416+
},
2417+
"GetRestrictionQuery": {
2418+
"tag": "Logs Restriction Queries",
2419+
"undo": {
2420+
"type": "safe"
2421+
}
2422+
},
2423+
"UpdateRestrictionQuery": {
2424+
"tag": "Logs Restriction Queries",
2425+
"undo": {
2426+
"type": "idempotent"
2427+
}
2428+
},
2429+
"RemoveRoleFromRestrictionQuery": {
2430+
"tag": "Logs Restriction Queries",
2431+
"undo": {
2432+
"type": "idempotent"
2433+
}
2434+
},
2435+
"ListRestrictionQueryRoles": {
2436+
"tag": "Logs Restriction Queries",
2437+
"undo": {
2438+
"type": "safe"
2439+
}
2440+
},
2441+
"AddRoleToRestrictionQuery": {
2442+
"tag": "Logs Restriction Queries",
2443+
"undo": {
2444+
"type": "safe"
2445+
}
2446+
},
23802447
"ListLogsGet": {
23812448
"tag": "Logs",
23822449
"undo": {

packages/datadog-api-client/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ apiInstance
398398
| Logs Indexes | @datadog/datadog-api-client-logs-indexes | [README.md](../../services/logs-indexes/README.md) |
399399
| Logs Metrics | @datadog/datadog-api-client-logs-metrics | [README.md](../../services/logs-metrics/README.md) |
400400
| Logs Pipelines | @datadog/datadog-api-client-logs-pipelines | [README.md](../../services/logs-pipelines/README.md) |
401+
| Logs Restriction Queries | @datadog/datadog-api-client-logs-restriction-queries | [README.md](../../services/logs-restriction-queries/README.md) |
401402
| Metrics | @datadog/datadog-api-client-metrics | [README.md](../../services/metrics/README.md) |
402403
| Microsoft Teams Integration | @datadog/datadog-api-client-microsoft-teams-integration | [README.md](../../services/microsoft-teams-integration/README.md) |
403404
| Monitors | @datadog/datadog-api-client-monitors | [README.md](../../services/monitors/README.md) |

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6677,6 +6677,100 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
66776677
},
66786678
operationResponseType: "LogsMetricResponse",
66796679
},
6680+
"LogsRestrictionQueriesApi.V2.ListRestrictionQueries": {
6681+
pageSize: {
6682+
type: "number",
6683+
format: "int64",
6684+
},
6685+
pageNumber: {
6686+
type: "number",
6687+
format: "int64",
6688+
},
6689+
operationResponseType: "RestrictionQueryListResponse",
6690+
},
6691+
"LogsRestrictionQueriesApi.V2.CreateRestrictionQuery": {
6692+
body: {
6693+
type: "RestrictionQueryCreatePayload",
6694+
format: "",
6695+
},
6696+
operationResponseType: "RestrictionQueryWithoutRelationshipsResponse",
6697+
},
6698+
"LogsRestrictionQueriesApi.V2.GetRoleRestrictionQuery": {
6699+
roleId: {
6700+
type: "string",
6701+
format: "",
6702+
},
6703+
operationResponseType: "RestrictionQueryListResponse",
6704+
},
6705+
"LogsRestrictionQueriesApi.V2.ListUserRestrictionQueries": {
6706+
userId: {
6707+
type: "string",
6708+
format: "",
6709+
},
6710+
operationResponseType: "RestrictionQueryListResponse",
6711+
},
6712+
"LogsRestrictionQueriesApi.V2.GetRestrictionQuery": {
6713+
restrictionQueryId: {
6714+
type: "string",
6715+
format: "",
6716+
},
6717+
operationResponseType: "RestrictionQueryWithRelationshipsResponse",
6718+
},
6719+
"LogsRestrictionQueriesApi.V2.DeleteRestrictionQuery": {
6720+
restrictionQueryId: {
6721+
type: "string",
6722+
format: "",
6723+
},
6724+
operationResponseType: "{}",
6725+
},
6726+
"LogsRestrictionQueriesApi.V2.UpdateRestrictionQuery": {
6727+
restrictionQueryId: {
6728+
type: "string",
6729+
format: "",
6730+
},
6731+
body: {
6732+
type: "RestrictionQueryUpdatePayload",
6733+
format: "",
6734+
},
6735+
operationResponseType: "RestrictionQueryWithoutRelationshipsResponse",
6736+
},
6737+
"LogsRestrictionQueriesApi.V2.ListRestrictionQueryRoles": {
6738+
restrictionQueryId: {
6739+
type: "string",
6740+
format: "",
6741+
},
6742+
pageSize: {
6743+
type: "number",
6744+
format: "int64",
6745+
},
6746+
pageNumber: {
6747+
type: "number",
6748+
format: "int64",
6749+
},
6750+
operationResponseType: "RestrictionQueryRolesResponse",
6751+
},
6752+
"LogsRestrictionQueriesApi.V2.AddRoleToRestrictionQuery": {
6753+
restrictionQueryId: {
6754+
type: "string",
6755+
format: "",
6756+
},
6757+
body: {
6758+
type: "RelationshipToRole",
6759+
format: "",
6760+
},
6761+
operationResponseType: "{}",
6762+
},
6763+
"LogsRestrictionQueriesApi.V2.RemoveRoleFromRestrictionQuery": {
6764+
restrictionQueryId: {
6765+
type: "string",
6766+
format: "",
6767+
},
6768+
body: {
6769+
type: "RelationshipToRole",
6770+
format: "",
6771+
},
6772+
operationResponseType: "{}",
6773+
},
66806774
"MetricsApi.V2.ListTagConfigurations": {
66816775
filterConfigured: {
66826776
type: "boolean",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# @datadog/datadog-api-client-logs-restriction-queries
2+
3+
## Description
4+
5+
**Note: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).**
6+
7+
A Restriction Query is a logs query that restricts which logs the `logs_read_data` permission grants read access to.
8+
For users whose roles have Restriction Queries, any log query they make only returns those log events that also match
9+
one of their Restriction Queries. This is true whether the user queries log events from any log-related feature, including
10+
the log explorer, Live Tail, re-hydration, or a dashboard widget.
11+
12+
Restriction Queries currently only support use of the following components of log events:
13+
14+
- Reserved attributes
15+
- The log message
16+
- Tags
17+
18+
To restrict read access on log data, add a team tag to log events to indicate which teams own them, and then scope Restriction Queries to the relevant values of the team tag. Tags can be applied to log events in many ways, and a log event can have multiple tags with the same key (like team) and different values. This means the same log event can be visible to roles whose restriction queries are scoped to different team values.
19+
20+
See [How to Set Up RBAC for Logs](https://docs.datadoghq.com/logs/guide/logs-rbac/?tab=api#restrict-access-to-logs) for details on how to add restriction queries.
21+
22+
## Navigation
23+
24+
- [Installation](#installation)
25+
- [Getting Started](#getting-started)
26+
27+
## Installation
28+
29+
```sh
30+
# NPM
31+
npm install @datadog/datadog-api-client-logs-restriction-queries
32+
# Yarn
33+
yarn add @datadog/datadog-api-client-logs-restriction-queries
34+
```
35+
36+
## Getting Started
37+
```ts
38+
import { createConfiguration } from "@datadog/datadog-api-client";
39+
import { LogsRestrictionQueriesApiV2 } from "@datadog/datadog-api-client-logs-restriction-queries";
40+
import { v2 } from "@datadog/datadog-api-client-logs-restriction-queries";
41+
42+
const configuration = createConfiguration();
43+
// Enable unstable operations
44+
const configurationOpts = {
45+
unstableOperations: {
46+
"LogsRestrictionQueriesApi.v2.listRestrictionQueries": true
47+
}
48+
}
49+
50+
const configuration = createConfiguration(configurationOpts);
51+
const apiInstance = new LogsRestrictionQueriesApiV2(configuration);
52+
const params = {/* parameters */};
53+
54+
apiInstance.listRestrictionQueries(params).then((data) => {
55+
console.log("API called successfully. Returned data: " + JSON.stringify(data));
56+
}).catch((error) => {
57+
console.error("Error calling API: " + error);
58+
});
59+
```
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "@datadog/datadog-api-client-logs-restriction-queries",
3+
"description": "",
4+
"author": "",
5+
"keywords": [
6+
"api",
7+
"fetch",
8+
"typescript"
9+
],
10+
"license": "Apache-2.0",
11+
"licenses": [
12+
{
13+
"type": "Apache-2.0",
14+
"url": "http://www.apache.org/licenses/LICENSE-2.0"
15+
}
16+
],
17+
"repository": {
18+
"type": "git",
19+
"url": "https://github.com/DataDog/datadog-api-client-typescript.git",
20+
"directory": "services/logs-restriction-queries"
21+
},
22+
"files": [
23+
"dist/**/*"
24+
],
25+
"main": "./dist/index.js",
26+
"typings": "./dist/index.d.ts",
27+
"scripts": {
28+
"prepack": "yarn workspace @datadog/datadog-api-client build && yarn build",
29+
"build": "yarn generate-version-files && tsc",
30+
"generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts"
31+
},
32+
"dependencies": {
33+
"@datadog/datadog-api-client": "^2.0.0-beta.0"
34+
},
35+
"devDependencies": {
36+
"typescript": "5.8.3"
37+
},
38+
"engines": {
39+
"node": ">=18.0.0"
40+
},
41+
"version": "0.0.1",
42+
"packageManager": "yarn@4.9.1"
43+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * as v2 from "./v2";
2+
3+
export { LogsRestrictionQueriesApi as LogsRestrictionQueriesApiV2 } from "./v2/LogsRestrictionQueriesApi";

0 commit comments

Comments
 (0)