Skip to content

Commit 0efcba7

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 0d1729a of spec repo
1 parent b25c67e commit 0efcba7

18 files changed

+2157
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 418 additions & 0 deletions
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")

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,9 @@
838838
"user_handle" => "String",
839839
"body" => "User",
840840
},
841+
"v2.GetFleetAgentInfo" => {
842+
"agent_key" => "String",
843+
},
841844
"v2.ListFleetDeployments" => {
842845
"page_size" => "Integer",
843846
"page_offset" => "Integer",

features/v2/fleet_automation.feature

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,30 @@ 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+
155179
@generated @skip @team:DataDog/fleet-automation
156180
Scenario: List all available Agent versions returns "Bad Request" response
157181
Given operation "ListFleetAgentVersions" enabled

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
"type": "safe"
66
}
77
},
8+
"GetFleetAgentInfo": {
9+
"tag": "Fleet Automation",
10+
"undo": {
11+
"type": "safe"
12+
}
13+
},
814
"ListFleetDeployments": {
915
"tag": "Fleet Automation",
1016
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ 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,
199200
"v2.list_fleet_agent_versions": false,

lib/datadog_api_client/inflector.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,10 +2213,17 @@ 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_info" => "FleetAgentInfo",
2217+
"v2.fleet_agent_info_attributes" => "FleetAgentInfoAttributes",
2218+
"v2.fleet_agent_info_details" => "FleetAgentInfoDetails",
2219+
"v2.fleet_agent_info_resource_type" => "FleetAgentInfoResourceType",
2220+
"v2.fleet_agent_info_response" => "FleetAgentInfoResponse",
22162221
"v2.fleet_agent_version" => "FleetAgentVersion",
22172222
"v2.fleet_agent_version_attributes" => "FleetAgentVersionAttributes",
22182223
"v2.fleet_agent_version_resource_type" => "FleetAgentVersionResourceType",
22192224
"v2.fleet_agent_versions_response" => "FleetAgentVersionsResponse",
2225+
"v2.fleet_configuration_file" => "FleetConfigurationFile",
2226+
"v2.fleet_configuration_layer" => "FleetConfigurationLayer",
22202227
"v2.fleet_deployment" => "FleetDeployment",
22212228
"v2.fleet_deployment_attributes" => "FleetDeploymentAttributes",
22222229
"v2.fleet_deployment_configure_attributes" => "FleetDeploymentConfigureAttributes",
@@ -2237,6 +2244,9 @@ def overrides
22372244
"v2.fleet_deployments_page" => "FleetDeploymentsPage",
22382245
"v2.fleet_deployments_response" => "FleetDeploymentsResponse",
22392246
"v2.fleet_deployments_response_meta" => "FleetDeploymentsResponseMeta",
2247+
"v2.fleet_detected_integration" => "FleetDetectedIntegration",
2248+
"v2.fleet_integration_details" => "FleetIntegrationDetails",
2249+
"v2.fleet_integrations_by_status" => "FleetIntegrationsByStatus",
22402250
"v2.fleet_schedule" => "FleetSchedule",
22412251
"v2.fleet_schedule_attributes" => "FleetScheduleAttributes",
22422252
"v2.fleet_schedule_create" => "FleetScheduleCreate",

lib/datadog_api_client/v2/api/fleet_automation_api.rb

Lines changed: 76 additions & 0 deletions
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
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
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 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# Represents detailed information about a specific Datadog Agent.
21+
class FleetAgentInfo
22+
include BaseGenericModel
23+
24+
# Attributes for agent information.
25+
attr_reader :attributes
26+
27+
# The unique agent key identifier.
28+
attr_reader :id
29+
30+
# The type of Agent info resource.
31+
attr_reader :type
32+
33+
attr_accessor :additional_properties
34+
35+
# Attribute mapping from ruby-style variable name to JSON key.
36+
# @!visibility private
37+
def self.attribute_map
38+
{
39+
:'attributes' => :'attributes',
40+
:'id' => :'id',
41+
:'type' => :'type'
42+
}
43+
end
44+
45+
# Attribute type mapping.
46+
# @!visibility private
47+
def self.openapi_types
48+
{
49+
:'attributes' => :'FleetAgentInfoAttributes',
50+
:'id' => :'String',
51+
:'type' => :'FleetAgentInfoResourceType'
52+
}
53+
end
54+
55+
# Initializes the object
56+
# @param attributes [Hash] Model attributes in the form of hash
57+
# @!visibility private
58+
def initialize(attributes = {})
59+
if (!attributes.is_a?(Hash))
60+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentInfo` initialize method"
61+
end
62+
63+
self.additional_properties = {}
64+
# check to see if the attribute exists and convert string to symbol for hash key
65+
attributes = attributes.each_with_object({}) { |(k, v), h|
66+
if (!self.class.attribute_map.key?(k.to_sym))
67+
self.additional_properties[k.to_sym] = v
68+
else
69+
h[k.to_sym] = v
70+
end
71+
}
72+
73+
if attributes.key?(:'attributes')
74+
self.attributes = attributes[:'attributes']
75+
end
76+
77+
if attributes.key?(:'id')
78+
self.id = attributes[:'id']
79+
end
80+
81+
if attributes.key?(:'type')
82+
self.type = attributes[:'type']
83+
end
84+
end
85+
86+
# Check to see if the all the properties in the model are valid
87+
# @return true if the model is valid
88+
# @!visibility private
89+
def valid?
90+
return false if @attributes.nil?
91+
return false if @id.nil?
92+
return false if @type.nil?
93+
true
94+
end
95+
96+
# Custom attribute writer method with validation
97+
# @param attributes [Object] Object to be assigned
98+
# @!visibility private
99+
def attributes=(attributes)
100+
if attributes.nil?
101+
fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.'
102+
end
103+
@attributes = attributes
104+
end
105+
106+
# Custom attribute writer method with validation
107+
# @param id [Object] Object to be assigned
108+
# @!visibility private
109+
def id=(id)
110+
if id.nil?
111+
fail ArgumentError, 'invalid value for "id", id cannot be nil.'
112+
end
113+
@id = id
114+
end
115+
116+
# Custom attribute writer method with validation
117+
# @param type [Object] Object to be assigned
118+
# @!visibility private
119+
def type=(type)
120+
if type.nil?
121+
fail ArgumentError, 'invalid value for "type", type cannot be nil.'
122+
end
123+
@type = type
124+
end
125+
126+
# Returns the object in the form of hash, with additionalProperties support.
127+
# @return [Hash] Returns the object in the form of hash
128+
# @!visibility private
129+
def to_hash
130+
hash = {}
131+
self.class.attribute_map.each_pair do |attr, param|
132+
value = self.send(attr)
133+
if value.nil?
134+
is_nullable = self.class.openapi_nullable.include?(attr)
135+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
136+
end
137+
138+
hash[param] = _to_hash(value)
139+
end
140+
self.additional_properties.each_pair do |attr, value|
141+
hash[attr] = value
142+
end
143+
hash
144+
end
145+
146+
# Checks equality by comparing each attribute.
147+
# @param o [Object] Object to be compared
148+
# @!visibility private
149+
def ==(o)
150+
return true if self.equal?(o)
151+
self.class == o.class &&
152+
attributes == o.attributes &&
153+
id == o.id &&
154+
type == o.type &&
155+
additional_properties == o.additional_properties
156+
end
157+
158+
# Calculates hash code according to all attributes.
159+
# @return [Integer] Hash code
160+
# @!visibility private
161+
def hash
162+
[attributes, id, type, additional_properties].hash
163+
end
164+
end
165+
end

0 commit comments

Comments
 (0)