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
256 changes: 143 additions & 113 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1296,8 +1296,7 @@
"agent_type" => "AgentHealthAgentType",
},
"v2.ListAgentHealthIssues" => {
"page_size" => "Integer",
"page_number" => "Integer",
"count_by" => "AgentHealthIssuesCountBy",
"filter_severity" => "String",
"filter_category" => "String",
"filter_issue_type" => "String",
Expand Down
2 changes: 1 addition & 1 deletion features/v2/agent_health.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Feature: Agent Health
Given a valid "appKeyAuth" key in the system
And operation "ListAgentHealthIssues" enabled
And new "ListAgentHealthIssues" request
And request contains "page[size]" parameter with value 1000
And request contains "count_by" parameter with value "invalid"
When the request is sent
Then the response status is 400 Bad Request

Expand Down
5 changes: 3 additions & 2 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1311,12 +1311,13 @@ def overrides
"v2.agent_health_host_issues_data" => "AgentHealthHostIssuesData",
"v2.agent_health_host_issues_response" => "AgentHealthHostIssuesResponse",
"v2.agent_health_host_issues_type" => "AgentHealthHostIssuesType",
"v2.agent_health_issue_attributes" => "AgentHealthIssueAttributes",
"v2.agent_health_issue_data" => "AgentHealthIssueData",
"v2.agent_health_issue" => "AgentHealthIssue",
"v2.agent_health_issue_detail_attributes" => "AgentHealthIssueDetailAttributes",
"v2.agent_health_issue_detail_data" => "AgentHealthIssueDetailData",
"v2.agent_health_issue_group" => "AgentHealthIssueGroup",
"v2.agent_health_issue_resource_type" => "AgentHealthIssueResourceType",
"v2.agent_health_issue_response" => "AgentHealthIssueResponse",
"v2.agent_health_issues_count_by" => "AgentHealthIssuesCountBy",
"v2.agent_health_issues_response" => "AgentHealthIssuesResponse",
"v2.agent_health_issues_response_meta" => "AgentHealthIssuesResponseMeta",
"v2.agent_health_issues_response_page" => "AgentHealthIssuesResponsePage",
Expand Down
38 changes: 15 additions & 23 deletions lib/datadog_api_client/v2/api/agent_health_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,23 +181,24 @@ def list_agent_health_issues(opts = {})

# List Agent Health issues.
#
# List Agent Health issues across your organization. Only open issues are returned.
# Returns `403` if you lack the `hosts_read` permission.
# List open Agent Health issues across your organization, grouped by issue type.
# Only open issues are returned. Returns `403` if you lack the `hosts_read` permission.
#
# Results use a stable order: severity rank (`high`, `medium`, `low`, then other values),
# then `first_seen_at` descending with missing timestamps last, then issue ID ascending.
# Use `page[size]` and the zero-based `page[number]` to paginate. Invalid page values
# return a `400` JSON:API error response. `meta.page.total_filtered_count` is the number
# of issues matching the filters, and `meta.page.total_count` the number of open issues
# in the organization.
# Each group in `data` holds the issues for one `issue_type`; issues with no type are
# grouped under `unknown`. Within a group, issues use a stable order: severity rank
# (`high`, `medium`, `low`, then other values), then `first_seen_at` descending with
# missing timestamps last, then issue ID ascending.
#
# Set `count_by=issue_type` to include `meta.page`, where `total_count` is the number of
# open issues matching the filters and `counts_by_issue_type` holds the per-type counts.
# `meta` is omitted when `count_by` is not requested.
#
# Each filter accepts up to 50 comma-separated exact values of at most 256 characters
# each, combined with OR within a filter and AND across filters. Blank entries are ignored; an all-blank filter
# is treated as absent.
#
# @param opts [Hash] the optional parameters
# @option opts [Integer] :page_size The number of issues to return per page, from 1 to 100. Defaults to 25.
# @option opts [Integer] :page_number The zero-based page number, from 0 to 1000000. Defaults to 0.
# @option opts [AgentHealthIssuesCountBy] :count_by Set to `issue_type` to include `meta.page` with `total_count` and per-issue-type counts. Omitted by default so the endpoint skips the extra count query. Only `issue_type` is supported.
# @option opts [String] :filter_severity Filter by a comma-separated list of exact `severity` values, up to 50 values of at most 256 characters each. Values are combined with OR within this filter and AND across filters. Blank entries are ignored; an all-blank filter is treated as absent.
# @option opts [String] :filter_category Filter by a comma-separated list of exact `category` values, up to 50 values of at most 256 characters each. Values are combined with OR within this filter and AND across filters. Blank entries are ignored; an all-blank filter is treated as absent.
# @option opts [String] :filter_issue_type Filter by a comma-separated list of exact `issue_type` values, up to 50 values of at most 256 characters each. Values are combined with OR within this filter and AND across filters. Blank entries are ignored; an all-blank filter is treated as absent.
Expand All @@ -215,17 +216,9 @@ def list_agent_health_issues_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: AgentHealthAPI.list_agent_health_issues ...'
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 AgentHealthAPI.list_agent_health_issues, 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 AgentHealthAPI.list_agent_health_issues, must be greater than or equal to 1.'
end
if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] > 1000000
fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling AgentHealthAPI.list_agent_health_issues, must be smaller than or equal to 1000000.'
end
if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0
fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling AgentHealthAPI.list_agent_health_issues, must be greater than or equal to 0.'
allowable_values = ['issue_type']
if @api_client.config.client_side_validation && opts[:'count_by'] && !allowable_values.include?(opts[:'count_by'])
fail ArgumentError, "invalid value for \"count_by\", must be one of #{allowable_values}"
end
if @api_client.config.client_side_validation && !opts[:'filter_severity'].nil? && opts[:'filter_severity'].to_s.length > 12850
fail ArgumentError, 'invalid value for "opts[:"filter_severity"]" when calling AgentHealthAPI.list_agent_health_issues, the character length must be smaller than or equal to 12850.'
Expand All @@ -247,8 +240,7 @@ def list_agent_health_issues_with_http_info(opts = {})

# query parameters
query_params = opts[:query_params] || {}
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
query_params[:'count_by'] = opts[:'count_by'] if !opts[:'count_by'].nil?
query_params[:'filter[severity]'] = opts[:'filter_severity'] if !opts[:'filter_severity'].nil?
query_params[:'filter[category]'] = opts[:'filter_category'] if !opts[:'filter_category'].nil?
query_params[:'filter[issue_type]'] = opts[:'filter_issue_type'] if !opts[:'filter_issue_type'].nil?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
require 'time'

module DatadogAPIClient::V2
# Attributes of an open Agent Health issue.
class AgentHealthIssueAttributes
# An open Agent Health issue.
class AgentHealthIssue
include BaseGenericModel

# The category of the issue, such as `configuration`. Omitted when not set.
Expand All @@ -27,14 +27,20 @@ class AgentHealthIssueAttributes
# The description of the issue. Omitted when empty.
attr_accessor :description

# Free-form, issue-type-specific context. Keys are not part of the stable schema. Omitted when empty.
attr_accessor :extra

# The time the issue was first seen, in RFC 3339 format. Omitted when empty.
attr_accessor :first_seen_at

# The unique identifier of the issue.
attr_reader :id

# The human-readable name of the issue.
attr_reader :issue_name

# The machine-readable type of the issue.
attr_reader :issue_type
# Remediation for the issue. Omitted when no remediation is available.
attr_accessor :remediation

# The identifier of the affected resource, interpreted according to `resource_kind`: hostname for `host`, DaemonSet UID for `deployment` (node Agent), cluster UUID for `cluster`, hostname of the host running the Cluster Agent for `cluster_agent`, or OpenTelemetry collector ID for `otel`.
attr_reader :resource_id
Expand Down Expand Up @@ -68,9 +74,11 @@ def self.attribute_map
{
:'category' => :'category',
:'description' => :'description',
:'extra' => :'extra',
:'first_seen_at' => :'first_seen_at',
:'id' => :'id',
:'issue_name' => :'issue_name',
:'issue_type' => :'issue_type',
:'remediation' => :'remediation',
:'resource_id' => :'resource_id',
:'resource_kind' => :'resource_kind',
:'resource_type' => :'resource_type',
Expand All @@ -88,9 +96,11 @@ def self.openapi_types
{
:'category' => :'String',
:'description' => :'String',
:'extra' => :'Hash<String, Object>',
:'first_seen_at' => :'Time',
:'id' => :'String',
:'issue_name' => :'String',
:'issue_type' => :'String',
:'remediation' => :'AgentHealthRemediation',
:'resource_id' => :'String',
:'resource_kind' => :'String',
:'resource_type' => :'String',
Expand All @@ -107,7 +117,7 @@ def self.openapi_types
# @!visibility private
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AgentHealthIssueAttributes` initialize method"
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AgentHealthIssue` initialize method"
end

self.additional_properties = {}
Expand All @@ -128,16 +138,24 @@ def initialize(attributes = {})
self.description = attributes[:'description']
end

if attributes.key?(:'extra')
self.extra = attributes[:'extra']
end

if attributes.key?(:'first_seen_at')
self.first_seen_at = attributes[:'first_seen_at']
end

if attributes.key?(:'id')
self.id = attributes[:'id']
end

if attributes.key?(:'issue_name')
self.issue_name = attributes[:'issue_name']
end

if attributes.key?(:'issue_type')
self.issue_type = attributes[:'issue_type']
if attributes.key?(:'remediation')
self.remediation = attributes[:'remediation']
end

if attributes.key?(:'resource_id')
Expand Down Expand Up @@ -179,8 +197,8 @@ def initialize(attributes = {})
# @return true if the model is valid
# @!visibility private
def valid?
return false if @id.nil?
return false if @issue_name.nil?
return false if @issue_type.nil?
return false if @resource_id.nil?
return false if @resource_kind.nil?
return false if @severity.nil?
Expand All @@ -189,23 +207,23 @@ def valid?
end

# Custom attribute writer method with validation
# @param issue_name [Object] Object to be assigned
# @param id [Object] Object to be assigned
# @!visibility private
def issue_name=(issue_name)
if issue_name.nil?
fail ArgumentError, 'invalid value for "issue_name", issue_name cannot be nil.'
def id=(id)
if id.nil?
fail ArgumentError, 'invalid value for "id", id cannot be nil.'
end
@issue_name = issue_name
@id = id
end

# Custom attribute writer method with validation
# @param issue_type [Object] Object to be assigned
# @param issue_name [Object] Object to be assigned
# @!visibility private
def issue_type=(issue_type)
if issue_type.nil?
fail ArgumentError, 'invalid value for "issue_type", issue_type cannot be nil.'
def issue_name=(issue_name)
if issue_name.nil?
fail ArgumentError, 'invalid value for "issue_name", issue_name cannot be nil.'
end
@issue_type = issue_type
@issue_name = issue_name
end

# Custom attribute writer method with validation
Expand Down Expand Up @@ -276,9 +294,11 @@ def ==(o)
self.class == o.class &&
category == o.category &&
description == o.description &&
extra == o.extra &&
first_seen_at == o.first_seen_at &&
id == o.id &&
issue_name == o.issue_name &&
issue_type == o.issue_type &&
remediation == o.remediation &&
resource_id == o.resource_id &&
resource_kind == o.resource_kind &&
resource_type == o.resource_type &&
Expand All @@ -294,7 +314,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[category, description, first_seen_at, issue_name, issue_type, resource_id, resource_kind, resource_type, severity, state, tags, title, updated_at, additional_properties].hash
[category, description, extra, first_seen_at, id, issue_name, remediation, resource_id, resource_kind, resource_type, severity, state, tags, title, updated_at, additional_properties].hash
end
end
end
Loading
Loading