Skip to content

Commit e309d37

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 3935ca0 of spec repo
1 parent 3eb37a5 commit e309d37

53 files changed

Lines changed: 5656 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.generator/schemas/v2/openapi.yaml

Lines changed: 1224 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2026-04-01T20:36:45.896Z"

cassettes/v2/Feature-Flags_3833710718/Create-allocation-for-a-flag-in-an-environment-returns-Created-response_1397720344/recording.har

Lines changed: 253 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2026-04-01T20:36:50.944Z"

cassettes/v2/Feature-Flags_3833710718/Update-targeting-rules-for-a-flag-in-an-environment-returns-OK-response_1080924031/recording.har

Lines changed: 253 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/**
2+
* Create targeting rules for a flag env returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.FeatureFlagsApi(configuration);
9+
10+
const params: v2.FeatureFlagsApiCreateAllocationsForFeatureFlagInEnvironmentRequest =
11+
{
12+
body: {
13+
data: {
14+
attributes: {
15+
experimentId: "550e8400-e29b-41d4-a716-446655440030",
16+
exposureSchedule: {
17+
absoluteStartTime: new Date(2025, 6, 13, 12, 0, 0, 0),
18+
controlVariantId: "550e8400-e29b-41d4-a716-446655440012",
19+
controlVariantKey: "control",
20+
id: "550e8400-e29b-41d4-a716-446655440010",
21+
rolloutOptions: {
22+
autostart: false,
23+
selectionIntervalMs: 3600000,
24+
strategy: "UNIFORM_INTERVALS",
25+
},
26+
rolloutSteps: [
27+
{
28+
exposureRatio: 0.5,
29+
groupedStepIndex: 1,
30+
id: "550e8400-e29b-41d4-a716-446655440040",
31+
intervalMs: 3600000,
32+
isPauseRecord: false,
33+
},
34+
],
35+
},
36+
guardrailMetrics: [
37+
{
38+
metricId: "metric-error-rate",
39+
triggerAction: "PAUSE",
40+
},
41+
],
42+
id: "550e8400-e29b-41d4-a716-446655440020",
43+
key: "prod-rollout",
44+
name: "Production Rollout",
45+
targetingRules: [
46+
{
47+
conditions: [
48+
{
49+
attribute: "user_tier",
50+
operator: "ONE_OF",
51+
value: ["premium", "enterprise"],
52+
},
53+
],
54+
},
55+
],
56+
type: "FEATURE_GATE",
57+
variantWeights: [
58+
{
59+
value: 50,
60+
variantId: "550e8400-e29b-41d4-a716-446655440001",
61+
variantKey: "control",
62+
},
63+
],
64+
},
65+
type: "allocations",
66+
},
67+
},
68+
featureFlagId: "550e8400-e29b-41d4-a716-446655440000",
69+
environmentId: "550e8400-e29b-41d4-a716-446655440001",
70+
};
71+
72+
apiInstance
73+
.createAllocationsForFeatureFlagInEnvironment(params)
74+
.then((data: v2.AllocationResponse) => {
75+
console.log(
76+
"API called successfully. Returned data: " + JSON.stringify(data)
77+
);
78+
})
79+
.catch((error: any) => console.error(error));
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* Create allocation for a flag in an environment returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.FeatureFlagsApi(configuration);
9+
10+
// there is a valid "feature_flag" in the system
11+
const FEATURE_FLAG_DATA_ATTRIBUTES_VARIANTS_0_ID = process.env
12+
.FEATURE_FLAG_DATA_ATTRIBUTES_VARIANTS_0_ID as string;
13+
const FEATURE_FLAG_DATA_ID = process.env.FEATURE_FLAG_DATA_ID as string;
14+
15+
// there is a valid "environment" in the system
16+
const ENVIRONMENT_DATA_ID = process.env.ENVIRONMENT_DATA_ID as string;
17+
18+
const params: v2.FeatureFlagsApiCreateAllocationsForFeatureFlagInEnvironmentRequest =
19+
{
20+
body: {
21+
data: {
22+
type: "allocations",
23+
attributes: {
24+
name: "New targeting rule Example-Feature-Flag",
25+
key: "new-targeting-rule-example-feature-flag",
26+
targetingRules: [],
27+
variantWeights: [
28+
{
29+
variantId: FEATURE_FLAG_DATA_ATTRIBUTES_VARIANTS_0_ID,
30+
value: 100,
31+
},
32+
],
33+
guardrailMetrics: [],
34+
type: "CANARY",
35+
},
36+
},
37+
},
38+
featureFlagId: FEATURE_FLAG_DATA_ID,
39+
environmentId: ENVIRONMENT_DATA_ID,
40+
};
41+
42+
apiInstance
43+
.createAllocationsForFeatureFlagInEnvironment(params)
44+
.then((data: v2.AllocationResponse) => {
45+
console.log(
46+
"API called successfully. Returned data: " + JSON.stringify(data)
47+
);
48+
})
49+
.catch((error: any) => console.error(error));
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Pause a progressive rollout returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.FeatureFlagsApi(configuration);
9+
10+
const params: v2.FeatureFlagsApiPauseExposureScheduleRequest = {
11+
exposureScheduleId: "550e8400-e29b-41d4-a716-446655440010",
12+
};
13+
14+
apiInstance
15+
.pauseExposureSchedule(params)
16+
.then((data: v2.AllocationExposureScheduleResponse) => {
17+
console.log(
18+
"API called successfully. Returned data: " + JSON.stringify(data)
19+
);
20+
})
21+
.catch((error: any) => console.error(error));
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Resume a progressive rollout returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.FeatureFlagsApi(configuration);
9+
10+
const params: v2.FeatureFlagsApiResumeExposureScheduleRequest = {
11+
exposureScheduleId: "550e8400-e29b-41d4-a716-446655440010",
12+
};
13+
14+
apiInstance
15+
.resumeExposureSchedule(params)
16+
.then((data: v2.AllocationExposureScheduleResponse) => {
17+
console.log(
18+
"API called successfully. Returned data: " + JSON.stringify(data)
19+
);
20+
})
21+
.catch((error: any) => console.error(error));
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Start a progressive rollout returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.FeatureFlagsApi(configuration);
9+
10+
const params: v2.FeatureFlagsApiStartExposureScheduleRequest = {
11+
exposureScheduleId: "550e8400-e29b-41d4-a716-446655440010",
12+
};
13+
14+
apiInstance
15+
.startExposureSchedule(params)
16+
.then((data: v2.AllocationExposureScheduleResponse) => {
17+
console.log(
18+
"API called successfully. Returned data: " + JSON.stringify(data)
19+
);
20+
})
21+
.catch((error: any) => console.error(error));

0 commit comments

Comments
 (0)