Skip to content

Commit 487a069

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5f572cc of spec repo
1 parent d4302f9 commit 487a069

17 files changed

+1500
-0
lines changed

.generator/schemas/v2/openapi.yaml

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

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": {

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2353,6 +2353,13 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
23532353
"FleetAutomationApi.V2.ListFleetAgentVersions": {
23542354
operationResponseType: "FleetAgentVersionsResponse",
23552355
},
2356+
"FleetAutomationApi.V2.GetFleetAgentInfo": {
2357+
agentKey: {
2358+
type: "string",
2359+
format: "",
2360+
},
2361+
operationResponseType: "FleetAgentInfoResponse",
2362+
},
23562363
"FleetAutomationApi.V2.ListFleetDeployments": {
23572364
pageSize: {
23582365
type: "number",

services/fleet_automation/src/v2/FleetAutomationApi.ts

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323

2424
import { TypingInfo } from "./models/TypingInfo";
2525
import { APIErrorResponse } from "./models/APIErrorResponse";
26+
import { FleetAgentInfoResponse } from "./models/FleetAgentInfoResponse";
2627
import { FleetAgentVersionsResponse } from "./models/FleetAgentVersionsResponse";
2728
import { FleetDeploymentConfigureCreateRequest } from "./models/FleetDeploymentConfigureCreateRequest";
2829
import { FleetDeploymentPackageUpgradeCreateRequest } from "./models/FleetDeploymentPackageUpgradeCreateRequest";
@@ -331,6 +332,58 @@ export class FleetAutomationApiRequestFactory extends BaseAPIRequestFactory {
331332
return requestContext;
332333
}
333334

335+
public async getFleetAgentInfo(
336+
agentKey: string,
337+
_options?: Configuration,
338+
): Promise<RequestContext> {
339+
const _config = _options || this.configuration;
340+
341+
if (
342+
!_config.unstableOperations["FleetAutomationApi.v2.getFleetAgentInfo"]
343+
) {
344+
throw new Error(
345+
"Unstable operation 'getFleetAgentInfo' is disabled. Enable it by setting `configuration.unstableOperations['FleetAutomationApi.v2.getFleetAgentInfo'] = true`",
346+
);
347+
}
348+
349+
// verify required parameter 'agentKey' is not null or undefined
350+
if (agentKey === null || agentKey === undefined) {
351+
throw new RequiredError("agentKey", "getFleetAgentInfo");
352+
}
353+
354+
// Path Params
355+
const localVarPath = "/api/unstable/fleet/agents/{agent_key}".replace(
356+
"{agent_key}",
357+
encodeURIComponent(String(agentKey)),
358+
);
359+
360+
// Make Request Context
361+
const { server, overrides } = _config.getServerAndOverrides(
362+
"FleetAutomationApi.v2.getFleetAgentInfo",
363+
FleetAutomationApi.operationServers,
364+
);
365+
const requestContext = server.makeRequestContext(
366+
localVarPath,
367+
HttpMethod.GET,
368+
overrides,
369+
);
370+
requestContext.setHeaderParam("Accept", "application/json");
371+
requestContext.setHttpConfig(_config.httpConfig);
372+
373+
// Set User-Agent
374+
if (this.userAgent) {
375+
requestContext.setHeaderParam("User-Agent", this.userAgent);
376+
}
377+
378+
// Apply auth methods
379+
applySecurityAuthentication(_config, requestContext, [
380+
"apiKeyAuth",
381+
"appKeyAuth",
382+
]);
383+
384+
return requestContext;
385+
}
386+
334387
public async getFleetDeployment(
335388
deploymentId: string,
336389
limit?: number,
@@ -1004,6 +1057,68 @@ export class FleetAutomationApiResponseProcessor {
10041057
);
10051058
}
10061059

1060+
/**
1061+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
1062+
* to the expected objects
1063+
*
1064+
* @params response Response returned by the server for a request to getFleetAgentInfo
1065+
* @throws ApiException if the response code was not in [200, 299]
1066+
*/
1067+
public async getFleetAgentInfo(
1068+
response: ResponseContext,
1069+
): Promise<FleetAgentInfoResponse> {
1070+
const contentType = normalizeMediaType(response.headers["content-type"]);
1071+
if (response.httpStatusCode === 200) {
1072+
const body: FleetAgentInfoResponse = deserialize(
1073+
parse(await response.body.text(), contentType),
1074+
TypingInfo,
1075+
"FleetAgentInfoResponse",
1076+
) as FleetAgentInfoResponse;
1077+
return body;
1078+
}
1079+
if (
1080+
response.httpStatusCode === 400 ||
1081+
response.httpStatusCode === 401 ||
1082+
response.httpStatusCode === 403 ||
1083+
response.httpStatusCode === 404 ||
1084+
response.httpStatusCode === 429
1085+
) {
1086+
const bodyText = parse(await response.body.text(), contentType);
1087+
let body: APIErrorResponse;
1088+
try {
1089+
body = deserialize(
1090+
bodyText,
1091+
TypingInfo,
1092+
"APIErrorResponse",
1093+
) as APIErrorResponse;
1094+
} catch (error) {
1095+
logger.debug(`Got error deserializing error: ${error}`);
1096+
throw new ApiException<APIErrorResponse>(
1097+
response.httpStatusCode,
1098+
bodyText,
1099+
);
1100+
}
1101+
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
1102+
}
1103+
1104+
// Work around for missing responses in specification, e.g. for petstore.yaml
1105+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
1106+
const body: FleetAgentInfoResponse = deserialize(
1107+
parse(await response.body.text(), contentType),
1108+
TypingInfo,
1109+
"FleetAgentInfoResponse",
1110+
"",
1111+
) as FleetAgentInfoResponse;
1112+
return body;
1113+
}
1114+
1115+
const body = (await response.body.text()) || "";
1116+
throw new ApiException<string>(
1117+
response.httpStatusCode,
1118+
'Unknown API Status Code!\nBody: "' + body + '"',
1119+
);
1120+
}
1121+
10071122
/**
10081123
* Unwraps the actual response sent by the server from the response context and deserializes the response content
10091124
* to the expected objects
@@ -1477,6 +1592,14 @@ export interface FleetAutomationApiDeleteFleetScheduleRequest {
14771592
id: string;
14781593
}
14791594

1595+
export interface FleetAutomationApiGetFleetAgentInfoRequest {
1596+
/**
1597+
* The unique identifier (agent key) for the Datadog Agent.
1598+
* @type string
1599+
*/
1600+
agentKey: string;
1601+
}
1602+
14801603
export interface FleetAutomationApiGetFleetDeploymentRequest {
14811604
/**
14821605
* The unique identifier of the deployment to retrieve.
@@ -1705,6 +1828,32 @@ export class FleetAutomationApi {
17051828
});
17061829
}
17071830

1831+
/**
1832+
* Retrieve detailed information about a specific Datadog Agent.
1833+
* This endpoint returns comprehensive information about an agent including:
1834+
* - Agent details and metadata
1835+
* - Configured integrations organized by status (working, warning, error, missing)
1836+
* - Detected integrations
1837+
* - Configuration files and layers
1838+
* @param param The request object
1839+
*/
1840+
public getFleetAgentInfo(
1841+
param: FleetAutomationApiGetFleetAgentInfoRequest,
1842+
options?: Configuration,
1843+
): Promise<FleetAgentInfoResponse> {
1844+
const requestContextPromise = this.requestFactory.getFleetAgentInfo(
1845+
param.agentKey,
1846+
options,
1847+
);
1848+
return requestContextPromise.then((requestContext) => {
1849+
return this.configuration.httpApi
1850+
.send(requestContext)
1851+
.then((responseContext) => {
1852+
return this.responseProcessor.getFleetAgentInfo(responseContext);
1853+
});
1854+
});
1855+
}
1856+
17081857
/**
17091858
* Retrieve detailed information about a specific deployment using its unique identifier.
17101859
* This endpoint returns comprehensive information about a deployment, including:

services/fleet_automation/src/v2/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export {
44
FleetAutomationApiCreateFleetDeploymentUpgradeRequest,
55
FleetAutomationApiCreateFleetScheduleRequest,
66
FleetAutomationApiDeleteFleetScheduleRequest,
7+
FleetAutomationApiGetFleetAgentInfoRequest,
78
FleetAutomationApiGetFleetDeploymentRequest,
89
FleetAutomationApiGetFleetScheduleRequest,
910
FleetAutomationApiListFleetDeploymentsRequest,
@@ -13,10 +14,17 @@ export {
1314
} from "./FleetAutomationApi";
1415

1516
export { APIErrorResponse } from "./models/APIErrorResponse";
17+
export { FleetAgentInfo } from "./models/FleetAgentInfo";
18+
export { FleetAgentInfoAttributes } from "./models/FleetAgentInfoAttributes";
19+
export { FleetAgentInfoDetails } from "./models/FleetAgentInfoDetails";
20+
export { FleetAgentInfoResourceType } from "./models/FleetAgentInfoResourceType";
21+
export { FleetAgentInfoResponse } from "./models/FleetAgentInfoResponse";
1622
export { FleetAgentVersion } from "./models/FleetAgentVersion";
1723
export { FleetAgentVersionAttributes } from "./models/FleetAgentVersionAttributes";
1824
export { FleetAgentVersionResourceType } from "./models/FleetAgentVersionResourceType";
1925
export { FleetAgentVersionsResponse } from "./models/FleetAgentVersionsResponse";
26+
export { FleetConfigurationFile } from "./models/FleetConfigurationFile";
27+
export { FleetConfigurationLayer } from "./models/FleetConfigurationLayer";
2028
export { FleetDeployment } from "./models/FleetDeployment";
2129
export { FleetDeploymentAttributes } from "./models/FleetDeploymentAttributes";
2230
export { FleetDeploymentConfigureAttributes } from "./models/FleetDeploymentConfigureAttributes";
@@ -37,6 +45,9 @@ export { FleetDeploymentResponseMeta } from "./models/FleetDeploymentResponseMet
3745
export { FleetDeploymentsPage } from "./models/FleetDeploymentsPage";
3846
export { FleetDeploymentsResponse } from "./models/FleetDeploymentsResponse";
3947
export { FleetDeploymentsResponseMeta } from "./models/FleetDeploymentsResponseMeta";
48+
export { FleetDetectedIntegration } from "./models/FleetDetectedIntegration";
49+
export { FleetIntegrationDetails } from "./models/FleetIntegrationDetails";
50+
export { FleetIntegrationsByStatus } from "./models/FleetIntegrationsByStatus";
4051
export { FleetSchedule } from "./models/FleetSchedule";
4152
export { FleetScheduleAttributes } from "./models/FleetScheduleAttributes";
4253
export { FleetScheduleCreate } from "./models/FleetScheduleCreate";
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import { AttributeTypeMap } from "@datadog/datadog-api-client";
2+
3+
import { FleetAgentInfoAttributes } from "./FleetAgentInfoAttributes";
4+
import { FleetAgentInfoResourceType } from "./FleetAgentInfoResourceType";
5+
6+
/**
7+
* Represents detailed information about a specific Datadog Agent.
8+
*/
9+
export class FleetAgentInfo {
10+
/**
11+
* Attributes for agent information.
12+
*/
13+
"attributes": FleetAgentInfoAttributes;
14+
/**
15+
* The unique agent key identifier.
16+
*/
17+
"id": string;
18+
/**
19+
* The type of Agent info resource.
20+
*/
21+
"type": FleetAgentInfoResourceType;
22+
/**
23+
* A container for additional, undeclared properties.
24+
* This is a holder for any undeclared properties as specified with
25+
* the 'additionalProperties' keyword in the OAS document.
26+
*/
27+
"additionalProperties"?: { [key: string]: any };
28+
/**
29+
* @ignore
30+
*/
31+
"_unparsed"?: boolean;
32+
33+
/**
34+
* @ignore
35+
*/
36+
static readonly attributeTypeMap: AttributeTypeMap = {
37+
attributes: {
38+
baseName: "attributes",
39+
type: "FleetAgentInfoAttributes",
40+
required: true,
41+
},
42+
id: {
43+
baseName: "id",
44+
type: "string",
45+
required: true,
46+
},
47+
type: {
48+
baseName: "type",
49+
type: "FleetAgentInfoResourceType",
50+
required: true,
51+
},
52+
additionalProperties: {
53+
baseName: "additionalProperties",
54+
type: "{ [key: string]: any; }",
55+
},
56+
};
57+
58+
/**
59+
* @ignore
60+
*/
61+
static getAttributeTypeMap(): AttributeTypeMap {
62+
return FleetAgentInfo.attributeTypeMap;
63+
}
64+
65+
public constructor() {}
66+
}

0 commit comments

Comments
 (0)