Skip to content

Commit cd4df54

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit b7d1caa of spec repo
1 parent b7b888c commit cd4df54

19 files changed

+1588
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 419 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Get detailed information about an agent returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getFleetAgentInfo"] = true;
9+
const apiInstance = new v2.FleetAutomationApi(configuration);
10+
11+
const params: v2.FleetAutomationApiGetFleetAgentInfoRequest = {
12+
agentKey: "agent_key",
13+
};
14+
15+
apiInstance
16+
.getFleetAgentInfo(params)
17+
.then((data: v2.FleetAgentInfoResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2343,6 +2343,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
23432343
"v2.ListFleetAgentVersions": {
23442344
"operationResponseType": "FleetAgentVersionsResponse",
23452345
},
2346+
"v2.GetFleetAgentInfo": {
2347+
"agentKey": {
2348+
"type": "string",
2349+
"format": "",
2350+
},
2351+
"operationResponseType": "FleetAgentInfoResponse",
2352+
},
23462353
"v2.ListFleetDeployments": {
23472354
"pageSize": {
23482355
"type": "number",

features/v2/fleet_automation.feature

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,30 @@ Feature: Fleet Automation
152152
When the request is sent
153153
Then the response status is 200 OK
154154

155+
@generated @skip @team:DataDog/fleet-automation
156+
Scenario: Get detailed information about an agent returns "Bad Request" response
157+
Given operation "GetFleetAgentInfo" enabled
158+
And new "GetFleetAgentInfo" request
159+
And request contains "agent_key" parameter from "REPLACE.ME"
160+
When the request is sent
161+
Then the response status is 400 Bad Request
162+
163+
@generated @skip @team:DataDog/fleet-automation
164+
Scenario: Get detailed information about an agent returns "Not Found" response
165+
Given operation "GetFleetAgentInfo" enabled
166+
And new "GetFleetAgentInfo" request
167+
And request contains "agent_key" parameter from "REPLACE.ME"
168+
When the request is sent
169+
Then the response status is 404 Not Found
170+
171+
@generated @skip @team:DataDog/fleet-automation
172+
Scenario: Get detailed information about an agent returns "OK" response
173+
Given operation "GetFleetAgentInfo" enabled
174+
And new "GetFleetAgentInfo" request
175+
And request contains "agent_key" parameter from "REPLACE.ME"
176+
When the request is sent
177+
Then the response status is 200 OK
178+
155179
@generated @skip @team:DataDog/fleet-automation
156180
Scenario: List all available Agent versions returns "Bad Request" response
157181
Given operation "ListFleetAgentVersions" enabled

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
"type": "safe"
66
}
77
},
8+
"GetFleetAgentInfo": {
9+
"tag": "Fleet Automation",
10+
"undo": {
11+
"type": "safe"
12+
}
13+
},
814
"ListFleetDeployments": {
915
"tag": "Fleet Automation",
1016
"undo": {

packages/datadog-api-client-common/configuration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ export function createConfiguration(
227227
"v2.createFleetDeploymentUpgrade": false,
228228
"v2.createFleetSchedule": false,
229229
"v2.deleteFleetSchedule": false,
230+
"v2.getFleetAgentInfo": false,
230231
"v2.getFleetDeployment": false,
231232
"v2.getFleetSchedule": false,
232233
"v2.listFleetAgentVersions": false,

packages/datadog-api-client-v2/apis/FleetAutomationApi.ts

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { ObjectSerializer } from "../models/ObjectSerializer";
1717
import { ApiException } from "../../datadog-api-client-common/exception";
1818

1919
import { APIErrorResponse } from "../models/APIErrorResponse";
20+
import { FleetAgentInfoResponse } from "../models/FleetAgentInfoResponse";
2021
import { FleetAgentVersionsResponse } from "../models/FleetAgentVersionsResponse";
2122
import { FleetDeploymentConfigureCreateRequest } from "../models/FleetDeploymentConfigureCreateRequest";
2223
import { FleetDeploymentPackageUpgradeCreateRequest } from "../models/FleetDeploymentPackageUpgradeCreateRequest";
@@ -255,6 +256,44 @@ export class FleetAutomationApiRequestFactory extends BaseAPIRequestFactory {
255256
return requestContext;
256257
}
257258

259+
public async getFleetAgentInfo(
260+
agentKey: string,
261+
_options?: Configuration
262+
): Promise<RequestContext> {
263+
const _config = _options || this.configuration;
264+
265+
logger.warn("Using unstable operation 'getFleetAgentInfo'");
266+
if (!_config.unstableOperations["v2.getFleetAgentInfo"]) {
267+
throw new Error("Unstable operation 'getFleetAgentInfo' is disabled");
268+
}
269+
270+
// verify required parameter 'agentKey' is not null or undefined
271+
if (agentKey === null || agentKey === undefined) {
272+
throw new RequiredError("agentKey", "getFleetAgentInfo");
273+
}
274+
275+
// Path Params
276+
const localVarPath = "/api/unstable/fleet/agents/{agent_key}".replace(
277+
"{agent_key}",
278+
encodeURIComponent(String(agentKey))
279+
);
280+
281+
// Make Request Context
282+
const requestContext = _config
283+
.getServer("v2.FleetAutomationApi.getFleetAgentInfo")
284+
.makeRequestContext(localVarPath, HttpMethod.GET);
285+
requestContext.setHeaderParam("Accept", "application/json");
286+
requestContext.setHttpConfig(_config.httpConfig);
287+
288+
// Apply auth methods
289+
applySecurityAuthentication(_config, requestContext, [
290+
"apiKeyAuth",
291+
"appKeyAuth",
292+
]);
293+
294+
return requestContext;
295+
}
296+
258297
public async getFleetDeployment(
259298
deploymentId: string,
260299
limit?: number,
@@ -848,6 +887,70 @@ export class FleetAutomationApiResponseProcessor {
848887
);
849888
}
850889

890+
/**
891+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
892+
* to the expected objects
893+
*
894+
* @params response Response returned by the server for a request to getFleetAgentInfo
895+
* @throws ApiException if the response code was not in [200, 299]
896+
*/
897+
public async getFleetAgentInfo(
898+
response: ResponseContext
899+
): Promise<FleetAgentInfoResponse> {
900+
const contentType = ObjectSerializer.normalizeMediaType(
901+
response.headers["content-type"]
902+
);
903+
if (response.httpStatusCode === 200) {
904+
const body: FleetAgentInfoResponse = ObjectSerializer.deserialize(
905+
ObjectSerializer.parse(await response.body.text(), contentType),
906+
"FleetAgentInfoResponse"
907+
) as FleetAgentInfoResponse;
908+
return body;
909+
}
910+
if (
911+
response.httpStatusCode === 400 ||
912+
response.httpStatusCode === 401 ||
913+
response.httpStatusCode === 403 ||
914+
response.httpStatusCode === 404 ||
915+
response.httpStatusCode === 429
916+
) {
917+
const bodyText = ObjectSerializer.parse(
918+
await response.body.text(),
919+
contentType
920+
);
921+
let body: APIErrorResponse;
922+
try {
923+
body = ObjectSerializer.deserialize(
924+
bodyText,
925+
"APIErrorResponse"
926+
) as APIErrorResponse;
927+
} catch (error) {
928+
logger.debug(`Got error deserializing error: ${error}`);
929+
throw new ApiException<APIErrorResponse>(
930+
response.httpStatusCode,
931+
bodyText
932+
);
933+
}
934+
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
935+
}
936+
937+
// Work around for missing responses in specification, e.g. for petstore.yaml
938+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
939+
const body: FleetAgentInfoResponse = ObjectSerializer.deserialize(
940+
ObjectSerializer.parse(await response.body.text(), contentType),
941+
"FleetAgentInfoResponse",
942+
""
943+
) as FleetAgentInfoResponse;
944+
return body;
945+
}
946+
947+
const body = (await response.body.text()) || "";
948+
throw new ApiException<string>(
949+
response.httpStatusCode,
950+
'Unknown API Status Code!\nBody: "' + body + '"'
951+
);
952+
}
953+
851954
/**
852955
* Unwraps the actual response sent by the server from the response context and deserializes the response content
853956
* to the expected objects
@@ -1335,6 +1438,14 @@ export interface FleetAutomationApiDeleteFleetScheduleRequest {
13351438
id: string;
13361439
}
13371440

1441+
export interface FleetAutomationApiGetFleetAgentInfoRequest {
1442+
/**
1443+
* The unique identifier (agent key) for the Datadog Agent.
1444+
* @type string
1445+
*/
1446+
agentKey: string;
1447+
}
1448+
13381449
export interface FleetAutomationApiGetFleetDeploymentRequest {
13391450
/**
13401451
* The unique identifier of the deployment to retrieve.
@@ -1560,6 +1671,33 @@ export class FleetAutomationApi {
15601671
});
15611672
}
15621673

1674+
/**
1675+
* Retrieve detailed information about a specific Datadog Agent.
1676+
*
1677+
* This endpoint returns comprehensive information about an agent including:
1678+
* - Agent details and metadata
1679+
* - Configured integrations organized by status (working, warning, error, missing)
1680+
* - Detected integrations
1681+
* - Configuration files and layers
1682+
* @param param The request object
1683+
*/
1684+
public getFleetAgentInfo(
1685+
param: FleetAutomationApiGetFleetAgentInfoRequest,
1686+
options?: Configuration
1687+
): Promise<FleetAgentInfoResponse> {
1688+
const requestContextPromise = this.requestFactory.getFleetAgentInfo(
1689+
param.agentKey,
1690+
options
1691+
);
1692+
return requestContextPromise.then((requestContext) => {
1693+
return this.configuration.httpApi
1694+
.send(requestContext)
1695+
.then((responseContext) => {
1696+
return this.responseProcessor.getFleetAgentInfo(responseContext);
1697+
});
1698+
});
1699+
}
1700+
15631701
/**
15641702
* Retrieve detailed information about a specific deployment using its unique identifier.
15651703
* This endpoint returns comprehensive information about a deployment, including:

packages/datadog-api-client-v2/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ export {
357357
FleetAutomationApiCreateFleetDeploymentUpgradeRequest,
358358
FleetAutomationApiCreateFleetScheduleRequest,
359359
FleetAutomationApiDeleteFleetScheduleRequest,
360+
FleetAutomationApiGetFleetAgentInfoRequest,
360361
FleetAutomationApiGetFleetDeploymentRequest,
361362
FleetAutomationApiGetFleetScheduleRequest,
362363
FleetAutomationApiListFleetDeploymentsRequest,
@@ -2197,10 +2198,17 @@ export { FlakyTestsSearchResponseMeta } from "./models/FlakyTestsSearchResponseM
21972198
export { FlakyTestsSearchSort } from "./models/FlakyTestsSearchSort";
21982199
export { FlakyTestStats } from "./models/FlakyTestStats";
21992200
export { FlakyTestType } from "./models/FlakyTestType";
2201+
export { FleetAgentInfo } from "./models/FleetAgentInfo";
2202+
export { FleetAgentInfoAttributes } from "./models/FleetAgentInfoAttributes";
2203+
export { FleetAgentInfoDetails } from "./models/FleetAgentInfoDetails";
2204+
export { FleetAgentInfoResourceType } from "./models/FleetAgentInfoResourceType";
2205+
export { FleetAgentInfoResponse } from "./models/FleetAgentInfoResponse";
22002206
export { FleetAgentVersion } from "./models/FleetAgentVersion";
22012207
export { FleetAgentVersionAttributes } from "./models/FleetAgentVersionAttributes";
22022208
export { FleetAgentVersionResourceType } from "./models/FleetAgentVersionResourceType";
22032209
export { FleetAgentVersionsResponse } from "./models/FleetAgentVersionsResponse";
2210+
export { FleetConfigurationFile } from "./models/FleetConfigurationFile";
2211+
export { FleetConfigurationLayer } from "./models/FleetConfigurationLayer";
22042212
export { FleetDeployment } from "./models/FleetDeployment";
22052213
export { FleetDeploymentAttributes } from "./models/FleetDeploymentAttributes";
22062214
export { FleetDeploymentConfigureAttributes } from "./models/FleetDeploymentConfigureAttributes";
@@ -2221,6 +2229,9 @@ export { FleetDeploymentResponseMeta } from "./models/FleetDeploymentResponseMet
22212229
export { FleetDeploymentsPage } from "./models/FleetDeploymentsPage";
22222230
export { FleetDeploymentsResponse } from "./models/FleetDeploymentsResponse";
22232231
export { FleetDeploymentsResponseMeta } from "./models/FleetDeploymentsResponseMeta";
2232+
export { FleetDetectedIntegration } from "./models/FleetDetectedIntegration";
2233+
export { FleetIntegrationDetails } from "./models/FleetIntegrationDetails";
2234+
export { FleetIntegrationsByStatus } from "./models/FleetIntegrationsByStatus";
22242235
export { FleetSchedule } from "./models/FleetSchedule";
22252236
export { FleetScheduleAttributes } from "./models/FleetScheduleAttributes";
22262237
export { FleetScheduleCreate } from "./models/FleetScheduleCreate";
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
import { FleetAgentInfoAttributes } from "./FleetAgentInfoAttributes";
7+
import { FleetAgentInfoResourceType } from "./FleetAgentInfoResourceType";
8+
9+
import { AttributeTypeMap } from "../../datadog-api-client-common/util";
10+
11+
/**
12+
* Represents detailed information about a specific Datadog Agent.
13+
*/
14+
export class FleetAgentInfo {
15+
/**
16+
* Attributes for agent information.
17+
*/
18+
"attributes": FleetAgentInfoAttributes;
19+
/**
20+
* The unique agent key identifier.
21+
*/
22+
"id": string;
23+
/**
24+
* The type of Agent info resource.
25+
*/
26+
"type": FleetAgentInfoResourceType;
27+
28+
/**
29+
* A container for additional, undeclared properties.
30+
* This is a holder for any undeclared properties as specified with
31+
* the 'additionalProperties' keyword in the OAS document.
32+
*/
33+
"additionalProperties"?: { [key: string]: any };
34+
35+
/**
36+
* @ignore
37+
*/
38+
"_unparsed"?: boolean;
39+
40+
/**
41+
* @ignore
42+
*/
43+
static readonly attributeTypeMap: AttributeTypeMap = {
44+
attributes: {
45+
baseName: "attributes",
46+
type: "FleetAgentInfoAttributes",
47+
required: true,
48+
},
49+
id: {
50+
baseName: "id",
51+
type: "string",
52+
required: true,
53+
},
54+
type: {
55+
baseName: "type",
56+
type: "FleetAgentInfoResourceType",
57+
required: true,
58+
},
59+
additionalProperties: {
60+
baseName: "additionalProperties",
61+
type: "{ [key: string]: any; }",
62+
},
63+
};
64+
65+
/**
66+
* @ignore
67+
*/
68+
static getAttributeTypeMap(): AttributeTypeMap {
69+
return FleetAgentInfo.attributeTypeMap;
70+
}
71+
72+
public constructor() {}
73+
}

0 commit comments

Comments
 (0)