@@ -481,6 +481,98 @@ func (a *FleetAutomationApi) DeleteFleetSchedule(ctx _context.Context, id string
481481 return localVarHTTPResponse , nil
482482}
483483
484+ // GetFleetAgentInfo Get detailed information about an agent.
485+ // Retrieve detailed information about a specific Datadog Agent.
486+ // This endpoint returns comprehensive information about an agent including:
487+ // - Agent details and metadata
488+ // - Configured integrations organized by status (working, warning, error, missing)
489+ // - Detected integrations
490+ // - Configuration files and layers
491+ func (a * FleetAutomationApi ) GetFleetAgentInfo (ctx _context.Context , agentKey string ) (FleetAgentInfoResponse , * _nethttp.Response , error ) {
492+ var (
493+ localVarHTTPMethod = _nethttp .MethodGet
494+ localVarPostBody interface {}
495+ localVarReturnValue FleetAgentInfoResponse
496+ )
497+
498+ operationId := "v2.GetFleetAgentInfo"
499+ isOperationEnabled := a .Client .Cfg .IsUnstableOperationEnabled (operationId )
500+ if ! isOperationEnabled {
501+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : _fmt .Sprintf ("Unstable operation '%s' is disabled" , operationId )}
502+ }
503+ if isOperationEnabled && a .Client .Cfg .Debug {
504+ _log .Printf ("WARNING: Using unstable operation '%s'" , operationId )
505+ }
506+
507+ localBasePath , err := a .Client .Cfg .ServerURLWithContext (ctx , "v2.FleetAutomationApi.GetFleetAgentInfo" )
508+ if err != nil {
509+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : err .Error ()}
510+ }
511+
512+ localVarPath := localBasePath + "/api/unstable/fleet/agents/{agent_key}"
513+ localVarPath = datadog .ReplacePathParameter (localVarPath , "{agent_key}" , _neturl .PathEscape (datadog .ParameterToString (agentKey , "" )))
514+
515+ localVarHeaderParams := make (map [string ]string )
516+ localVarQueryParams := _neturl.Values {}
517+ localVarFormParams := _neturl.Values {}
518+ localVarHeaderParams ["Accept" ] = "application/json"
519+
520+ if a .Client .Cfg .DelegatedTokenConfig != nil {
521+ err = datadog .UseDelegatedTokenAuth (ctx , & localVarHeaderParams , a .Client .Cfg .DelegatedTokenConfig )
522+ if err != nil {
523+ return localVarReturnValue , nil , err
524+ }
525+ } else {
526+ datadog .SetAuthKeys (
527+ ctx ,
528+ & localVarHeaderParams ,
529+ [2 ]string {"apiKeyAuth" , "DD-API-KEY" },
530+ [2 ]string {"appKeyAuth" , "DD-APPLICATION-KEY" },
531+ )
532+ }
533+ req , err := a .Client .PrepareRequest (ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , nil )
534+ if err != nil {
535+ return localVarReturnValue , nil , err
536+ }
537+
538+ localVarHTTPResponse , err := a .Client .CallAPI (req )
539+ if err != nil || localVarHTTPResponse == nil {
540+ return localVarReturnValue , localVarHTTPResponse , err
541+ }
542+
543+ localVarBody , err := datadog .ReadBody (localVarHTTPResponse )
544+ if err != nil {
545+ return localVarReturnValue , localVarHTTPResponse , err
546+ }
547+
548+ if localVarHTTPResponse .StatusCode >= 300 {
549+ newErr := datadog.GenericOpenAPIError {
550+ ErrorBody : localVarBody ,
551+ ErrorMessage : localVarHTTPResponse .Status ,
552+ }
553+ if localVarHTTPResponse .StatusCode == 400 || localVarHTTPResponse .StatusCode == 401 || localVarHTTPResponse .StatusCode == 403 || localVarHTTPResponse .StatusCode == 404 || localVarHTTPResponse .StatusCode == 429 {
554+ var v APIErrorResponse
555+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
556+ if err != nil {
557+ return localVarReturnValue , localVarHTTPResponse , newErr
558+ }
559+ newErr .ErrorModel = v
560+ }
561+ return localVarReturnValue , localVarHTTPResponse , newErr
562+ }
563+
564+ err = a .Client .Decode (& localVarReturnValue , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
565+ if err != nil {
566+ newErr := datadog.GenericOpenAPIError {
567+ ErrorBody : localVarBody ,
568+ ErrorMessage : err .Error (),
569+ }
570+ return localVarReturnValue , localVarHTTPResponse , newErr
571+ }
572+
573+ return localVarReturnValue , localVarHTTPResponse , nil
574+ }
575+
484576// GetFleetDeploymentOptionalParameters holds optional parameters for GetFleetDeployment.
485577type GetFleetDeploymentOptionalParameters struct {
486578 Limit * int64
@@ -746,11 +838,177 @@ func (a *FleetAutomationApi) ListFleetAgentVersions(ctx _context.Context) (Fleet
746838 return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : err .Error ()}
747839 }
748840
841+ localVarPath := localBasePath + "/api/unstable/fleet/agent_versions"
842+
843+ localVarHeaderParams := make (map [string ]string )
844+ localVarQueryParams := _neturl.Values {}
845+ localVarFormParams := _neturl.Values {}
846+ localVarHeaderParams ["Accept" ] = "application/json"
847+
848+ if a .Client .Cfg .DelegatedTokenConfig != nil {
849+ err = datadog .UseDelegatedTokenAuth (ctx , & localVarHeaderParams , a .Client .Cfg .DelegatedTokenConfig )
850+ if err != nil {
851+ return localVarReturnValue , nil , err
852+ }
853+ } else {
854+ datadog .SetAuthKeys (
855+ ctx ,
856+ & localVarHeaderParams ,
857+ [2 ]string {"apiKeyAuth" , "DD-API-KEY" },
858+ [2 ]string {"appKeyAuth" , "DD-APPLICATION-KEY" },
859+ )
860+ }
861+ req , err := a .Client .PrepareRequest (ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , nil )
862+ if err != nil {
863+ return localVarReturnValue , nil , err
864+ }
865+
866+ localVarHTTPResponse , err := a .Client .CallAPI (req )
867+ if err != nil || localVarHTTPResponse == nil {
868+ return localVarReturnValue , localVarHTTPResponse , err
869+ }
870+
871+ localVarBody , err := datadog .ReadBody (localVarHTTPResponse )
872+ if err != nil {
873+ return localVarReturnValue , localVarHTTPResponse , err
874+ }
875+
876+ if localVarHTTPResponse .StatusCode >= 300 {
877+ newErr := datadog.GenericOpenAPIError {
878+ ErrorBody : localVarBody ,
879+ ErrorMessage : localVarHTTPResponse .Status ,
880+ }
881+ if localVarHTTPResponse .StatusCode == 400 || localVarHTTPResponse .StatusCode == 401 || localVarHTTPResponse .StatusCode == 403 || localVarHTTPResponse .StatusCode == 404 || localVarHTTPResponse .StatusCode == 429 {
882+ var v APIErrorResponse
883+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
884+ if err != nil {
885+ return localVarReturnValue , localVarHTTPResponse , newErr
886+ }
887+ newErr .ErrorModel = v
888+ }
889+ return localVarReturnValue , localVarHTTPResponse , newErr
890+ }
891+
892+ err = a .Client .Decode (& localVarReturnValue , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
893+ if err != nil {
894+ newErr := datadog.GenericOpenAPIError {
895+ ErrorBody : localVarBody ,
896+ ErrorMessage : err .Error (),
897+ }
898+ return localVarReturnValue , localVarHTTPResponse , newErr
899+ }
900+
901+ return localVarReturnValue , localVarHTTPResponse , nil
902+ }
903+
904+ // ListFleetAgentsOptionalParameters holds optional parameters for ListFleetAgents.
905+ type ListFleetAgentsOptionalParameters struct {
906+ PageNumber * int64
907+ PageSize * int64
908+ SortAttribute * string
909+ SortDescending * bool
910+ Tags * string
911+ Filter * string
912+ }
913+
914+ // NewListFleetAgentsOptionalParameters creates an empty struct for parameters.
915+ func NewListFleetAgentsOptionalParameters () * ListFleetAgentsOptionalParameters {
916+ this := ListFleetAgentsOptionalParameters {}
917+ return & this
918+ }
919+
920+ // WithPageNumber sets the corresponding parameter name and returns the struct.
921+ func (r * ListFleetAgentsOptionalParameters ) WithPageNumber (pageNumber int64 ) * ListFleetAgentsOptionalParameters {
922+ r .PageNumber = & pageNumber
923+ return r
924+ }
925+
926+ // WithPageSize sets the corresponding parameter name and returns the struct.
927+ func (r * ListFleetAgentsOptionalParameters ) WithPageSize (pageSize int64 ) * ListFleetAgentsOptionalParameters {
928+ r .PageSize = & pageSize
929+ return r
930+ }
931+
932+ // WithSortAttribute sets the corresponding parameter name and returns the struct.
933+ func (r * ListFleetAgentsOptionalParameters ) WithSortAttribute (sortAttribute string ) * ListFleetAgentsOptionalParameters {
934+ r .SortAttribute = & sortAttribute
935+ return r
936+ }
937+
938+ // WithSortDescending sets the corresponding parameter name and returns the struct.
939+ func (r * ListFleetAgentsOptionalParameters ) WithSortDescending (sortDescending bool ) * ListFleetAgentsOptionalParameters {
940+ r .SortDescending = & sortDescending
941+ return r
942+ }
943+
944+ // WithTags sets the corresponding parameter name and returns the struct.
945+ func (r * ListFleetAgentsOptionalParameters ) WithTags (tags string ) * ListFleetAgentsOptionalParameters {
946+ r .Tags = & tags
947+ return r
948+ }
949+
950+ // WithFilter sets the corresponding parameter name and returns the struct.
951+ func (r * ListFleetAgentsOptionalParameters ) WithFilter (filter string ) * ListFleetAgentsOptionalParameters {
952+ r .Filter = & filter
953+ return r
954+ }
955+
956+ // ListFleetAgents List all Datadog Agents.
957+ // Retrieve a paginated list of all Datadog Agents.
958+ // This endpoint returns a paginated list of all Datadog Agents with support for pagination, sorting, and filtering.
959+ // Use the `page_number` and `page_size` query parameters to paginate through results.
960+ func (a * FleetAutomationApi ) ListFleetAgents (ctx _context.Context , o ... ListFleetAgentsOptionalParameters ) (FleetAgentsResponse , * _nethttp.Response , error ) {
961+ var (
962+ localVarHTTPMethod = _nethttp .MethodGet
963+ localVarPostBody interface {}
964+ localVarReturnValue FleetAgentsResponse
965+ optionalParams ListFleetAgentsOptionalParameters
966+ )
967+
968+ if len (o ) > 1 {
969+ return localVarReturnValue , nil , datadog .ReportError ("only one argument of type ListFleetAgentsOptionalParameters is allowed" )
970+ }
971+ if len (o ) == 1 {
972+ optionalParams = o [0 ]
973+ }
974+
975+ operationId := "v2.ListFleetAgents"
976+ isOperationEnabled := a .Client .Cfg .IsUnstableOperationEnabled (operationId )
977+ if ! isOperationEnabled {
978+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : _fmt .Sprintf ("Unstable operation '%s' is disabled" , operationId )}
979+ }
980+ if isOperationEnabled && a .Client .Cfg .Debug {
981+ _log .Printf ("WARNING: Using unstable operation '%s'" , operationId )
982+ }
983+
984+ localBasePath , err := a .Client .Cfg .ServerURLWithContext (ctx , "v2.FleetAutomationApi.ListFleetAgents" )
985+ if err != nil {
986+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : err .Error ()}
987+ }
988+
749989 localVarPath := localBasePath + "/api/unstable/fleet/agents"
750990
751991 localVarHeaderParams := make (map [string ]string )
752992 localVarQueryParams := _neturl.Values {}
753993 localVarFormParams := _neturl.Values {}
994+ if optionalParams .PageNumber != nil {
995+ localVarQueryParams .Add ("page_number" , datadog .ParameterToString (* optionalParams .PageNumber , "" ))
996+ }
997+ if optionalParams .PageSize != nil {
998+ localVarQueryParams .Add ("page_size" , datadog .ParameterToString (* optionalParams .PageSize , "" ))
999+ }
1000+ if optionalParams .SortAttribute != nil {
1001+ localVarQueryParams .Add ("sort_attribute" , datadog .ParameterToString (* optionalParams .SortAttribute , "" ))
1002+ }
1003+ if optionalParams .SortDescending != nil {
1004+ localVarQueryParams .Add ("sort_descending" , datadog .ParameterToString (* optionalParams .SortDescending , "" ))
1005+ }
1006+ if optionalParams .Tags != nil {
1007+ localVarQueryParams .Add ("tags" , datadog .ParameterToString (* optionalParams .Tags , "" ))
1008+ }
1009+ if optionalParams .Filter != nil {
1010+ localVarQueryParams .Add ("filter" , datadog .ParameterToString (* optionalParams .Filter , "" ))
1011+ }
7541012 localVarHeaderParams ["Accept" ] = "application/json"
7551013
7561014 if a .Client .Cfg .DelegatedTokenConfig != nil {
0 commit comments