Skip to content
Open
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
639 changes: 638 additions & 1 deletion .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions examples/v2/fleet-automation/GetFleetAgentInfo.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get detailed information about an agent returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_fleet_agent_info".to_sym] = true
end
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
p api_instance.get_fleet_agent_info("agent_key")
8 changes: 8 additions & 0 deletions examples/v2/fleet-automation/ListFleetAgents.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List all Datadog Agents returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.list_fleet_agents".to_sym] = true
end
api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new
p api_instance.list_fleet_agents()
11 changes: 11 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,17 @@
"user_handle" => "String",
"body" => "User",
},
"v2.ListFleetAgents" => {
"page_number" => "Integer",
"page_size" => "Integer",
"sort_attribute" => "String",
"sort_descending" => "Boolean",
"tags" => "String",
"filter" => "String",
},
"v2.GetFleetAgentInfo" => {
"agent_key" => "String",
},
"v2.ListFleetDeployments" => {
"page_size" => "Integer",
"page_offset" => "Integer",
Expand Down
45 changes: 45 additions & 0 deletions features/v2/fleet_automation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,51 @@ Feature: Fleet Automation
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/fleet-automation
Scenario: Get detailed information about an agent returns "Bad Request" response
Given operation "GetFleetAgentInfo" enabled
And new "GetFleetAgentInfo" request
And request contains "agent_key" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/fleet-automation
Scenario: Get detailed information about an agent returns "Not Found" response
Given operation "GetFleetAgentInfo" enabled
And new "GetFleetAgentInfo" request
And request contains "agent_key" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/fleet-automation
Scenario: Get detailed information about an agent returns "OK" response
Given operation "GetFleetAgentInfo" enabled
And new "GetFleetAgentInfo" request
And request contains "agent_key" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/fleet-automation
Scenario: List all Datadog Agents returns "Bad Request" response
Given operation "ListFleetAgents" enabled
And new "ListFleetAgents" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/fleet-automation
Scenario: List all Datadog Agents returns "Not Found" response
Given operation "ListFleetAgents" enabled
And new "ListFleetAgents" request
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/fleet-automation
Scenario: List all Datadog Agents returns "OK" response
Given operation "ListFleetAgents" enabled
And new "ListFleetAgents" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/fleet-automation
Scenario: List all available Agent versions returns "Bad Request" response
Given operation "ListFleetAgentVersions" enabled
Expand Down
12 changes: 12 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
"type": "safe"
}
},
"ListFleetAgents": {
"tag": "Fleet Automation",
"undo": {
"type": "safe"
}
},
"GetFleetAgentInfo": {
"tag": "Fleet Automation",
"undo": {
"type": "safe"
}
},
"ListFleetDeployments": {
"tag": "Fleet Automation",
"undo": {
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ def initialize
"v2.create_fleet_deployment_upgrade": false,
"v2.create_fleet_schedule": false,
"v2.delete_fleet_schedule": false,
"v2.get_fleet_agent_info": false,
"v2.get_fleet_deployment": false,
"v2.get_fleet_schedule": false,
"v2.list_fleet_agents": false,
"v2.list_fleet_agent_versions": false,
"v2.list_fleet_deployments": false,
"v2.list_fleet_schedules": false,
Expand Down
16 changes: 16 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2213,10 +2213,23 @@ def overrides
"v2.flaky_tests_search_sort" => "FlakyTestsSearchSort",
"v2.flaky_test_stats" => "FlakyTestStats",
"v2.flaky_test_type" => "FlakyTestType",
"v2.fleet_agent_attributes" => "FleetAgentAttributes",
"v2.fleet_agent_attributes_tags_items" => "FleetAgentAttributesTagsItems",
"v2.fleet_agent_info" => "FleetAgentInfo",
"v2.fleet_agent_info_attributes" => "FleetAgentInfoAttributes",
"v2.fleet_agent_info_details" => "FleetAgentInfoDetails",
"v2.fleet_agent_info_resource_type" => "FleetAgentInfoResourceType",
"v2.fleet_agent_info_response" => "FleetAgentInfoResponse",
"v2.fleet_agents_response" => "FleetAgentsResponse",
"v2.fleet_agents_response_data" => "FleetAgentsResponseData",
"v2.fleet_agents_response_data_attributes" => "FleetAgentsResponseDataAttributes",
"v2.fleet_agents_response_meta" => "FleetAgentsResponseMeta",
"v2.fleet_agent_version" => "FleetAgentVersion",
"v2.fleet_agent_version_attributes" => "FleetAgentVersionAttributes",
"v2.fleet_agent_version_resource_type" => "FleetAgentVersionResourceType",
"v2.fleet_agent_versions_response" => "FleetAgentVersionsResponse",
"v2.fleet_configuration_file" => "FleetConfigurationFile",
"v2.fleet_configuration_layer" => "FleetConfigurationLayer",
"v2.fleet_deployment" => "FleetDeployment",
"v2.fleet_deployment_attributes" => "FleetDeploymentAttributes",
"v2.fleet_deployment_configure_attributes" => "FleetDeploymentConfigureAttributes",
Expand All @@ -2237,6 +2250,9 @@ def overrides
"v2.fleet_deployments_page" => "FleetDeploymentsPage",
"v2.fleet_deployments_response" => "FleetDeploymentsResponse",
"v2.fleet_deployments_response_meta" => "FleetDeploymentsResponseMeta",
"v2.fleet_detected_integration" => "FleetDetectedIntegration",
"v2.fleet_integration_details" => "FleetIntegrationDetails",
"v2.fleet_integrations_by_status" => "FleetIntegrationsByStatus",
"v2.fleet_schedule" => "FleetSchedule",
"v2.fleet_schedule_attributes" => "FleetScheduleAttributes",
"v2.fleet_schedule_create" => "FleetScheduleCreate",
Expand Down
167 changes: 166 additions & 1 deletion lib/datadog_api_client/v2/api/fleet_automation_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,82 @@ def delete_fleet_schedule_with_http_info(id, opts = {})
return data, status_code, headers
end

# Get detailed information about an agent.
#
# @see #get_fleet_agent_info_with_http_info
def get_fleet_agent_info(agent_key, opts = {})
data, _status_code, _headers = get_fleet_agent_info_with_http_info(agent_key, opts)
data
end

# Get detailed information about an agent.
#
# Retrieve detailed information about a specific Datadog Agent.
# This endpoint returns comprehensive information about an agent including:
# - Agent details and metadata
# - Configured integrations organized by status (working, warning, error, missing)
# - Detected integrations
# - Configuration files and layers
#
# @param agent_key [String] The unique identifier (agent key) for the Datadog Agent.
# @param opts [Hash] the optional parameters
# @return [Array<(FleetAgentInfoResponse, Integer, Hash)>] FleetAgentInfoResponse data, response status code and response headers
def get_fleet_agent_info_with_http_info(agent_key, opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.get_fleet_agent_info".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_fleet_agent_info")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_fleet_agent_info"))
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FleetAutomationAPI.get_fleet_agent_info ...'
end
# verify the required parameter 'agent_key' is set
if @api_client.config.client_side_validation && agent_key.nil?
fail ArgumentError, "Missing the required parameter 'agent_key' when calling FleetAutomationAPI.get_fleet_agent_info"
end
# resource path
local_var_path = '/api/unstable/fleet/agents/{agent_key}'.sub('{agent_key}', CGI.escape(agent_key.to_s).gsub('%2F', '/'))

# 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] || 'FleetAgentInfoResponse'

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

new_options = opts.merge(
:operation => :get_fleet_agent_info,
: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: FleetAutomationAPI#get_fleet_agent_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Get a configuration deployment by ID.
#
# @see #get_fleet_deployment_with_http_info
Expand Down Expand Up @@ -602,6 +678,95 @@ def get_fleet_schedule_with_http_info(id, opts = {})
return data, status_code, headers
end

# List all Datadog Agents.
#
# @see #list_fleet_agents_with_http_info
def list_fleet_agents(opts = {})
data, _status_code, _headers = list_fleet_agents_with_http_info(opts)
data
end

# List all Datadog Agents.
#
# Retrieve a paginated list of all Datadog Agents.
# This endpoint returns a paginated list of all Datadog Agents with support for pagination, sorting, and filtering.
# Use the `page_number` and `page_size` query parameters to paginate through results.
#
# @param opts [Hash] the optional parameters
# @option opts [Integer] :page_number Page number for pagination (must be greater than 0).
# @option opts [Integer] :page_size Number of results per page (must be greater than 0 and less than or equal to 100).
# @option opts [String] :sort_attribute Attribute to sort by.
# @option opts [Boolean] :sort_descending Sort order (true for descending, false for ascending).
# @option opts [String] :tags Comma-separated list of tags to filter agents.
# @option opts [String] :filter Filter string for narrowing down agent results.
# @return [Array<(FleetAgentsResponse, Integer, Hash)>] FleetAgentsResponse data, response status code and response headers
def list_fleet_agents_with_http_info(opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.list_fleet_agents".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_fleet_agents")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_fleet_agents"))
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_agents ...'
end
if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling FleetAutomationAPI.list_fleet_agents, must be greater than or equal to 1.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_agents, must be smaller than or equal to 100.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_agents, must be greater than or equal to 1.'
end
# resource path
local_var_path = '/api/unstable/fleet/agents'

# query parameters
query_params = opts[:query_params] || {}
query_params[:'page_number'] = opts[:'page_number'] if !opts[:'page_number'].nil?
query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
query_params[:'sort_attribute'] = opts[:'sort_attribute'] if !opts[:'sort_attribute'].nil?
query_params[:'sort_descending'] = opts[:'sort_descending'] if !opts[:'sort_descending'].nil?
query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

# 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] || 'FleetAgentsResponse'

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

new_options = opts.merge(
:operation => :list_fleet_agents,
: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: FleetAutomationAPI#list_fleet_agents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# List all available Agent versions.
#
# @see #list_fleet_agent_versions_with_http_info
Expand Down Expand Up @@ -632,7 +797,7 @@ def list_fleet_agent_versions_with_http_info(opts = {})
@api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_agent_versions ...'
end
# resource path
local_var_path = '/api/unstable/fleet/agents'
local_var_path = '/api/unstable/fleet/agent_versions'

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