Skip to content

Commit 110fc89

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 081afac of spec repo
1 parent a6a734c commit 110fc89

9 files changed

Lines changed: 229 additions & 28 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 83 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42828,6 +42828,9 @@ components:
4282842828
description: Attributes of the SPA Recommendation resource. Contains recommendations
4282942829
for both driver and executor components.
4283042830
properties:
42831+
confidence_level:
42832+
format: double
42833+
type: number
4283142834
driver:
4283242835
$ref: '#/components/schemas/ComponentRecommendation'
4283342836
executor:
@@ -86625,13 +86628,79 @@ paths:
8662586628
x-unstable: '**Note**: This feature is in private beta. To request access, use
8662686629
the request access form in the [Service Level Objectives](https://docs.datadoghq.com/service_management/service_level_objectives/#slo-csv-export)
8662786630
docs.'
86628-
/api/v2/spa/recommendations/{service}/{shard}:
86631+
/api/v2/spa/recommendations/{service}:
8662986632
get:
86630-
description: Retrieve resource recommendations for a Spark job. The caller (Spark
86631-
Gateway or DJM UI) provides a service name and shard identifier, and SPA returns
86632-
structured recommendations for driver and executor resources.
86633+
description: This endpoint is currently experimental and restricted to Datadog
86634+
internal use only. Retrieve resource recommendations for a Spark job. The
86635+
caller (Spark Gateway or DJM UI) provides a service name and SPA returns structured
86636+
recommendations for driver and executor resources. The version with a shard
86637+
should be preferred, where possible, as it gives more accurate results.
8663386638
operationId: GetSPARecommendations
8663486639
parameters:
86640+
- description: The recommendation service should not use its metrics cache.
86641+
in: query
86642+
name: bypass_cache
86643+
schema:
86644+
type: string
86645+
- description: The service name for a spark job.
86646+
in: path
86647+
name: service
86648+
required: true
86649+
schema:
86650+
type: string
86651+
responses:
86652+
'200':
86653+
content:
86654+
application/json:
86655+
example:
86656+
data:
86657+
attributes:
86658+
driver:
86659+
estimation:
86660+
cpu:
86661+
max: 1500
86662+
p75: 1000
86663+
p95: 1200
86664+
ephemeral_storage: 896
86665+
heap: 6144
86666+
memory: 7168
86667+
overhead: 1024
86668+
executor:
86669+
estimation:
86670+
cpu:
86671+
max: 2000
86672+
p75: 1200
86673+
p95: 1500
86674+
ephemeral_storage: 512
86675+
heap: 3072
86676+
memory: 4096
86677+
overhead: 1024
86678+
id: dedupeactivecontexts:adp_dedupeactivecontexts_org2
86679+
type: recommendation
86680+
schema:
86681+
$ref: '#/components/schemas/RecommendationDocument'
86682+
description: OK
86683+
'400':
86684+
$ref: '#/components/responses/BadRequestResponse'
86685+
'403':
86686+
$ref: '#/components/responses/NotAuthorizedResponse'
86687+
'429':
86688+
$ref: '#/components/responses/TooManyRequestsResponse'
86689+
security:
86690+
- AuthZ: []
86691+
summary: Get SPA Recommendations
86692+
tags:
86693+
- Spa
86694+
x-unstable: '**Note**: This endpoint is in preview and may change in the future.
86695+
It is not yet recommended for production use.'
86696+
/api/v2/spa/recommendations/{service}/{shard}:
86697+
get:
86698+
description: This endpoint is currently experimental and restricted to Datadog
86699+
internal use only. Retrieve resource recommendations for a Spark job. The
86700+
caller (Spark Gateway or DJM UI) provides a service name and shard identifier,
86701+
and SPA returns structured recommendations for driver and executor resources.
86702+
operationId: GetSPARecommendationsWithShard
86703+
parameters:
8663586704
- description: The shard tag for a spark job, which differentiates jobs within
8663686705
the same service that have different resource needs
8663786706
in: path
@@ -86645,6 +86714,11 @@ paths:
8664586714
required: true
8664686715
schema:
8664786716
type: string
86717+
- description: The recommendation service should not use its metrics cache.
86718+
in: query
86719+
name: bypass_cache
86720+
schema:
86721+
type: string
8664886722
responses:
8664986723
'200':
8665086724
content:
@@ -86683,11 +86757,13 @@ paths:
8668386757
$ref: '#/components/responses/NotAuthorizedResponse'
8668486758
'429':
8668586759
$ref: '#/components/responses/TooManyRequestsResponse'
86686-
summary: Get SPA Recommendations
86760+
security:
86761+
- AuthZ: []
86762+
summary: Get SPA Recommendations with a shard parameter
8668786763
tags:
8668886764
- Spa
86689-
x-unstable: '**Note**: This endpoint is in public beta and may change in the
86690-
future. It is not yet recommended for production use.'
86765+
x-unstable: '**Note**: This endpoint is in preview and may change in the future.
86766+
It is not yet recommended for production use.'
8669186767
/api/v2/spans/analytics/aggregate:
8669286768
post:
8669386769
description: 'The API endpoint to aggregate spans into buckets and compute metrics

examples/v2/spa/GetSPARecommendations.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
config.unstable_operations["v2.get_spa_recommendations".to_sym] = true
66
end
77
api_instance = DatadogAPIClient::V2::SpaAPI.new
8-
p api_instance.get_spa_recommendations("shard", "service")
8+
p api_instance.get_spa_recommendations("service")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get SPA Recommendations with a shard parameter returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_spa_recommendations_with_shard".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::SpaAPI.new
8+
p api_instance.get_spa_recommendations_with_shard("shard", "service")

features/scenarios_model_mapping.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3211,8 +3211,13 @@
32113211
"report_id" => "String",
32123212
},
32133213
"v2.GetSPARecommendations" => {
3214+
"bypass_cache" => "String",
3215+
"service" => "String",
3216+
},
3217+
"v2.GetSPARecommendationsWithShard" => {
32143218
"shard" => "String",
32153219
"service" => "String",
3220+
"bypass_cache" => "String",
32163221
},
32173222
"v2.AggregateSpans" => {
32183223
"body" => "SpansAggregateRequest",

features/v2/spa.feature

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,49 @@ Feature: Spa
44
insights to help optimize Spark job configurations.
55

66
Background:
7-
Given a valid "apiKeyAuth" key in the system
8-
And a valid "appKeyAuth" key in the system
9-
And an instance of "Spa" API
10-
And operation "GetSPARecommendations" enabled
11-
And new "GetSPARecommendations" request
7+
Given an instance of "Spa" API
128

139
@generated @skip @team:DataDog/data-and-analytics-processing
1410
Scenario: Get SPA Recommendations returns "Bad Request" response
15-
Given request contains "shard" parameter from "REPLACE.ME"
11+
Given operation "GetSPARecommendations" enabled
12+
And new "GetSPARecommendations" request
1613
And request contains "service" parameter from "REPLACE.ME"
1714
When the request is sent
1815
Then the response status is 400 Bad Request
1916

2017
@generated @skip @team:DataDog/data-and-analytics-processing
2118
Scenario: Get SPA Recommendations returns "OK" response
22-
Given request contains "shard" parameter from "REPLACE.ME"
19+
Given operation "GetSPARecommendations" enabled
20+
And new "GetSPARecommendations" request
21+
And request contains "service" parameter from "REPLACE.ME"
22+
When the request is sent
23+
Then the response status is 200 OK
24+
25+
@generated @skip @team:DataDog/data-and-analytics-processing
26+
Scenario: Get SPA Recommendations with a shard parameter returns "Bad Request" response
27+
Given operation "GetSPARecommendationsWithShard" enabled
28+
And new "GetSPARecommendationsWithShard" request
29+
And request contains "shard" parameter from "REPLACE.ME"
30+
And request contains "service" parameter from "REPLACE.ME"
31+
When the request is sent
32+
Then the response status is 400 Bad Request
33+
34+
@generated @skip @team:DataDog/data-and-analytics-processing
35+
Scenario: Get SPA Recommendations with a shard parameter returns "OK" response
36+
Given operation "GetSPARecommendationsWithShard" enabled
37+
And new "GetSPARecommendationsWithShard" request
38+
And request contains "shard" parameter from "REPLACE.ME"
2339
And request contains "service" parameter from "REPLACE.ME"
2440
When the request is sent
2541
Then the response status is 200 OK
2642

2743
@skip @team:DataDog/data-and-analytics-processing
2844
Scenario: GetSPARecommendations returns a JSON:API Recommendation with driver and executor estimations
29-
Given request contains "service" parameter with value "dedupeactivecontexts"
45+
Given new "GetSPARecommendations" request
46+
And a valid "apiKeyAuth" key in the system
47+
And a valid "appKeyAuth" key in the system
48+
And operation "GetSPARecommendations" enabled
49+
And request contains "service" parameter with value "dedupeactivecontexts"
3050
And request contains "shard" parameter with value "adp_dedupeactivecontexts_org2"
3151
When the request is sent
3252
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
@@ -4484,6 +4484,12 @@
44844484
"type": "safe"
44854485
}
44864486
},
4487+
"GetSPARecommendationsWithShard": {
4488+
"tag": "Spa",
4489+
"undo": {
4490+
"type": "safe"
4491+
}
4492+
},
44874493
"AggregateSpans": {
44884494
"tag": "Spans",
44894495
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ def initialize
334334
"v2.get_slo_report": false,
335335
"v2.get_slo_report_job_status": false,
336336
"v2.get_spa_recommendations": false,
337+
"v2.get_spa_recommendations_with_shard": false,
337338
"v2.create_sca_resolve_vulnerable_symbols": false,
338339
"v2.create_sca_result": false,
339340
"v2.add_member_team": false,

lib/datadog_api_client/v2/api/spa_api.rb

Lines changed: 86 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ def initialize(api_client = DatadogAPIClient::APIClient.default)
2626
# Get SPA Recommendations.
2727
#
2828
# @see #get_spa_recommendations_with_http_info
29-
def get_spa_recommendations(shard, service, opts = {})
30-
data, _status_code, _headers = get_spa_recommendations_with_http_info(shard, service, opts)
29+
def get_spa_recommendations(service, opts = {})
30+
data, _status_code, _headers = get_spa_recommendations_with_http_info(service, opts)
3131
data
3232
end
3333

3434
# Get SPA Recommendations.
3535
#
36-
# Retrieve resource recommendations for a Spark job. The caller (Spark Gateway or DJM UI) provides a service name and shard identifier, and SPA returns structured recommendations for driver and executor resources.
36+
# This endpoint is currently experimental and restricted to Datadog internal use only. Retrieve resource recommendations for a Spark job. The caller (Spark Gateway or DJM UI) provides a service name and SPA returns structured recommendations for driver and executor resources. The version with a shard should be preferred, where possible, as it gives more accurate results.
3737
#
38-
# @param shard [String] The shard tag for a spark job, which differentiates jobs within the same service that have different resource needs
39-
# @param service [String] The service name for a spark job
38+
# @param service [String] The service name for a spark job.
4039
# @param opts [Hash] the optional parameters
40+
# @option opts [String] :bypass_cache The recommendation service should not use its metrics cache.
4141
# @return [Array<(RecommendationDocument, Integer, Hash)>] RecommendationDocument data, response status code and response headers
42-
def get_spa_recommendations_with_http_info(shard, service, opts = {})
42+
def get_spa_recommendations_with_http_info(service, opts = {})
4343
unstable_enabled = @api_client.config.unstable_operations["v2.get_spa_recommendations".to_sym]
4444
if unstable_enabled
4545
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_spa_recommendations")
@@ -50,19 +50,94 @@ def get_spa_recommendations_with_http_info(shard, service, opts = {})
5050
if @api_client.config.debugging
5151
@api_client.config.logger.debug 'Calling API: SpaAPI.get_spa_recommendations ...'
5252
end
53+
# verify the required parameter 'service' is set
54+
if @api_client.config.client_side_validation && service.nil?
55+
fail ArgumentError, "Missing the required parameter 'service' when calling SpaAPI.get_spa_recommendations"
56+
end
57+
# resource path
58+
local_var_path = '/api/v2/spa/recommendations/{service}'.sub('{service}', CGI.escape(service.to_s).gsub('%2F', '/'))
59+
60+
# query parameters
61+
query_params = opts[:query_params] || {}
62+
query_params[:'bypass_cache'] = opts[:'bypass_cache'] if !opts[:'bypass_cache'].nil?
63+
64+
# header parameters
65+
header_params = opts[:header_params] || {}
66+
# HTTP header 'Accept' (if needed)
67+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
68+
69+
# form parameters
70+
form_params = opts[:form_params] || {}
71+
72+
# http body (model)
73+
post_body = opts[:debug_body]
74+
75+
# return_type
76+
return_type = opts[:debug_return_type] || 'RecommendationDocument'
77+
78+
# auth_names
79+
auth_names = opts[:debug_auth_names] || [:AuthZ]
80+
81+
new_options = opts.merge(
82+
:operation => :get_spa_recommendations,
83+
:header_params => header_params,
84+
:query_params => query_params,
85+
:form_params => form_params,
86+
:body => post_body,
87+
:auth_names => auth_names,
88+
:return_type => return_type,
89+
:api_version => "V2"
90+
)
91+
92+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
93+
if @api_client.config.debugging
94+
@api_client.config.logger.debug "API called: SpaAPI#get_spa_recommendations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
95+
end
96+
return data, status_code, headers
97+
end
98+
99+
# Get SPA Recommendations with a shard parameter.
100+
#
101+
# @see #get_spa_recommendations_with_shard_with_http_info
102+
def get_spa_recommendations_with_shard(shard, service, opts = {})
103+
data, _status_code, _headers = get_spa_recommendations_with_shard_with_http_info(shard, service, opts)
104+
data
105+
end
106+
107+
# Get SPA Recommendations with a shard parameter.
108+
#
109+
# This endpoint is currently experimental and restricted to Datadog internal use only. Retrieve resource recommendations for a Spark job. The caller (Spark Gateway or DJM UI) provides a service name and shard identifier, and SPA returns structured recommendations for driver and executor resources.
110+
#
111+
# @param shard [String] The shard tag for a spark job, which differentiates jobs within the same service that have different resource needs
112+
# @param service [String] The service name for a spark job
113+
# @param opts [Hash] the optional parameters
114+
# @option opts [String] :bypass_cache The recommendation service should not use its metrics cache.
115+
# @return [Array<(RecommendationDocument, Integer, Hash)>] RecommendationDocument data, response status code and response headers
116+
def get_spa_recommendations_with_shard_with_http_info(shard, service, opts = {})
117+
unstable_enabled = @api_client.config.unstable_operations["v2.get_spa_recommendations_with_shard".to_sym]
118+
if unstable_enabled
119+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_spa_recommendations_with_shard")
120+
else
121+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_spa_recommendations_with_shard"))
122+
end
123+
124+
if @api_client.config.debugging
125+
@api_client.config.logger.debug 'Calling API: SpaAPI.get_spa_recommendations_with_shard ...'
126+
end
53127
# verify the required parameter 'shard' is set
54128
if @api_client.config.client_side_validation && shard.nil?
55-
fail ArgumentError, "Missing the required parameter 'shard' when calling SpaAPI.get_spa_recommendations"
129+
fail ArgumentError, "Missing the required parameter 'shard' when calling SpaAPI.get_spa_recommendations_with_shard"
56130
end
57131
# verify the required parameter 'service' is set
58132
if @api_client.config.client_side_validation && service.nil?
59-
fail ArgumentError, "Missing the required parameter 'service' when calling SpaAPI.get_spa_recommendations"
133+
fail ArgumentError, "Missing the required parameter 'service' when calling SpaAPI.get_spa_recommendations_with_shard"
60134
end
61135
# resource path
62136
local_var_path = '/api/v2/spa/recommendations/{service}/{shard}'.sub('{shard}', CGI.escape(shard.to_s).gsub('%2F', '/')).sub('{service}', CGI.escape(service.to_s).gsub('%2F', '/'))
63137

64138
# query parameters
65139
query_params = opts[:query_params] || {}
140+
query_params[:'bypass_cache'] = opts[:'bypass_cache'] if !opts[:'bypass_cache'].nil?
66141

67142
# header parameters
68143
header_params = opts[:header_params] || {}
@@ -79,10 +154,10 @@ def get_spa_recommendations_with_http_info(shard, service, opts = {})
79154
return_type = opts[:debug_return_type] || 'RecommendationDocument'
80155

81156
# auth_names
82-
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
157+
auth_names = opts[:debug_auth_names] || [:AuthZ]
83158

84159
new_options = opts.merge(
85-
:operation => :get_spa_recommendations,
160+
:operation => :get_spa_recommendations_with_shard,
86161
:header_params => header_params,
87162
:query_params => query_params,
88163
:form_params => form_params,
@@ -94,7 +169,7 @@ def get_spa_recommendations_with_http_info(shard, service, opts = {})
94169

95170
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
96171
if @api_client.config.debugging
97-
@api_client.config.logger.debug "API called: SpaAPI#get_spa_recommendations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
172+
@api_client.config.logger.debug "API called: SpaAPI#get_spa_recommendations_with_shard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
98173
end
99174
return data, status_code, headers
100175
end

0 commit comments

Comments
 (0)