Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 66 additions & 9 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51339,6 +51339,49 @@ components:
$ref: '#/components/schemas/ServiceDefinitionData'
type: array
type: object
ServiceList:
properties:
data:
$ref: '#/components/schemas/ServiceListData'
type: object
ServiceListData:
properties:
attributes:
$ref: '#/components/schemas/ServiceListDataAttributes'
id:
type: string
type:
$ref: '#/components/schemas/ServiceListDataType'
required:
- type
type: object
ServiceListDataAttributes:
properties:
metadata:
items:
$ref: '#/components/schemas/ServiceListDataAttributesMetadataItems'
type: array
services:
items:
type: string
type: array
type: object
ServiceListDataAttributesMetadataItems:
properties:
isTraced:
type: boolean
isUsm:
type: boolean
type: object
ServiceListDataType:
default: services_list
description: Services list resource type.
enum:
- services_list
example: services_list
type: string
x-enum-varnames:
- SERVICES_LIST
ServiceNowBasicAuth:
description: The definition of the `ServiceNowBasicAuth` object.
properties:
Expand Down Expand Up @@ -61601,6 +61644,26 @@ paths:
permissions:
- apm_retention_filter_write
- apm_pipelines_write
/api/v2/apm/services:
get:
operationId: GetServiceList
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ServiceList'
description: OK
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- apm_read
summary: Get service list
tags:
- APM
/api/v2/app-builder/apps:
delete:
description: Delete multiple apps in a single request from a list of app IDs.
Expand Down Expand Up @@ -69334,9 +69397,6 @@ paths:
operator: OR
permissions:
- incident_read
x-unstable: '**Note**: This endpoint is in Preview.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
post:
description: Create an impact for an incident.
operationId: CreateIncidentImpact
Expand Down Expand Up @@ -69380,9 +69440,6 @@ paths:
operator: OR
permissions:
- incident_write
x-unstable: '**Note**: This endpoint is in Preview.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/incidents/{incident_id}/impacts/{impact_id}:
delete:
description: Delete an incident impact.
Expand Down Expand Up @@ -69413,9 +69470,6 @@ paths:
operator: OR
permissions:
- incident_write
x-unstable: '**Note**: This endpoint is in Preview.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/incidents/{incident_id}/relationships/integrations:
get:
description: Get all integration metadata for an incident.
Expand Down Expand Up @@ -88586,6 +88640,9 @@ servers:
tags:
- description: Configure your API endpoints through the Datadog API.
name: API Management
- description: Observe, troubleshoot, and improve cloud-scale applications with all
telemetry in context
name: APM
- description: Manage configuration of [APM retention filters](https://app.datadoghq.com/apm/traces/retention-filters)
for your organization. You need an API and application key with Admin rights to
interact with this endpoint. See [retention filters](https://docs.datadoghq.com/tracing/trace_pipeline/trace_retention/#retention-filters)
Expand Down
5 changes: 5 additions & 0 deletions examples/v2/apm/GetServiceList.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get service list returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::APMAPI.new
p api_instance.get_service_list()
13 changes: 13 additions & 0 deletions features/v2/apm.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@endpoint(apm) @endpoint(apm-v2)
Feature: APM
Observe, troubleshoot, and improve cloud-scale applications with all
telemetry in context

@generated @skip @team:DataDog/apm-aoe
Scenario: Get service list returns "OK" response
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "APM" API
And new "GetServiceList" request
When the request is sent
Then the response status is 200 OK
6 changes: 2 additions & 4 deletions features/v2/incidents.feature
Original file line number Diff line number Diff line change
Expand Up @@ -806,16 +806,14 @@ Feature: Incidents

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

@generated @skip @team:DataDog/incident-app
Scenario: List an incident's impacts returns "Not Found" response
Given operation "ListIncidentImpacts" enabled
And new "ListIncidentImpacts" request
Given new "ListIncidentImpacts" request
And request contains "incident_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
Expand Down
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,12 @@
"type": "idempotent"
}
},
"GetServiceList": {
"tag": "APM",
"undo": {
"type": "safe"
}
},
"DeleteApps": {
"tag": "App Builder",
"undo": {
Expand Down
3 changes: 0 additions & 3 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,12 @@ def initialize
"v2.update_deployment_gate": false,
"v2.update_deployment_rule": false,
"v2.create_incident": false,
"v2.create_incident_impact": false,
"v2.create_incident_integration": false,
"v2.create_incident_notification_rule": false,
"v2.create_incident_notification_template": false,
"v2.create_incident_todo": false,
"v2.create_incident_type": false,
"v2.delete_incident": false,
"v2.delete_incident_impact": false,
"v2.delete_incident_integration": false,
"v2.delete_incident_notification_rule": false,
"v2.delete_incident_notification_template": false,
Expand All @@ -269,7 +267,6 @@ def initialize
"v2.get_incident_todo": false,
"v2.get_incident_type": false,
"v2.list_incident_attachments": false,
"v2.list_incident_impacts": false,
"v2.list_incident_integrations": false,
"v2.list_incident_notification_rules": false,
"v2.list_incident_notification_templates": false,
Expand Down
6 changes: 6 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4163,6 +4163,11 @@ def overrides
"v2.service_definition_v2_slack" => "ServiceDefinitionV2Slack",
"v2.service_definition_v2_slack_type" => "ServiceDefinitionV2SlackType",
"v2.service_definition_v2_version" => "ServiceDefinitionV2Version",
"v2.service_list" => "ServiceList",
"v2.service_list_data" => "ServiceListData",
"v2.service_list_data_attributes" => "ServiceListDataAttributes",
"v2.service_list_data_attributes_metadata_items" => "ServiceListDataAttributesMetadataItems",
"v2.service_list_data_type" => "ServiceListDataType",
"v2.service_now_basic_auth" => "ServiceNowBasicAuth",
"v2.service_now_basic_auth_type" => "ServiceNowBasicAuthType",
"v2.service_now_basic_auth_update" => "ServiceNowBasicAuthUpdate",
Expand Down Expand Up @@ -4671,6 +4676,7 @@ def overrides
"v2.actions_datastores_api" => "ActionsDatastoresAPI",
"v2.agentless_scanning_api" => "AgentlessScanningAPI",
"v2.api_management_api" => "APIManagementAPI",
"v2.apm_api" => "APMAPI",
"v2.apm_retention_filters_api" => "APMRetentionFiltersAPI",
"v2.app_builder_api" => "AppBuilderAPI",
"v2.application_security_api" => "ApplicationSecurityAPI",
Expand Down
83 changes: 83 additions & 0 deletions lib/datadog_api_client/v2/api/apm_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
=begin
#Datadog API V2 Collection

#Collection of all Datadog Public endpoints.

The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator

Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.

=end

require 'cgi'

module DatadogAPIClient::V2
class APMAPI
attr_accessor :api_client

def initialize(api_client = DatadogAPIClient::APIClient.default)
@api_client = api_client
end

# Get service list.
#
# @see #get_service_list_with_http_info
def get_service_list(opts = {})
data, _status_code, _headers = get_service_list_with_http_info(opts)
data
end

# Get service list.
# @param opts [Hash] the optional parameters
# @return [Array<(ServiceList, Integer, Hash)>] ServiceList data, response status code and response headers
def get_service_list_with_http_info(opts = {})

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: APMAPI.get_service_list ...'
end
# resource path
local_var_path = '/api/v2/apm/services'

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'ServiceList'

# auth_names
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

new_options = opts.merge(
:operation => :get_service_list,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type,
:api_version => "V2"
)

data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: APMAPI#get_service_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
end
18 changes: 0 additions & 18 deletions lib/datadog_api_client/v2/api/incidents_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@ def create_incident_impact(incident_id, body, opts = {})
# @option opts [Array<IncidentImpactRelatedObject>] :include Specifies which related resources should be included in the response.
# @return [Array<(IncidentImpactResponse, Integer, Hash)>] IncidentImpactResponse data, response status code and response headers
def create_incident_impact_with_http_info(incident_id, body, opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_impact".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_impact")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_impact"))
end

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

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

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_impacts ...'
Expand Down
Loading
Loading