Skip to content

Commit 1242a14

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

File tree

14 files changed

+689
-34
lines changed

14 files changed

+689
-34
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)

examples/v2/apm/GetServiceList.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Get service list returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::APMAPI.new
5+
p api_instance.get_service_list()

features/v2/apm.feature

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@endpoint(apm) @endpoint(apm-v2)
2+
Feature: APM
3+
Observe, troubleshoot, and improve cloud-scale applications with all
4+
telemetry in context
5+
6+
@generated @skip @team:DataDog/apm-aoe
7+
Scenario: Get service list returns "OK" response
8+
Given a valid "apiKeyAuth" key in the system
9+
And a valid "appKeyAuth" key in the system
10+
And an instance of "APM" API
11+
And new "GetServiceList" request
12+
When the request is sent
13+
Then the response status is 200 OK

features/v2/incidents.feature

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,16 +806,14 @@ Feature: Incidents
806806

807807
@generated @skip @team:DataDog/incident-app
808808
Scenario: List an incident's impacts returns "Bad Request" response
809-
Given operation "ListIncidentImpacts" enabled
810-
And new "ListIncidentImpacts" request
809+
Given new "ListIncidentImpacts" request
811810
And request contains "incident_id" parameter from "REPLACE.ME"
812811
When the request is sent
813812
Then the response status is 400 Bad Request
814813

815814
@generated @skip @team:DataDog/incident-app
816815
Scenario: List an incident's impacts returns "Not Found" response
817-
Given operation "ListIncidentImpacts" enabled
818-
And new "ListIncidentImpacts" request
816+
Given new "ListIncidentImpacts" request
819817
And request contains "incident_id" parameter from "REPLACE.ME"
820818
When the request is sent
821819
Then the response status is 404 Not Found

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,12 @@
516516
"type": "idempotent"
517517
}
518518
},
519+
"GetServiceList": {
520+
"tag": "APM",
521+
"undo": {
522+
"type": "safe"
523+
}
524+
},
519525
"DeleteApps": {
520526
"tag": "App Builder",
521527
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,12 @@ def initialize
249249
"v2.update_deployment_gate": false,
250250
"v2.update_deployment_rule": false,
251251
"v2.create_incident": false,
252-
"v2.create_incident_impact": false,
253252
"v2.create_incident_integration": false,
254253
"v2.create_incident_notification_rule": false,
255254
"v2.create_incident_notification_template": false,
256255
"v2.create_incident_todo": false,
257256
"v2.create_incident_type": false,
258257
"v2.delete_incident": false,
259-
"v2.delete_incident_impact": false,
260258
"v2.delete_incident_integration": false,
261259
"v2.delete_incident_notification_rule": false,
262260
"v2.delete_incident_notification_template": false,
@@ -269,7 +267,6 @@ def initialize
269267
"v2.get_incident_todo": false,
270268
"v2.get_incident_type": false,
271269
"v2.list_incident_attachments": false,
272-
"v2.list_incident_impacts": false,
273270
"v2.list_incident_integrations": false,
274271
"v2.list_incident_notification_rules": false,
275272
"v2.list_incident_notification_templates": false,

lib/datadog_api_client/inflector.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4165,6 +4165,11 @@ def overrides
41654165
"v2.service_definition_v2_slack" => "ServiceDefinitionV2Slack",
41664166
"v2.service_definition_v2_slack_type" => "ServiceDefinitionV2SlackType",
41674167
"v2.service_definition_v2_version" => "ServiceDefinitionV2Version",
4168+
"v2.service_list" => "ServiceList",
4169+
"v2.service_list_data" => "ServiceListData",
4170+
"v2.service_list_data_attributes" => "ServiceListDataAttributes",
4171+
"v2.service_list_data_attributes_metadata_items" => "ServiceListDataAttributesMetadataItems",
4172+
"v2.service_list_data_type" => "ServiceListDataType",
41684173
"v2.service_now_basic_auth" => "ServiceNowBasicAuth",
41694174
"v2.service_now_basic_auth_type" => "ServiceNowBasicAuthType",
41704175
"v2.service_now_basic_auth_update" => "ServiceNowBasicAuthUpdate",
@@ -4673,6 +4678,7 @@ def overrides
46734678
"v2.actions_datastores_api" => "ActionsDatastoresAPI",
46744679
"v2.agentless_scanning_api" => "AgentlessScanningAPI",
46754680
"v2.api_management_api" => "APIManagementAPI",
4681+
"v2.apm_api" => "APMAPI",
46764682
"v2.apm_retention_filters_api" => "APMRetentionFiltersAPI",
46774683
"v2.app_builder_api" => "AppBuilderAPI",
46784684
"v2.application_security_api" => "ApplicationSecurityAPI",
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'cgi'
17+
18+
module DatadogAPIClient::V2
19+
class APMAPI
20+
attr_accessor :api_client
21+
22+
def initialize(api_client = DatadogAPIClient::APIClient.default)
23+
@api_client = api_client
24+
end
25+
26+
# Get service list.
27+
#
28+
# @see #get_service_list_with_http_info
29+
def get_service_list(opts = {})
30+
data, _status_code, _headers = get_service_list_with_http_info(opts)
31+
data
32+
end
33+
34+
# Get service list.
35+
# @param opts [Hash] the optional parameters
36+
# @return [Array<(ServiceList, Integer, Hash)>] ServiceList data, response status code and response headers
37+
def get_service_list_with_http_info(opts = {})
38+
39+
if @api_client.config.debugging
40+
@api_client.config.logger.debug 'Calling API: APMAPI.get_service_list ...'
41+
end
42+
# resource path
43+
local_var_path = '/api/v2/apm/services'
44+
45+
# query parameters
46+
query_params = opts[:query_params] || {}
47+
48+
# header parameters
49+
header_params = opts[:header_params] || {}
50+
# HTTP header 'Accept' (if needed)
51+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
52+
53+
# form parameters
54+
form_params = opts[:form_params] || {}
55+
56+
# http body (model)
57+
post_body = opts[:debug_body]
58+
59+
# return_type
60+
return_type = opts[:debug_return_type] || 'ServiceList'
61+
62+
# auth_names
63+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
64+
65+
new_options = opts.merge(
66+
:operation => :get_service_list,
67+
:header_params => header_params,
68+
:query_params => query_params,
69+
:form_params => form_params,
70+
:body => post_body,
71+
:auth_names => auth_names,
72+
:return_type => return_type,
73+
:api_version => "V2"
74+
)
75+
76+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
77+
if @api_client.config.debugging
78+
@api_client.config.logger.debug "API called: APMAPI#get_service_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79+
end
80+
return data, status_code, headers
81+
end
82+
end
83+
end

lib/datadog_api_client/v2/api/incidents_api.rb

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,6 @@ def create_incident_impact(incident_id, body, opts = {})
114114
# @option opts [Array<IncidentImpactRelatedObject>] :include Specifies which related resources should be included in the response.
115115
# @return [Array<(IncidentImpactResponse, Integer, Hash)>] IncidentImpactResponse data, response status code and response headers
116116
def create_incident_impact_with_http_info(incident_id, body, opts = {})
117-
unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_impact".to_sym]
118-
if unstable_enabled
119-
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_impact")
120-
else
121-
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_impact"))
122-
end
123117

124118
if @api_client.config.debugging
125119
@api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_impact ...'
@@ -639,12 +633,6 @@ def delete_incident_impact(incident_id, impact_id, opts = {})
639633
# @param opts [Hash] the optional parameters
640634
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
641635
def delete_incident_impact_with_http_info(incident_id, impact_id, opts = {})
642-
unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_impact".to_sym]
643-
if unstable_enabled
644-
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_impact")
645-
else
646-
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_impact"))
647-
end
648636

649637
if @api_client.config.debugging
650638
@api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_impact ...'
@@ -1601,12 +1589,6 @@ def list_incident_impacts(incident_id, opts = {})
16011589
# @option opts [Array<IncidentImpactRelatedObject>] :include Specifies which related resources should be included in the response.
16021590
# @return [Array<(IncidentImpactsResponse, Integer, Hash)>] IncidentImpactsResponse data, response status code and response headers
16031591
def list_incident_impacts_with_http_info(incident_id, opts = {})
1604-
unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_impacts".to_sym]
1605-
if unstable_enabled
1606-
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_impacts")
1607-
else
1608-
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_impacts"))
1609-
end
16101592

16111593
if @api_client.config.debugging
16121594
@api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_impacts ...'

0 commit comments

Comments
 (0)