Skip to content

Commit 0001d44

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

15 files changed

Lines changed: 853 additions & 43 deletions

.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)

api/datadog/configuration.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,14 +661,12 @@ func NewConfiguration() *Configuration {
661661
"v2.UpdateDeploymentGate": false,
662662
"v2.UpdateDeploymentRule": false,
663663
"v2.CreateIncident": false,
664-
"v2.CreateIncidentImpact": false,
665664
"v2.CreateIncidentIntegration": false,
666665
"v2.CreateIncidentNotificationRule": false,
667666
"v2.CreateIncidentNotificationTemplate": false,
668667
"v2.CreateIncidentTodo": false,
669668
"v2.CreateIncidentType": false,
670669
"v2.DeleteIncident": false,
671-
"v2.DeleteIncidentImpact": false,
672670
"v2.DeleteIncidentIntegration": false,
673671
"v2.DeleteIncidentNotificationRule": false,
674672
"v2.DeleteIncidentNotificationTemplate": false,
@@ -681,7 +679,6 @@ func NewConfiguration() *Configuration {
681679
"v2.GetIncidentTodo": false,
682680
"v2.GetIncidentType": false,
683681
"v2.ListIncidentAttachments": false,
684-
"v2.ListIncidentImpacts": false,
685682
"v2.ListIncidentIntegrations": false,
686683
"v2.ListIncidentNotificationRules": false,
687684
"v2.ListIncidentNotificationTemplates": false,

api/datadogV2/api_apm.go

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV2
6+
7+
import (
8+
_context "context"
9+
_nethttp "net/http"
10+
_neturl "net/url"
11+
12+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
13+
)
14+
15+
// APMApi service type
16+
type APMApi datadog.Service
17+
18+
// GetServiceList Get service list.
19+
20+
func (a *APMApi) GetServiceList(ctx _context.Context) (ServiceList, *_nethttp.Response, error) {
21+
var (
22+
localVarHTTPMethod = _nethttp.MethodGet
23+
localVarPostBody interface{}
24+
localVarReturnValue ServiceList
25+
)
26+
27+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.APMApi.GetServiceList")
28+
if err != nil {
29+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
30+
}
31+
32+
localVarPath := localBasePath + "/api/v2/apm/services"
33+
34+
localVarHeaderParams := make(map[string]string)
35+
localVarQueryParams := _neturl.Values{}
36+
localVarFormParams := _neturl.Values{}
37+
localVarHeaderParams["Accept"] = "application/json"
38+
39+
if a.Client.Cfg.DelegatedTokenConfig != nil {
40+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
41+
if err != nil {
42+
return localVarReturnValue, nil, err
43+
}
44+
} else {
45+
datadog.SetAuthKeys(
46+
ctx,
47+
&localVarHeaderParams,
48+
[2]string{"apiKeyAuth", "DD-API-KEY"},
49+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
50+
)
51+
}
52+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
53+
if err != nil {
54+
return localVarReturnValue, nil, err
55+
}
56+
57+
localVarHTTPResponse, err := a.Client.CallAPI(req)
58+
if err != nil || localVarHTTPResponse == nil {
59+
return localVarReturnValue, localVarHTTPResponse, err
60+
}
61+
62+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
63+
if err != nil {
64+
return localVarReturnValue, localVarHTTPResponse, err
65+
}
66+
67+
if localVarHTTPResponse.StatusCode >= 300 {
68+
newErr := datadog.GenericOpenAPIError{
69+
ErrorBody: localVarBody,
70+
ErrorMessage: localVarHTTPResponse.Status,
71+
}
72+
if localVarHTTPResponse.StatusCode == 429 {
73+
var v APIErrorResponse
74+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
75+
if err != nil {
76+
return localVarReturnValue, localVarHTTPResponse, newErr
77+
}
78+
newErr.ErrorModel = v
79+
}
80+
return localVarReturnValue, localVarHTTPResponse, newErr
81+
}
82+
83+
err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
84+
if err != nil {
85+
newErr := datadog.GenericOpenAPIError{
86+
ErrorBody: localVarBody,
87+
ErrorMessage: err.Error(),
88+
}
89+
return localVarReturnValue, localVarHTTPResponse, newErr
90+
}
91+
92+
return localVarReturnValue, localVarHTTPResponse, nil
93+
}
94+
95+
// NewAPMApi Returns NewAPMApi.
96+
func NewAPMApi(client *datadog.APIClient) *APMApi {
97+
return &APMApi{
98+
Client: client,
99+
}
100+
}

api/datadogV2/api_incidents.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,6 @@ func (a *IncidentsApi) CreateIncidentImpact(ctx _context.Context, incidentId str
141141
optionalParams = o[0]
142142
}
143143

144-
operationId := "v2.CreateIncidentImpact"
145-
isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId)
146-
if !isOperationEnabled {
147-
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)}
148-
}
149-
if isOperationEnabled && a.Client.Cfg.Debug {
150-
_log.Printf("WARNING: Using unstable operation '%s'", operationId)
151-
}
152-
153144
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.IncidentsApi.CreateIncidentImpact")
154145
if err != nil {
155146
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
@@ -757,15 +748,6 @@ func (a *IncidentsApi) DeleteIncidentImpact(ctx _context.Context, incidentId str
757748
localVarPostBody interface{}
758749
)
759750

760-
operationId := "v2.DeleteIncidentImpact"
761-
isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId)
762-
if !isOperationEnabled {
763-
return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)}
764-
}
765-
if isOperationEnabled && a.Client.Cfg.Debug {
766-
_log.Printf("WARNING: Using unstable operation '%s'", operationId)
767-
}
768-
769751
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.IncidentsApi.DeleteIncidentImpact")
770752
if err != nil {
771753
return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
@@ -2037,15 +2019,6 @@ func (a *IncidentsApi) ListIncidentImpacts(ctx _context.Context, incidentId stri
20372019
optionalParams = o[0]
20382020
}
20392021

2040-
operationId := "v2.ListIncidentImpacts"
2041-
isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId)
2042-
if !isOperationEnabled {
2043-
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)}
2044-
}
2045-
if isOperationEnabled && a.Client.Cfg.Debug {
2046-
_log.Printf("WARNING: Using unstable operation '%s'", operationId)
2047-
}
2048-
20492022
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.IncidentsApi.ListIncidentImpacts")
20502023
if err != nil {
20512024
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}

api/datadogV2/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// - [APIManagementApi.GetOpenAPI]
99
// - [APIManagementApi.ListAPIs]
1010
// - [APIManagementApi.UpdateOpenAPI]
11+
// - [APMApi.GetServiceList]
1112
// - [APMRetentionFiltersApi.CreateApmRetentionFilter]
1213
// - [APMRetentionFiltersApi.DeleteApmRetentionFilter]
1314
// - [APMRetentionFiltersApi.GetApmRetentionFilter]

0 commit comments

Comments
 (0)