Skip to content

Commit 6edf774

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add GET /api/v2/apm/services endpoint to public documentation (#3303)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 1f13952 commit 6edf774

File tree

13 files changed

+1012
-67
lines changed

13 files changed

+1012
-67
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 66 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51360,6 +51360,49 @@ components:
5136051360
$ref: '#/components/schemas/ServiceDefinitionData'
5136151361
type: array
5136251362
type: object
51363+
ServiceList:
51364+
properties:
51365+
data:
51366+
$ref: '#/components/schemas/ServiceListData'
51367+
type: object
51368+
ServiceListData:
51369+
properties:
51370+
attributes:
51371+
$ref: '#/components/schemas/ServiceListDataAttributes'
51372+
id:
51373+
type: string
51374+
type:
51375+
$ref: '#/components/schemas/ServiceListDataType'
51376+
required:
51377+
- type
51378+
type: object
51379+
ServiceListDataAttributes:
51380+
properties:
51381+
metadata:
51382+
items:
51383+
$ref: '#/components/schemas/ServiceListDataAttributesMetadataItems'
51384+
type: array
51385+
services:
51386+
items:
51387+
type: string
51388+
type: array
51389+
type: object
51390+
ServiceListDataAttributesMetadataItems:
51391+
properties:
51392+
isTraced:
51393+
type: boolean
51394+
isUsm:
51395+
type: boolean
51396+
type: object
51397+
ServiceListDataType:
51398+
default: services_list
51399+
description: Services list resource type.
51400+
enum:
51401+
- services_list
51402+
example: services_list
51403+
type: string
51404+
x-enum-varnames:
51405+
- SERVICES_LIST
5136351406
ServiceNowBasicAuth:
5136451407
description: The definition of the `ServiceNowBasicAuth` object.
5136551408
properties:
@@ -61622,6 +61665,26 @@ paths:
6162261665
permissions:
6162361666
- apm_retention_filter_write
6162461667
- apm_pipelines_write
61668+
/api/v2/apm/services:
61669+
get:
61670+
operationId: GetServiceList
61671+
responses:
61672+
'200':
61673+
content:
61674+
application/json:
61675+
schema:
61676+
$ref: '#/components/schemas/ServiceList'
61677+
description: OK
61678+
'429':
61679+
$ref: '#/components/responses/TooManyRequestsResponse'
61680+
security:
61681+
- apiKeyAuth: []
61682+
appKeyAuth: []
61683+
- AuthZ:
61684+
- apm_read
61685+
summary: Get service list
61686+
tags:
61687+
- APM
6162561688
/api/v2/app-builder/apps:
6162661689
delete:
6162761690
description: Delete multiple apps in a single request from a list of app IDs.
@@ -69355,9 +69418,6 @@ paths:
6935569418
operator: OR
6935669419
permissions:
6935769420
- incident_read
69358-
x-unstable: '**Note**: This endpoint is in Preview.
69359-
69360-
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6936169421
post:
6936269422
description: Create an impact for an incident.
6936369423
operationId: CreateIncidentImpact
@@ -69401,9 +69461,6 @@ paths:
6940169461
operator: OR
6940269462
permissions:
6940369463
- incident_write
69404-
x-unstable: '**Note**: This endpoint is in Preview.
69405-
69406-
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6940769464
/api/v2/incidents/{incident_id}/impacts/{impact_id}:
6940869465
delete:
6940969466
description: Delete an incident impact.
@@ -69434,9 +69491,6 @@ paths:
6943469491
operator: OR
6943569492
permissions:
6943669493
- incident_write
69437-
x-unstable: '**Note**: This endpoint is in Preview.
69438-
69439-
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
6944069494
/api/v2/incidents/{incident_id}/relationships/integrations:
6944169495
get:
6944269496
description: Get all integration metadata for an incident.
@@ -88607,6 +88661,9 @@ servers:
8860788661
tags:
8860888662
- description: Configure your API endpoints through the Datadog API.
8860988663
name: API Management
88664+
- description: Observe, troubleshoot, and improve cloud-scale applications with all
88665+
telemetry in context
88666+
name: APM
8861088667
- description: Manage configuration of [APM retention filters](https://app.datadoghq.com/apm/traces/retention-filters)
8861188668
for your organization. You need an API and application key with Admin rights to
8861288669
interact with this endpoint. See [retention filters](https://docs.datadoghq.com/tracing/trace_pipeline/trace_retention/#retention-filters)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Get service list 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.ApmApi;
6+
import com.datadog.api.client.v2.model.ServiceList;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
ApmApi apiInstance = new ApmApi(defaultClient);
12+
13+
try {
14+
ServiceList result = apiInstance.getServiceList();
15+
System.out.println(result);
16+
} catch (ApiException e) {
17+
System.err.println("Exception when calling ApmApi#getServiceList");
18+
System.err.println("Status code: " + e.getCode());
19+
System.err.println("Reason: " + e.getResponseBody());
20+
System.err.println("Response headers: " + e.getResponseHeaders());
21+
e.printStackTrace();
22+
}
23+
}
24+
}

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -748,14 +748,12 @@ public class ApiClient {
748748
put("v2.updateDeploymentGate", false);
749749
put("v2.updateDeploymentRule", false);
750750
put("v2.createIncident", false);
751-
put("v2.createIncidentImpact", false);
752751
put("v2.createIncidentIntegration", false);
753752
put("v2.createIncidentNotificationRule", false);
754753
put("v2.createIncidentNotificationTemplate", false);
755754
put("v2.createIncidentTodo", false);
756755
put("v2.createIncidentType", false);
757756
put("v2.deleteIncident", false);
758-
put("v2.deleteIncidentImpact", false);
759757
put("v2.deleteIncidentIntegration", false);
760758
put("v2.deleteIncidentNotificationRule", false);
761759
put("v2.deleteIncidentNotificationTemplate", false);
@@ -768,7 +766,6 @@ public class ApiClient {
768766
put("v2.getIncidentTodo", false);
769767
put("v2.getIncidentType", false);
770768
put("v2.listIncidentAttachments", false);
771-
put("v2.listIncidentImpacts", false);
772769
put("v2.listIncidentIntegrations", false);
773770
put("v2.listIncidentNotificationRules", false);
774771
put("v2.listIncidentNotificationTemplates", false);
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
package com.datadog.api.client.v2.api;
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.ApiResponse;
6+
import com.datadog.api.client.Pair;
7+
import com.datadog.api.client.v2.model.ServiceList;
8+
import jakarta.ws.rs.client.Invocation;
9+
import jakarta.ws.rs.core.GenericType;
10+
import java.util.ArrayList;
11+
import java.util.HashMap;
12+
import java.util.Map;
13+
import java.util.concurrent.CompletableFuture;
14+
15+
@jakarta.annotation.Generated(
16+
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
17+
public class ApmApi {
18+
private ApiClient apiClient;
19+
20+
public ApmApi() {
21+
this(ApiClient.getDefaultApiClient());
22+
}
23+
24+
public ApmApi(ApiClient apiClient) {
25+
this.apiClient = apiClient;
26+
}
27+
28+
/**
29+
* Get the API client.
30+
*
31+
* @return API client
32+
*/
33+
public ApiClient getApiClient() {
34+
return apiClient;
35+
}
36+
37+
/**
38+
* Set the API client.
39+
*
40+
* @param apiClient an instance of API client
41+
*/
42+
public void setApiClient(ApiClient apiClient) {
43+
this.apiClient = apiClient;
44+
}
45+
46+
/**
47+
* Get service list.
48+
*
49+
* <p>See {@link #getServiceListWithHttpInfo}.
50+
*
51+
* @return ServiceList
52+
* @throws ApiException if fails to make API call
53+
*/
54+
public ServiceList getServiceList() throws ApiException {
55+
return getServiceListWithHttpInfo().getData();
56+
}
57+
58+
/**
59+
* Get service list.
60+
*
61+
* <p>See {@link #getServiceListWithHttpInfoAsync}.
62+
*
63+
* @return CompletableFuture&lt;ServiceList&gt;
64+
*/
65+
public CompletableFuture<ServiceList> getServiceListAsync() {
66+
return getServiceListWithHttpInfoAsync()
67+
.thenApply(
68+
response -> {
69+
return response.getData();
70+
});
71+
}
72+
73+
/**
74+
* @return ApiResponse&lt;ServiceList&gt;
75+
* @throws ApiException if fails to make API call
76+
* @http.response.details
77+
* <table border="1">
78+
* <caption>Response details</caption>
79+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
80+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
81+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
82+
* </table>
83+
*/
84+
public ApiResponse<ServiceList> getServiceListWithHttpInfo() throws ApiException {
85+
Object localVarPostBody = null;
86+
// create path and map variables
87+
String localVarPath = "/api/v2/apm/services";
88+
89+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
90+
91+
Invocation.Builder builder =
92+
apiClient.createBuilder(
93+
"v2.ApmApi.getServiceList",
94+
localVarPath,
95+
new ArrayList<Pair>(),
96+
localVarHeaderParams,
97+
new HashMap<String, String>(),
98+
new String[] {"application/json"},
99+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
100+
return apiClient.invokeAPI(
101+
"GET",
102+
builder,
103+
localVarHeaderParams,
104+
new String[] {},
105+
localVarPostBody,
106+
new HashMap<String, Object>(),
107+
false,
108+
new GenericType<ServiceList>() {});
109+
}
110+
111+
/**
112+
* Get service list.
113+
*
114+
* <p>See {@link #getServiceListWithHttpInfo}.
115+
*
116+
* @return CompletableFuture&lt;ApiResponse&lt;ServiceList&gt;&gt;
117+
*/
118+
public CompletableFuture<ApiResponse<ServiceList>> getServiceListWithHttpInfoAsync() {
119+
Object localVarPostBody = null;
120+
// create path and map variables
121+
String localVarPath = "/api/v2/apm/services";
122+
123+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
124+
125+
Invocation.Builder builder;
126+
try {
127+
builder =
128+
apiClient.createBuilder(
129+
"v2.ApmApi.getServiceList",
130+
localVarPath,
131+
new ArrayList<Pair>(),
132+
localVarHeaderParams,
133+
new HashMap<String, String>(),
134+
new String[] {"application/json"},
135+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
136+
} catch (ApiException ex) {
137+
CompletableFuture<ApiResponse<ServiceList>> result = new CompletableFuture<>();
138+
result.completeExceptionally(ex);
139+
return result;
140+
}
141+
return apiClient.invokeAPIAsync(
142+
"GET",
143+
builder,
144+
localVarHeaderParams,
145+
new String[] {},
146+
localVarPostBody,
147+
new HashMap<String, Object>(),
148+
false,
149+
new GenericType<ServiceList>() {});
150+
}
151+
}

0 commit comments

Comments
 (0)