@@ -23,6 +23,7 @@ import {
2323
2424import { TypingInfo } from "./models/TypingInfo" ;
2525import { APIErrorResponse } from "./models/APIErrorResponse" ;
26+ import { FleetAgentInfoResponse } from "./models/FleetAgentInfoResponse" ;
2627import { FleetAgentVersionsResponse } from "./models/FleetAgentVersionsResponse" ;
2728import { FleetDeploymentConfigureCreateRequest } from "./models/FleetDeploymentConfigureCreateRequest" ;
2829import { 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+
14801603export 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:
0 commit comments