Skip to content

Commit a9c4655

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 36383f9 of spec repo
1 parent d1c9b0b commit a9c4655

Some content is hidden

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

45 files changed

+4152
-82
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 1002 additions & 18 deletions
Large diffs are not rendered by default.

examples/v2/fleet-automation/CreateFleetDeploymentConfigure.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Create a deployment returns "CREATED" response
2+
* Create a configuration deployment returns "CREATED" response
33
*/
44

55
import { client, v2 } from "@datadog/datadog-api-client";
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Create a package upgrade deployment returns "CREATED" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createFleetDeploymentUpgrade"] = true;
9+
const apiInstance = new v2.FleetAutomationApi(configuration);
10+
11+
const params: v2.FleetAutomationApiCreateFleetDeploymentUpgradeRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
filterQuery: "env:prod AND service:web",
16+
targetPackages: [
17+
{
18+
name: "datadog-agent",
19+
version: "7.52.0",
20+
},
21+
],
22+
},
23+
type: "deployment",
24+
},
25+
},
26+
};
27+
28+
apiInstance
29+
.createFleetDeploymentUpgrade(params)
30+
.then((data: v2.FleetDeploymentResponse) => {
31+
console.log(
32+
"API called successfully. Returned data: " + JSON.stringify(data)
33+
);
34+
})
35+
.catch((error: any) => console.error(error));
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Create a schedule returns "CREATED" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createFleetSchedule"] = true;
9+
const apiInstance = new v2.FleetAutomationApi(configuration);
10+
11+
const params: v2.FleetAutomationApiCreateFleetScheduleRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
name: "Weekly Production Agent Updates",
16+
query: "env:prod AND service:web",
17+
rule: {
18+
daysOfWeek: ["Mon", "Wed", "Fri"],
19+
maintenanceWindowDuration: 1200,
20+
startMaintenanceWindow: "02:00",
21+
timezone: "America/New_York",
22+
},
23+
status: "active",
24+
versionToLatest: 0,
25+
},
26+
type: "schedule",
27+
},
28+
},
29+
};
30+
31+
apiInstance
32+
.createFleetSchedule(params)
33+
.then((data: v2.FleetScheduleResponse) => {
34+
console.log(
35+
"API called successfully. Returned data: " + JSON.stringify(data)
36+
);
37+
})
38+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Delete a schedule returns "Schedule successfully deleted." response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.deleteFleetSchedule"] = true;
9+
const apiInstance = new v2.FleetAutomationApi(configuration);
10+
11+
const params: v2.FleetAutomationApiDeleteFleetScheduleRequest = {
12+
id: "id",
13+
};
14+
15+
apiInstance
16+
.deleteFleetSchedule(params)
17+
.then((data: any) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));

examples/v2/fleet-automation/GetFleetDeployment.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Get a deployment by ID returns "OK" response
2+
* Get a configuration deployment by ID returns "OK" response
33
*/
44

55
import { client, v2 } from "@datadog/datadog-api-client";
@@ -8,11 +8,8 @@ const configuration = client.createConfiguration();
88
configuration.unstableOperations["v2.getFleetDeployment"] = true;
99
const apiInstance = new v2.FleetAutomationApi(configuration);
1010

11-
// there is a valid "deployment" in the system
12-
const DEPLOYMENT_ID = process.env.DEPLOYMENT_ID as string;
13-
1411
const params: v2.FleetAutomationApiGetFleetDeploymentRequest = {
15-
deploymentId: DEPLOYMENT_ID,
12+
deploymentId: "deployment_id",
1613
};
1714

1815
apiInstance
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Get a deployment by ID returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getFleetDeployment"] = true;
9+
const apiInstance = new v2.FleetAutomationApi(configuration);
10+
11+
// there is a valid "deployment" in the system
12+
const DEPLOYMENT_ID = process.env.DEPLOYMENT_ID as string;
13+
14+
const params: v2.FleetAutomationApiGetFleetDeploymentRequest = {
15+
deploymentId: DEPLOYMENT_ID,
16+
};
17+
18+
apiInstance
19+
.getFleetDeployment(params)
20+
.then((data: v2.FleetDeploymentResponse) => {
21+
console.log(
22+
"API called successfully. Returned data: " + JSON.stringify(data)
23+
);
24+
})
25+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Get a schedule by ID returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getFleetSchedule"] = true;
9+
const apiInstance = new v2.FleetAutomationApi(configuration);
10+
11+
const params: v2.FleetAutomationApiGetFleetScheduleRequest = {
12+
id: "id",
13+
};
14+
15+
apiInstance
16+
.getFleetSchedule(params)
17+
.then((data: v2.FleetScheduleResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* List all schedules returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listFleetSchedules"] = true;
9+
const apiInstance = new v2.FleetAutomationApi(configuration);
10+
11+
apiInstance
12+
.listFleetSchedules()
13+
.then((data: v2.FleetSchedulesResponse) => {
14+
console.log(
15+
"API called successfully. Returned data: " + JSON.stringify(data)
16+
);
17+
})
18+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Trigger a schedule deployment returns "CREATED - Deployment successfully created and started." response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.triggerFleetSchedule"] = true;
9+
const apiInstance = new v2.FleetAutomationApi(configuration);
10+
11+
const params: v2.FleetAutomationApiTriggerFleetScheduleRequest = {
12+
id: "id",
13+
};
14+
15+
apiInstance
16+
.triggerFleetSchedule(params)
17+
.then((data: v2.FleetDeploymentResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));

0 commit comments

Comments
 (0)