Skip to content
Merged
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
1,080 changes: 1,062 additions & 18 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Create a deployment returns "CREATED" response
* Create a configuration deployment returns "CREATED" response
*/

import { client, v2 } from "@datadog/datadog-api-client";
Expand Down
35 changes: 35 additions & 0 deletions examples/v2/fleet-automation/CreateFleetDeploymentUpgrade.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Upgrade hosts returns "CREATED" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createFleetDeploymentUpgrade"] = true;
const apiInstance = new v2.FleetAutomationApi(configuration);

const params: v2.FleetAutomationApiCreateFleetDeploymentUpgradeRequest = {
body: {
data: {
attributes: {
filterQuery: "env:prod AND service:web",
targetPackages: [
{
name: "datadog-agent",
version: "7.52.0",
},
],
},
type: "deployment",
},
},
};

apiInstance
.createFleetDeploymentUpgrade(params)
.then((data: v2.FleetDeploymentResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
38 changes: 38 additions & 0 deletions examples/v2/fleet-automation/CreateFleetSchedule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* Create a schedule returns "CREATED" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createFleetSchedule"] = true;
const apiInstance = new v2.FleetAutomationApi(configuration);

const params: v2.FleetAutomationApiCreateFleetScheduleRequest = {
body: {
data: {
attributes: {
name: "Weekly Production Agent Updates",
query: "env:prod AND service:web",
rule: {
daysOfWeek: ["Mon", "Wed", "Fri"],
maintenanceWindowDuration: 1200,
startMaintenanceWindow: "02:00",
timezone: "America/New_York",
},
status: "active",
versionToLatest: 0,
},
type: "schedule",
},
},
};

apiInstance
.createFleetSchedule(params)
.then((data: v2.FleetScheduleResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
22 changes: 22 additions & 0 deletions examples/v2/fleet-automation/DeleteFleetSchedule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Delete a schedule returns "Schedule successfully deleted." response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteFleetSchedule"] = true;
const apiInstance = new v2.FleetAutomationApi(configuration);

const params: v2.FleetAutomationApiDeleteFleetScheduleRequest = {
id: "id",
};

apiInstance
.deleteFleetSchedule(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
7 changes: 2 additions & 5 deletions examples/v2/fleet-automation/GetFleetDeployment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Get a deployment by ID returns "OK" response
* Get a configuration deployment by ID returns "OK" response
*/

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

// there is a valid "deployment" in the system
const DEPLOYMENT_ID = process.env.DEPLOYMENT_ID as string;

const params: v2.FleetAutomationApiGetFleetDeploymentRequest = {
deploymentId: DEPLOYMENT_ID,
deploymentId: "deployment_id",
};

apiInstance
Expand Down
25 changes: 25 additions & 0 deletions examples/v2/fleet-automation/GetFleetDeployment_1482493803.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Get a deployment by ID returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getFleetDeployment"] = true;
const apiInstance = new v2.FleetAutomationApi(configuration);

// there is a valid "deployment" in the system
const DEPLOYMENT_ID = process.env.DEPLOYMENT_ID as string;

const params: v2.FleetAutomationApiGetFleetDeploymentRequest = {
deploymentId: DEPLOYMENT_ID,
};

apiInstance
.getFleetDeployment(params)
.then((data: v2.FleetDeploymentResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
22 changes: 22 additions & 0 deletions examples/v2/fleet-automation/GetFleetSchedule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Get a schedule by ID returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getFleetSchedule"] = true;
const apiInstance = new v2.FleetAutomationApi(configuration);

const params: v2.FleetAutomationApiGetFleetScheduleRequest = {
id: "id",
};

apiInstance
.getFleetSchedule(params)
.then((data: v2.FleetScheduleResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
18 changes: 18 additions & 0 deletions examples/v2/fleet-automation/ListFleetAgentVersions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* List all available Agent versions returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listFleetAgentVersions"] = true;
const apiInstance = new v2.FleetAutomationApi(configuration);

apiInstance
.listFleetAgentVersions()
.then((data: v2.FleetAgentVersionsResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
18 changes: 18 additions & 0 deletions examples/v2/fleet-automation/ListFleetSchedules.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* List all schedules returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listFleetSchedules"] = true;
const apiInstance = new v2.FleetAutomationApi(configuration);

apiInstance
.listFleetSchedules()
.then((data: v2.FleetSchedulesResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
22 changes: 22 additions & 0 deletions examples/v2/fleet-automation/TriggerFleetSchedule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Trigger a schedule deployment returns "CREATED - Deployment successfully created and started." response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.triggerFleetSchedule"] = true;
const apiInstance = new v2.FleetAutomationApi(configuration);

const params: v2.FleetAutomationApiTriggerFleetScheduleRequest = {
id: "id",
};

apiInstance
.triggerFleetSchedule(params)
.then((data: v2.FleetDeploymentResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
39 changes: 39 additions & 0 deletions examples/v2/fleet-automation/UpdateFleetSchedule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Update a schedule returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateFleetSchedule"] = true;
const apiInstance = new v2.FleetAutomationApi(configuration);

const params: v2.FleetAutomationApiUpdateFleetScheduleRequest = {
body: {
data: {
attributes: {
name: "Weekly Production Agent Updates",
query: "env:prod AND service:web",
rule: {
daysOfWeek: ["Mon", "Wed", "Fri"],
maintenanceWindowDuration: 1200,
startMaintenanceWindow: "02:00",
timezone: "America/New_York",
},
status: "active",
versionToLatest: 0,
},
type: "schedule",
},
},
id: "id",
};

apiInstance
.updateFleetSchedule(params)
.then((data: v2.FleetScheduleResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
60 changes: 60 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2340,6 +2340,9 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
"v1.Validate": {
"operationResponseType": "AuthenticationValidationResponse",
},
"v2.ListFleetAgentVersions": {
"operationResponseType": "FleetAgentVersionsResponse",
},
"v2.ListFleetDeployments": {
"pageSize": {
"type": "number",
Expand All @@ -2358,11 +2361,26 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
},
"operationResponseType": "FleetDeploymentResponse",
},
"v2.CreateFleetDeploymentUpgrade": {
"body": {
"type": "FleetDeploymentPackageUpgradeCreateRequest",
"format": "",
},
"operationResponseType": "FleetDeploymentResponse",
},
"v2.GetFleetDeployment": {
"deploymentId": {
"type": "string",
"format": "",
},
"limit": {
"type": "number",
"format": "int64",
},
"page": {
"type": "number",
"format": "int64",
},
"operationResponseType": "FleetDeploymentResponse",
},
"v2.CancelFleetDeployment": {
Expand All @@ -2372,6 +2390,48 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
},
"operationResponseType": "{}",
},
"v2.ListFleetSchedules": {
"operationResponseType": "FleetSchedulesResponse",
},
"v2.CreateFleetSchedule": {
"body": {
"type": "FleetScheduleCreateRequest",
"format": "",
},
"operationResponseType": "FleetScheduleResponse",
},
"v2.GetFleetSchedule": {
"id": {
"type": "string",
"format": "",
},
"operationResponseType": "FleetScheduleResponse",
},
"v2.DeleteFleetSchedule": {
"id": {
"type": "string",
"format": "",
},
"operationResponseType": "{}",
},
"v2.UpdateFleetSchedule": {
"id": {
"type": "string",
"format": "",
},
"body": {
"type": "FleetSchedulePatchRequest",
"format": "",
},
"operationResponseType": "FleetScheduleResponse",
},
"v2.TriggerFleetSchedule": {
"id": {
"type": "string",
"format": "",
},
"operationResponseType": "FleetDeploymentResponse",
},
"v2.ListDatastores": {
"operationResponseType": "DatastoreArray",
},
Expand Down
Loading