Skip to content

Commit 929e0a1

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5f572cc of spec repo
1 parent 1920b15 commit 929e0a1

File tree

16 files changed

+3697
-0
lines changed

16 files changed

+3697
-0
lines changed

.generator/schemas/v2/openapi.yaml

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

0 commit comments

Comments
 (0)