Skip to content

Commit 7b8aa03

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c854967 of spec repo
1 parent b25c67e commit 7b8aa03

25 files changed

+3409
-2
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 638 additions & 1 deletion
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get detailed information about an agent returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_fleet_agent_info".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
p api_instance.get_fleet_agent_info("agent_key")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List all Datadog Agents returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_fleet_agents".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
8+
p api_instance.list_fleet_agents()

features/scenarios_model_mapping.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,17 @@
838838
"user_handle" => "String",
839839
"body" => "User",
840840
},
841+
"v2.ListFleetAgents" => {
842+
"page_number" => "Integer",
843+
"page_size" => "Integer",
844+
"sort_attribute" => "String",
845+
"sort_descending" => "Boolean",
846+
"tags" => "String",
847+
"filter" => "String",
848+
},
849+
"v2.GetFleetAgentInfo" => {
850+
"agent_key" => "String",
851+
},
841852
"v2.ListFleetDeployments" => {
842853
"page_size" => "Integer",
843854
"page_offset" => "Integer",

features/v2/fleet_automation.feature

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,51 @@ Feature: Fleet Automation
152152
When the request is sent
153153
Then the response status is 200 OK
154154

155+
@generated @skip @team:DataDog/fleet-automation
156+
Scenario: Get detailed information about an agent returns "Bad Request" response
157+
Given operation "GetFleetAgentInfo" enabled
158+
And new "GetFleetAgentInfo" request
159+
And request contains "agent_key" parameter from "REPLACE.ME"
160+
When the request is sent
161+
Then the response status is 400 Bad Request
162+
163+
@generated @skip @team:DataDog/fleet-automation
164+
Scenario: Get detailed information about an agent returns "Not Found" response
165+
Given operation "GetFleetAgentInfo" enabled
166+
And new "GetFleetAgentInfo" request
167+
And request contains "agent_key" parameter from "REPLACE.ME"
168+
When the request is sent
169+
Then the response status is 404 Not Found
170+
171+
@generated @skip @team:DataDog/fleet-automation
172+
Scenario: Get detailed information about an agent returns "OK" response
173+
Given operation "GetFleetAgentInfo" enabled
174+
And new "GetFleetAgentInfo" request
175+
And request contains "agent_key" parameter from "REPLACE.ME"
176+
When the request is sent
177+
Then the response status is 200 OK
178+
179+
@generated @skip @team:DataDog/fleet-automation
180+
Scenario: List all Datadog Agents returns "Bad Request" response
181+
Given operation "ListFleetAgents" enabled
182+
And new "ListFleetAgents" request
183+
When the request is sent
184+
Then the response status is 400 Bad Request
185+
186+
@generated @skip @team:DataDog/fleet-automation
187+
Scenario: List all Datadog Agents returns "Not Found" response
188+
Given operation "ListFleetAgents" enabled
189+
And new "ListFleetAgents" request
190+
When the request is sent
191+
Then the response status is 404 Not Found
192+
193+
@generated @skip @team:DataDog/fleet-automation
194+
Scenario: List all Datadog Agents returns "OK" response
195+
Given operation "ListFleetAgents" enabled
196+
And new "ListFleetAgents" request
197+
When the request is sent
198+
Then the response status is 200 OK
199+
155200
@generated @skip @team:DataDog/fleet-automation
156201
Scenario: List all available Agent versions returns "Bad Request" response
157202
Given operation "ListFleetAgentVersions" enabled

features/v2/undo.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55
"type": "safe"
66
}
77
},
8+
"ListFleetAgents": {
9+
"tag": "Fleet Automation",
10+
"undo": {
11+
"type": "safe"
12+
}
13+
},
14+
"GetFleetAgentInfo": {
15+
"tag": "Fleet Automation",
16+
"undo": {
17+
"type": "safe"
18+
}
19+
},
820
"ListFleetDeployments": {
921
"tag": "Fleet Automation",
1022
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,10 @@ def initialize
194194
"v2.create_fleet_deployment_upgrade": false,
195195
"v2.create_fleet_schedule": false,
196196
"v2.delete_fleet_schedule": false,
197+
"v2.get_fleet_agent_info": false,
197198
"v2.get_fleet_deployment": false,
198199
"v2.get_fleet_schedule": false,
200+
"v2.list_fleet_agents": false,
199201
"v2.list_fleet_agent_versions": false,
200202
"v2.list_fleet_deployments": false,
201203
"v2.list_fleet_schedules": false,

lib/datadog_api_client/inflector.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,10 +2213,23 @@ def overrides
22132213
"v2.flaky_tests_search_sort" => "FlakyTestsSearchSort",
22142214
"v2.flaky_test_stats" => "FlakyTestStats",
22152215
"v2.flaky_test_type" => "FlakyTestType",
2216+
"v2.fleet_agent_attributes" => "FleetAgentAttributes",
2217+
"v2.fleet_agent_attributes_tags_items" => "FleetAgentAttributesTagsItems",
2218+
"v2.fleet_agent_info" => "FleetAgentInfo",
2219+
"v2.fleet_agent_info_attributes" => "FleetAgentInfoAttributes",
2220+
"v2.fleet_agent_info_details" => "FleetAgentInfoDetails",
2221+
"v2.fleet_agent_info_resource_type" => "FleetAgentInfoResourceType",
2222+
"v2.fleet_agent_info_response" => "FleetAgentInfoResponse",
2223+
"v2.fleet_agents_response" => "FleetAgentsResponse",
2224+
"v2.fleet_agents_response_data" => "FleetAgentsResponseData",
2225+
"v2.fleet_agents_response_data_attributes" => "FleetAgentsResponseDataAttributes",
2226+
"v2.fleet_agents_response_meta" => "FleetAgentsResponseMeta",
22162227
"v2.fleet_agent_version" => "FleetAgentVersion",
22172228
"v2.fleet_agent_version_attributes" => "FleetAgentVersionAttributes",
22182229
"v2.fleet_agent_version_resource_type" => "FleetAgentVersionResourceType",
22192230
"v2.fleet_agent_versions_response" => "FleetAgentVersionsResponse",
2231+
"v2.fleet_configuration_file" => "FleetConfigurationFile",
2232+
"v2.fleet_configuration_layer" => "FleetConfigurationLayer",
22202233
"v2.fleet_deployment" => "FleetDeployment",
22212234
"v2.fleet_deployment_attributes" => "FleetDeploymentAttributes",
22222235
"v2.fleet_deployment_configure_attributes" => "FleetDeploymentConfigureAttributes",
@@ -2237,6 +2250,9 @@ def overrides
22372250
"v2.fleet_deployments_page" => "FleetDeploymentsPage",
22382251
"v2.fleet_deployments_response" => "FleetDeploymentsResponse",
22392252
"v2.fleet_deployments_response_meta" => "FleetDeploymentsResponseMeta",
2253+
"v2.fleet_detected_integration" => "FleetDetectedIntegration",
2254+
"v2.fleet_integration_details" => "FleetIntegrationDetails",
2255+
"v2.fleet_integrations_by_status" => "FleetIntegrationsByStatus",
22402256
"v2.fleet_schedule" => "FleetSchedule",
22412257
"v2.fleet_schedule_attributes" => "FleetScheduleAttributes",
22422258
"v2.fleet_schedule_create" => "FleetScheduleCreate",

lib/datadog_api_client/v2/api/fleet_automation_api.rb

Lines changed: 166 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,82 @@ def delete_fleet_schedule_with_http_info(id, opts = {})
427427
return data, status_code, headers
428428
end
429429

430+
# Get detailed information about an agent.
431+
#
432+
# @see #get_fleet_agent_info_with_http_info
433+
def get_fleet_agent_info(agent_key, opts = {})
434+
data, _status_code, _headers = get_fleet_agent_info_with_http_info(agent_key, opts)
435+
data
436+
end
437+
438+
# Get detailed information about an agent.
439+
#
440+
# Retrieve detailed information about a specific Datadog Agent.
441+
# This endpoint returns comprehensive information about an agent including:
442+
# - Agent details and metadata
443+
# - Configured integrations organized by status (working, warning, error, missing)
444+
# - Detected integrations
445+
# - Configuration files and layers
446+
#
447+
# @param agent_key [String] The unique identifier (agent key) for the Datadog Agent.
448+
# @param opts [Hash] the optional parameters
449+
# @return [Array<(FleetAgentInfoResponse, Integer, Hash)>] FleetAgentInfoResponse data, response status code and response headers
450+
def get_fleet_agent_info_with_http_info(agent_key, opts = {})
451+
unstable_enabled = @api_client.config.unstable_operations["v2.get_fleet_agent_info".to_sym]
452+
if unstable_enabled
453+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_fleet_agent_info")
454+
else
455+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_fleet_agent_info"))
456+
end
457+
458+
if @api_client.config.debugging
459+
@api_client.config.logger.debug 'Calling API: FleetAutomationAPI.get_fleet_agent_info ...'
460+
end
461+
# verify the required parameter 'agent_key' is set
462+
if @api_client.config.client_side_validation && agent_key.nil?
463+
fail ArgumentError, "Missing the required parameter 'agent_key' when calling FleetAutomationAPI.get_fleet_agent_info"
464+
end
465+
# resource path
466+
local_var_path = '/api/unstable/fleet/agents/{agent_key}'.sub('{agent_key}', CGI.escape(agent_key.to_s).gsub('%2F', '/'))
467+
468+
# query parameters
469+
query_params = opts[:query_params] || {}
470+
471+
# header parameters
472+
header_params = opts[:header_params] || {}
473+
# HTTP header 'Accept' (if needed)
474+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
475+
476+
# form parameters
477+
form_params = opts[:form_params] || {}
478+
479+
# http body (model)
480+
post_body = opts[:debug_body]
481+
482+
# return_type
483+
return_type = opts[:debug_return_type] || 'FleetAgentInfoResponse'
484+
485+
# auth_names
486+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
487+
488+
new_options = opts.merge(
489+
:operation => :get_fleet_agent_info,
490+
:header_params => header_params,
491+
:query_params => query_params,
492+
:form_params => form_params,
493+
:body => post_body,
494+
:auth_names => auth_names,
495+
:return_type => return_type,
496+
:api_version => "V2"
497+
)
498+
499+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
500+
if @api_client.config.debugging
501+
@api_client.config.logger.debug "API called: FleetAutomationAPI#get_fleet_agent_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
502+
end
503+
return data, status_code, headers
504+
end
505+
430506
# Get a configuration deployment by ID.
431507
#
432508
# @see #get_fleet_deployment_with_http_info
@@ -602,6 +678,95 @@ def get_fleet_schedule_with_http_info(id, opts = {})
602678
return data, status_code, headers
603679
end
604680

681+
# List all Datadog Agents.
682+
#
683+
# @see #list_fleet_agents_with_http_info
684+
def list_fleet_agents(opts = {})
685+
data, _status_code, _headers = list_fleet_agents_with_http_info(opts)
686+
data
687+
end
688+
689+
# List all Datadog Agents.
690+
#
691+
# Retrieve a paginated list of all Datadog Agents.
692+
# This endpoint returns a paginated list of all Datadog Agents with support for pagination, sorting, and filtering.
693+
# Use the `page_number` and `page_size` query parameters to paginate through results.
694+
#
695+
# @param opts [Hash] the optional parameters
696+
# @option opts [Integer] :page_number Page number for pagination (must be greater than 0).
697+
# @option opts [Integer] :page_size Number of results per page (must be greater than 0 and less than or equal to 100).
698+
# @option opts [String] :sort_attribute Attribute to sort by.
699+
# @option opts [Boolean] :sort_descending Sort order (true for descending, false for ascending).
700+
# @option opts [String] :tags Comma-separated list of tags to filter agents.
701+
# @option opts [String] :filter Filter string for narrowing down agent results.
702+
# @return [Array<(FleetAgentsResponse, Integer, Hash)>] FleetAgentsResponse data, response status code and response headers
703+
def list_fleet_agents_with_http_info(opts = {})
704+
unstable_enabled = @api_client.config.unstable_operations["v2.list_fleet_agents".to_sym]
705+
if unstable_enabled
706+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_fleet_agents")
707+
else
708+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_fleet_agents"))
709+
end
710+
711+
if @api_client.config.debugging
712+
@api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_agents ...'
713+
end
714+
if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 1
715+
fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling FleetAutomationAPI.list_fleet_agents, must be greater than or equal to 1.'
716+
end
717+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
718+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_agents, must be smaller than or equal to 100.'
719+
end
720+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
721+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_agents, must be greater than or equal to 1.'
722+
end
723+
# resource path
724+
local_var_path = '/api/unstable/fleet/agents'
725+
726+
# query parameters
727+
query_params = opts[:query_params] || {}
728+
query_params[:'page_number'] = opts[:'page_number'] if !opts[:'page_number'].nil?
729+
query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
730+
query_params[:'sort_attribute'] = opts[:'sort_attribute'] if !opts[:'sort_attribute'].nil?
731+
query_params[:'sort_descending'] = opts[:'sort_descending'] if !opts[:'sort_descending'].nil?
732+
query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?
733+
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
734+
735+
# header parameters
736+
header_params = opts[:header_params] || {}
737+
# HTTP header 'Accept' (if needed)
738+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
739+
740+
# form parameters
741+
form_params = opts[:form_params] || {}
742+
743+
# http body (model)
744+
post_body = opts[:debug_body]
745+
746+
# return_type
747+
return_type = opts[:debug_return_type] || 'FleetAgentsResponse'
748+
749+
# auth_names
750+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
751+
752+
new_options = opts.merge(
753+
:operation => :list_fleet_agents,
754+
:header_params => header_params,
755+
:query_params => query_params,
756+
:form_params => form_params,
757+
:body => post_body,
758+
:auth_names => auth_names,
759+
:return_type => return_type,
760+
:api_version => "V2"
761+
)
762+
763+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
764+
if @api_client.config.debugging
765+
@api_client.config.logger.debug "API called: FleetAutomationAPI#list_fleet_agents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
766+
end
767+
return data, status_code, headers
768+
end
769+
605770
# List all available Agent versions.
606771
#
607772
# @see #list_fleet_agent_versions_with_http_info
@@ -632,7 +797,7 @@ def list_fleet_agent_versions_with_http_info(opts = {})
632797
@api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_agent_versions ...'
633798
end
634799
# resource path
635-
local_var_path = '/api/unstable/fleet/agents'
800+
local_var_path = '/api/unstable/fleet/agent_versions'
636801

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

0 commit comments

Comments
 (0)