|
4 | 4 | import com.datadog.api.client.ApiException; |
5 | 5 | import com.datadog.api.client.ApiResponse; |
6 | 6 | import com.datadog.api.client.Pair; |
| 7 | +import com.datadog.api.client.v2.model.FleetAgentInfoResponse; |
7 | 8 | import com.datadog.api.client.v2.model.FleetAgentVersionsResponse; |
8 | 9 | import com.datadog.api.client.v2.model.FleetDeploymentConfigureCreateRequest; |
9 | 10 | import com.datadog.api.client.v2.model.FleetDeploymentPackageUpgradeCreateRequest; |
@@ -855,6 +856,164 @@ public CompletableFuture<ApiResponse<Void>> deleteFleetScheduleWithHttpInfoAsync |
855 | 856 | null); |
856 | 857 | } |
857 | 858 |
|
| 859 | + /** |
| 860 | + * Get detailed information about an agent. |
| 861 | + * |
| 862 | + * <p>See {@link #getFleetAgentInfoWithHttpInfo}. |
| 863 | + * |
| 864 | + * @param agentKey The unique identifier (agent key) for the Datadog Agent. (required) |
| 865 | + * @return FleetAgentInfoResponse |
| 866 | + * @throws ApiException if fails to make API call |
| 867 | + */ |
| 868 | + public FleetAgentInfoResponse getFleetAgentInfo(String agentKey) throws ApiException { |
| 869 | + return getFleetAgentInfoWithHttpInfo(agentKey).getData(); |
| 870 | + } |
| 871 | + |
| 872 | + /** |
| 873 | + * Get detailed information about an agent. |
| 874 | + * |
| 875 | + * <p>See {@link #getFleetAgentInfoWithHttpInfoAsync}. |
| 876 | + * |
| 877 | + * @param agentKey The unique identifier (agent key) for the Datadog Agent. (required) |
| 878 | + * @return CompletableFuture<FleetAgentInfoResponse> |
| 879 | + */ |
| 880 | + public CompletableFuture<FleetAgentInfoResponse> getFleetAgentInfoAsync(String agentKey) { |
| 881 | + return getFleetAgentInfoWithHttpInfoAsync(agentKey) |
| 882 | + .thenApply( |
| 883 | + response -> { |
| 884 | + return response.getData(); |
| 885 | + }); |
| 886 | + } |
| 887 | + |
| 888 | + /** |
| 889 | + * Retrieve detailed information about a specific Datadog Agent. |
| 890 | + * |
| 891 | + * <p>This endpoint returns comprehensive information about an agent including: - Agent details |
| 892 | + * and metadata - Configured integrations organized by status (working, warning, error, missing) - |
| 893 | + * Detected integrations - Configuration files and layers |
| 894 | + * |
| 895 | + * @param agentKey The unique identifier (agent key) for the Datadog Agent. (required) |
| 896 | + * @return ApiResponse<FleetAgentInfoResponse> |
| 897 | + * @throws ApiException if fails to make API call |
| 898 | + * @http.response.details |
| 899 | + * <table border="1"> |
| 900 | + * <caption>Response details</caption> |
| 901 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 902 | + * <tr><td> 200 </td><td> OK </td><td> - </td></tr> |
| 903 | + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> |
| 904 | + * <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr> |
| 905 | + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> |
| 906 | + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> |
| 907 | + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> |
| 908 | + * </table> |
| 909 | + */ |
| 910 | + public ApiResponse<FleetAgentInfoResponse> getFleetAgentInfoWithHttpInfo(String agentKey) |
| 911 | + throws ApiException { |
| 912 | + // Check if unstable operation is enabled |
| 913 | + String operationId = "getFleetAgentInfo"; |
| 914 | + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { |
| 915 | + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); |
| 916 | + } else { |
| 917 | + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); |
| 918 | + } |
| 919 | + Object localVarPostBody = null; |
| 920 | + |
| 921 | + // verify the required parameter 'agentKey' is set |
| 922 | + if (agentKey == null) { |
| 923 | + throw new ApiException( |
| 924 | + 400, "Missing the required parameter 'agentKey' when calling getFleetAgentInfo"); |
| 925 | + } |
| 926 | + // create path and map variables |
| 927 | + String localVarPath = |
| 928 | + "/api/unstable/fleet/agents/{agent_key}" |
| 929 | + .replaceAll("\\{" + "agent_key" + "\\}", apiClient.escapeString(agentKey.toString())); |
| 930 | + |
| 931 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 932 | + |
| 933 | + Invocation.Builder builder = |
| 934 | + apiClient.createBuilder( |
| 935 | + "v2.FleetAutomationApi.getFleetAgentInfo", |
| 936 | + localVarPath, |
| 937 | + new ArrayList<Pair>(), |
| 938 | + localVarHeaderParams, |
| 939 | + new HashMap<String, String>(), |
| 940 | + new String[] {"application/json"}, |
| 941 | + new String[] {"apiKeyAuth", "appKeyAuth"}); |
| 942 | + return apiClient.invokeAPI( |
| 943 | + "GET", |
| 944 | + builder, |
| 945 | + localVarHeaderParams, |
| 946 | + new String[] {}, |
| 947 | + localVarPostBody, |
| 948 | + new HashMap<String, Object>(), |
| 949 | + false, |
| 950 | + new GenericType<FleetAgentInfoResponse>() {}); |
| 951 | + } |
| 952 | + |
| 953 | + /** |
| 954 | + * Get detailed information about an agent. |
| 955 | + * |
| 956 | + * <p>See {@link #getFleetAgentInfoWithHttpInfo}. |
| 957 | + * |
| 958 | + * @param agentKey The unique identifier (agent key) for the Datadog Agent. (required) |
| 959 | + * @return CompletableFuture<ApiResponse<FleetAgentInfoResponse>> |
| 960 | + */ |
| 961 | + public CompletableFuture<ApiResponse<FleetAgentInfoResponse>> getFleetAgentInfoWithHttpInfoAsync( |
| 962 | + String agentKey) { |
| 963 | + // Check if unstable operation is enabled |
| 964 | + String operationId = "getFleetAgentInfo"; |
| 965 | + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { |
| 966 | + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); |
| 967 | + } else { |
| 968 | + CompletableFuture<ApiResponse<FleetAgentInfoResponse>> result = new CompletableFuture<>(); |
| 969 | + result.completeExceptionally( |
| 970 | + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); |
| 971 | + return result; |
| 972 | + } |
| 973 | + Object localVarPostBody = null; |
| 974 | + |
| 975 | + // verify the required parameter 'agentKey' is set |
| 976 | + if (agentKey == null) { |
| 977 | + CompletableFuture<ApiResponse<FleetAgentInfoResponse>> result = new CompletableFuture<>(); |
| 978 | + result.completeExceptionally( |
| 979 | + new ApiException( |
| 980 | + 400, "Missing the required parameter 'agentKey' when calling getFleetAgentInfo")); |
| 981 | + return result; |
| 982 | + } |
| 983 | + // create path and map variables |
| 984 | + String localVarPath = |
| 985 | + "/api/unstable/fleet/agents/{agent_key}" |
| 986 | + .replaceAll("\\{" + "agent_key" + "\\}", apiClient.escapeString(agentKey.toString())); |
| 987 | + |
| 988 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 989 | + |
| 990 | + Invocation.Builder builder; |
| 991 | + try { |
| 992 | + builder = |
| 993 | + apiClient.createBuilder( |
| 994 | + "v2.FleetAutomationApi.getFleetAgentInfo", |
| 995 | + localVarPath, |
| 996 | + new ArrayList<Pair>(), |
| 997 | + localVarHeaderParams, |
| 998 | + new HashMap<String, String>(), |
| 999 | + new String[] {"application/json"}, |
| 1000 | + new String[] {"apiKeyAuth", "appKeyAuth"}); |
| 1001 | + } catch (ApiException ex) { |
| 1002 | + CompletableFuture<ApiResponse<FleetAgentInfoResponse>> result = new CompletableFuture<>(); |
| 1003 | + result.completeExceptionally(ex); |
| 1004 | + return result; |
| 1005 | + } |
| 1006 | + return apiClient.invokeAPIAsync( |
| 1007 | + "GET", |
| 1008 | + builder, |
| 1009 | + localVarHeaderParams, |
| 1010 | + new String[] {}, |
| 1011 | + localVarPostBody, |
| 1012 | + new HashMap<String, Object>(), |
| 1013 | + false, |
| 1014 | + new GenericType<FleetAgentInfoResponse>() {}); |
| 1015 | + } |
| 1016 | + |
858 | 1017 | /** Manage optional parameters to getFleetDeployment. */ |
859 | 1018 | public static class GetFleetDeploymentOptionalParameters { |
860 | 1019 | private Long limit; |
|
0 commit comments