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
137 changes: 137 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4969,6 +4969,91 @@ components:
- id
- base_severity
type: object
AgentHealthAgentType:
default: node
description: Agent type associated with the resource.
enum:
- node
- cluster
example: node
type: string
x-enum-varnames:
- NODE
- CLUSTER
AgentHealthHostIssue:
description: An active Agent Health issue associated with a resource.
properties:
category:
description: The category used by the Agent to group and reconcile the issue.
example: configuration
type: string
issue_id:
description: The unique identifier of the issue.
example: invalid-config:4828e7d6c704c4a3
type: string
issue_name:
description: The human-readable name of the issue.
example: Invalid Config
type: string
issue_type:
description: The machine-readable type of the issue.
example: invalid_config
type: string
required:
- issue_id
- issue_name
- issue_type
- category
type: object
AgentHealthHostIssuesAttributes:
description: Active Agent Health issues for a resource.
properties:
issues:
description: The active issues and their reconciliation metadata.
example:
- category: configuration
issue_id: invalid-config:4828e7d6c704c4a3
issue_name: Invalid Config
issue_type: invalid_config
items:
$ref: "#/components/schemas/AgentHealthHostIssue"
type: array
required:
- issues
type: object
AgentHealthHostIssuesData:
description: Agent Health issue data for a resource.
properties:
attributes:
$ref: "#/components/schemas/AgentHealthHostIssuesAttributes"
id:
description: The resource identifier.
example: 123e4567-e89b-12d3-a456-426614174000
type: string
type:
$ref: "#/components/schemas/AgentHealthHostIssuesType"
required:
- id
- type
- attributes
type: object
AgentHealthHostIssuesResponse:
description: Response containing the active Agent Health issues for a resource.
properties:
data:
$ref: "#/components/schemas/AgentHealthHostIssuesData"
required:
- data
type: object
AgentHealthHostIssuesType:
default: agent_health_issues
description: The Agent Health issue resource type.
enum:
- agent_health_issues
example: agent_health_issues
type: string
x-enum-varnames:
- AGENT_HEALTH_ISSUES
AgentTrigger:
description: "Trigger a workflow from an agent via the MCP execute tool. Workflow can be executed from Bits Chat, Bits Agent Builder, Claude Code, Codex, Cursor, and any other coding agent using the Datadog MCP."
properties:
Expand Down Expand Up @@ -144008,6 +144093,56 @@ paths:
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/agenthealth/hosts/{resource_id}/issues:
get:
description: Returns the active Agent Health issues for a node Agent or Cluster Agent resource.
operationId: ListAgentHealthHostIssues
parameters:
- description: >-
Resource identifier whose active Agent Health issues should be returned: a DaemonSet UID for a node Agent or a cluster UUID for a Cluster Agent.
example: 123e4567-e89b-12d3-a456-426614174000
in: path
name: resource_id
required: true
schema:
type: string
- description: Agent type associated with the resource. Defaults to `node` when omitted.
example: node
in: query
name: agent_type
required: false
schema:
$ref: "#/components/schemas/AgentHealthAgentType"
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
issues:
- category: configuration
issue_id: invalid-config:4828e7d6c704c4a3
issue_name: Invalid Config
issue_type: invalid_config
id: 123e4567-e89b-12d3-a456-426614174000
type: agent_health_issues
schema:
$ref: "#/components/schemas/AgentHealthHostIssuesResponse"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
"403":
$ref: "#/components/responses/ForbiddenResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
summary: List active Agent Health issues
tags:
- Agent Health
/api/v2/agentless_scanning/accounts/aws:
get:
description: Fetches the scan options configured for AWS accounts.
Expand Down Expand Up @@ -250883,6 +251018,8 @@ tags:
externalDocs:
url: https://docs.datadoghq.com/actions/datastore
name: Actions Datastores
- description: View Agent Health issues reported for node Agents and Cluster Agents.
name: Agent Health
- description: >-
Manage Agent Observability spans, data, projects, datasets, dataset records, experiments, prompts, and annotations.
name: Agent Observability
Expand Down
8 changes: 8 additions & 0 deletions examples/v2/agent-health/ListAgentHealthHostIssues.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# List active Agent Health issues returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::AgentHealthAPI.new
opts = {
agent_type: AgentHealthAgentType::NODE,
}
p api_instance.list_agent_health_host_issues("123e4567-e89b-12d3-a456-426614174000", opts)
4 changes: 4 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,10 @@
"policy_id" => "String",
"body" => "ExecutionPolicyUpdateRequest",
},
"v2.ListAgentHealthHostIssues" => {
"resource_id" => "String",
"agent_type" => "AgentHealthAgentType",
},
"v2.CreateAwsScanOptions" => {
"body" => "AwsScanOptionsCreateRequest",
},
Expand Down
21 changes: 21 additions & 0 deletions features/v2/agent_health.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@endpoint(agent-health) @endpoint(agent-health-v2)
Feature: Agent Health
View Agent Health issues reported for node Agents and Cluster Agents.

Background:
Given a valid "apiKeyAuth" key in the system
And an instance of "AgentHealth" API
And new "ListAgentHealthHostIssues" request
And request contains "resource_id" parameter with value "123e4567-e89b-12d3-a456-426614174000"

@skip @team:ddoghq/fleet-remediation
Scenario: List active Agent Health issues returns "Bad Request" response
Given request contains "agent_type" parameter with value "process"
When the request is sent
Then the response status is 400 Bad Request

@skip @team:ddoghq/fleet-remediation
Scenario: List active Agent Health issues returns "OK" response
Given request contains "agent_type" parameter with value "node"
When the request is sent
Then the response status is 200 OK
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@
"type": "idempotent"
}
},
"ListAgentHealthHostIssues": {
"tag": "Agent Health",
"undo": {
"type": "safe"
}
},
"ListAwsScanOptions": {
"tag": "Agentless Scanning",
"undo": {
Expand Down
7 changes: 7 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,12 @@ def overrides
"v2.active_billing_dimensions_type" => "ActiveBillingDimensionsType",
"v2.add_member_team_request" => "AddMemberTeamRequest",
"v2.advisory" => "Advisory",
"v2.agent_health_agent_type" => "AgentHealthAgentType",
"v2.agent_health_host_issue" => "AgentHealthHostIssue",
"v2.agent_health_host_issues_attributes" => "AgentHealthHostIssuesAttributes",
"v2.agent_health_host_issues_data" => "AgentHealthHostIssuesData",
"v2.agent_health_host_issues_response" => "AgentHealthHostIssuesResponse",
"v2.agent_health_host_issues_type" => "AgentHealthHostIssuesType",
"v2.agent_trigger" => "AgentTrigger",
"v2.agent_trigger_wrapper" => "AgentTriggerWrapper",
"v2.aggregated_long_tasks_by_invoker_type" => "AggregatedLongTasksByInvokerType",
Expand Down Expand Up @@ -9715,6 +9721,7 @@ def overrides
"v1.webhooks_integration_api" => "WebhooksIntegrationAPI",
"v2.action_connection_api" => "ActionConnectionAPI",
"v2.actions_datastores_api" => "ActionsDatastoresAPI",
"v2.agent_health_api" => "AgentHealthAPI",
"v2.agent_observability_api" => "AgentObservabilityAPI",
"v2.agentless_scanning_api" => "AgentlessScanningAPI",
"v2.annotations_api" => "AnnotationsAPI",
Expand Down
97 changes: 97 additions & 0 deletions lib/datadog_api_client/v2/api/agent_health_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
=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 AgentHealthAPI
attr_accessor :api_client

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

# List active Agent Health issues.
#
# @see #list_agent_health_host_issues_with_http_info
def list_agent_health_host_issues(resource_id, opts = {})
data, _status_code, _headers = list_agent_health_host_issues_with_http_info(resource_id, opts)
data
end

# List active Agent Health issues.
#
# Returns the active Agent Health issues for a node Agent or Cluster Agent resource.
#
# @param resource_id [String] Resource identifier whose active Agent Health issues should be returned: a DaemonSet UID for a node Agent or a cluster UUID for a Cluster Agent.
# @param opts [Hash] the optional parameters
# @option opts [AgentHealthAgentType] :agent_type Agent type associated with the resource. Defaults to `node` when omitted.
# @return [Array<(AgentHealthHostIssuesResponse, Integer, Hash)>] AgentHealthHostIssuesResponse data, response status code and response headers
def list_agent_health_host_issues_with_http_info(resource_id, opts = {})

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: AgentHealthAPI.list_agent_health_host_issues ...'
end
# verify the required parameter 'resource_id' is set
if @api_client.config.client_side_validation && resource_id.nil?
fail ArgumentError, "Missing the required parameter 'resource_id' when calling AgentHealthAPI.list_agent_health_host_issues"
end
allowable_values = ['node', 'cluster']
if @api_client.config.client_side_validation && opts[:'agent_type'] && !allowable_values.include?(opts[:'agent_type'])
fail ArgumentError, "invalid value for \"agent_type\", must be one of #{allowable_values}"
end
# resource path
local_var_path = '/api/v2/agenthealth/hosts/{resource_id}/issues'.sub('{resource_id}', CGI.escape(resource_id.to_s).gsub('%2F', '/'))

# query parameters
query_params = opts[:query_params] || {}
query_params[:'agent_type'] = opts[:'agent_type'] if !opts[:'agent_type'].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] || 'AgentHealthHostIssuesResponse'

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

new_options = opts.merge(
:operation => :list_agent_health_host_issues,
: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: AgentHealthAPI#list_agent_health_host_issues\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
end
27 changes: 27 additions & 0 deletions lib/datadog_api_client/v2/models/agent_health_agent_type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
=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 'date'
require 'time'

module DatadogAPIClient::V2
# Agent type associated with the resource.
class AgentHealthAgentType
include BaseEnumModel

NODE = "node".freeze
CLUSTER = "cluster".freeze
end
end
Loading
Loading