Skip to content

Commit 4049ca0

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit b7d1caa of spec repo
1 parent 1920b15 commit 4049ca0

File tree

16 files changed

+3699
-0
lines changed

16 files changed

+3699
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 419 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Get detailed information about an agent returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.FleetAutomationApi;
6+
import com.datadog.api.client.v2.model.FleetAgentInfoResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.getFleetAgentInfo", true);
12+
FleetAutomationApi apiInstance = new FleetAutomationApi(defaultClient);
13+
14+
try {
15+
FleetAgentInfoResponse result = apiInstance.getFleetAgentInfo("agent_key");
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling FleetAutomationApi#getFleetAgentInfo");
19+
System.err.println("Status code: " + e.getCode());
20+
System.err.println("Reason: " + e.getResponseBody());
21+
System.err.println("Response headers: " + e.getResponseHeaders());
22+
e.printStackTrace();
23+
}
24+
}
25+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ public class ApiClient {
692692
put("v2.createFleetDeploymentUpgrade", false);
693693
put("v2.createFleetSchedule", false);
694694
put("v2.deleteFleetSchedule", false);
695+
put("v2.getFleetAgentInfo", false);
695696
put("v2.getFleetDeployment", false);
696697
put("v2.getFleetSchedule", false);
697698
put("v2.listFleetAgentVersions", false);

src/main/java/com/datadog/api/client/v2/api/FleetAutomationApi.java

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.datadog.api.client.ApiException;
55
import com.datadog.api.client.ApiResponse;
66
import com.datadog.api.client.Pair;
7+
import com.datadog.api.client.v2.model.FleetAgentInfoResponse;
78
import com.datadog.api.client.v2.model.FleetAgentVersionsResponse;
89
import com.datadog.api.client.v2.model.FleetDeploymentConfigureCreateRequest;
910
import com.datadog.api.client.v2.model.FleetDeploymentPackageUpgradeCreateRequest;
@@ -855,6 +856,164 @@ public CompletableFuture<ApiResponse<Void>> deleteFleetScheduleWithHttpInfoAsync
855856
null);
856857
}
857858

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&lt;FleetAgentInfoResponse&gt;
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&lt;FleetAgentInfoResponse&gt;
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&lt;ApiResponse&lt;FleetAgentInfoResponse&gt;&gt;
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+
8581017
/** Manage optional parameters to getFleetDeployment. */
8591018
public static class GetFleetDeploymentOptionalParameters {
8601019
private Long limit;

0 commit comments

Comments
 (0)