From 96f56ecdd2cfa55ee068bcc55cbf40e9bc45b3ab Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 16 Nov 2026 18:34:01 +0000 Subject: [PATCH] Regenerate client from commit 9b3b198 of spec repo --- .generator/schemas/v2/openapi.yaml | 256 ++++++++++-------- features/scenarios_model_mapping.rb | 3 +- features/v2/agent_health.feature | 2 +- lib/datadog_api_client/inflector.rb | 5 +- .../v2/api/agent_health_api.rb | 38 +-- ...ue_attributes.rb => agent_health_issue.rb} | 64 +++-- ...ue_data.rb => agent_health_issue_group.rb} | 83 +++--- .../v2/models/agent_health_issues_count_by.rb | 26 ++ .../v2/models/agent_health_issues_response.rb | 21 +- .../agent_health_issues_response_meta.rb | 4 +- .../agent_health_issues_response_page.rb | 52 ++-- .../v2/models/agent_health_remediation.rb | 12 +- 12 files changed, 307 insertions(+), 259 deletions(-) rename lib/datadog_api_client/v2/models/{agent_health_issue_attributes.rb => agent_health_issue.rb} (86%) rename lib/datadog_api_client/v2/models/{agent_health_issue_data.rb => agent_health_issue_group.rb} (62%) create mode 100644 lib/datadog_api_client/v2/models/agent_health_issues_count_by.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 7a9926c3d391..3247596a5349 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -6451,14 +6451,14 @@ components: type: string x-enum-varnames: - AGENT_HEALTH_ISSUES - AgentHealthIssueAttributes: - description: Attributes of an open Agent Health issue. + AgentHealthIssue: + description: An open Agent Health issue. example: category: configuration description: The Agent configuration file contains an invalid value. first_seen_at: "2026-11-01T10:00:00Z" + id: invalid-config:4828e7d6c704c4a3 issue_name: Invalid Config - issue_type: invalid_config resource_id: my-hostname resource_kind: host resource_type: host @@ -6477,19 +6477,29 @@ components: description: The description of the issue. Omitted when empty. example: The Agent configuration file contains an invalid value. type: string + extra: + additionalProperties: {} + description: >- + Free-form, issue-type-specific context. Keys are not part of the stable schema. Omitted when empty. + example: + agent_hostname: i-0ea3e96bf45c427e6 + client_library: java + type: object first_seen_at: description: The time the issue was first seen, in RFC 3339 format. Omitted when empty. example: "2026-11-01T10:00:00Z" format: date-time type: string + 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 + remediation: + $ref: "#/components/schemas/AgentHealthRemediation" resource_id: description: >- 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`. @@ -6524,22 +6534,21 @@ components: format: date-time type: string required: - - issue_type + - id - issue_name - severity - state - resource_kind - resource_id type: object - AgentHealthIssueData: - description: An open Agent Health issue. + AgentHealthIssueArray: + description: The open issues in a group. example: - attributes: - category: configuration + - category: configuration description: The Agent configuration file contains an invalid value. first_seen_at: "2026-11-01T10:00:00Z" + id: invalid-config:4828e7d6c704c4a3 issue_name: Invalid Config - issue_type: invalid_config resource_id: my-hostname resource_kind: host resource_type: host @@ -6549,44 +6558,8 @@ components: - env:prod title: Invalid Agent configuration updated_at: "2026-11-09T08:00:00Z" - id: invalid-config:4828e7d6c704c4a3 - type: agent_health_issues - properties: - attributes: - $ref: "#/components/schemas/AgentHealthIssueAttributes" - id: - description: The unique identifier of the issue. - example: invalid-config:4828e7d6c704c4a3 - type: string - type: - $ref: "#/components/schemas/AgentHealthIssueResourceType" - required: - - id - - type - - attributes - type: object - AgentHealthIssueDataArray: - description: The open Agent Health issues on this page. - example: - - attributes: - category: configuration - description: The Agent configuration file contains an invalid value. - first_seen_at: "2026-11-01T10:00:00Z" - issue_name: Invalid Config - issue_type: invalid_config - resource_id: my-hostname - resource_kind: host - resource_type: host - severity: high - state: open - tags: - - env:prod - title: Invalid Agent configuration - updated_at: "2026-11-09T08:00:00Z" - id: invalid-config:4828e7d6c704c4a3 - type: agent_health_issues items: - $ref: "#/components/schemas/AgentHealthIssueData" + $ref: "#/components/schemas/AgentHealthIssue" type: array AgentHealthIssueDetailAttributes: description: Attributes of an open Agent Health issue, including available remediation. @@ -6597,6 +6570,7 @@ components: issue_name: Invalid Config issue_type: invalid_config remediation: + ai_prompt: Help me fix the invalid configuration value in datadog.yaml. script: content: "..." filename: fix.sh @@ -6691,6 +6665,7 @@ components: issue_name: Invalid Config issue_type: invalid_config remediation: + ai_prompt: Help me fix the invalid configuration value in datadog.yaml. script: content: "..." filename: fix.sh @@ -6726,6 +6701,43 @@ components: - type - attributes type: object + AgentHealthIssueGroup: + description: A group of open Agent Health issues that share an issue type. + example: + issue_type: invalid_config + issues: + - id: invalid-config:4828e7d6c704c4a3 + issue_name: Invalid Config + resource_id: my-hostname + resource_kind: host + severity: high + state: open + properties: + issue_type: + description: >- + The machine-readable type shared by the issues in this group. Issues with no type are grouped under `unknown`. + example: invalid_config + type: string + issues: + $ref: "#/components/schemas/AgentHealthIssueArray" + required: + - issue_type + - issues + type: object + AgentHealthIssueGroupArray: + description: Open Agent Health issues grouped by issue type. + example: + - issue_type: invalid_config + issues: + - id: invalid-config:4828e7d6c704c4a3 + issue_name: Invalid Config + resource_id: my-hostname + resource_kind: host + severity: high + state: open + items: + $ref: "#/components/schemas/AgentHealthIssueGroup" + type: array AgentHealthIssueResourceType: description: The Agent Health issue resource type. enum: @@ -6750,23 +6762,33 @@ components: description: A tag associated with the issue. type: string type: array + AgentHealthIssuesCountBy: + description: The dimension to aggregate issue counts by. Only `issue_type` is supported. + enum: + - issue_type + example: issue_type + type: string + x-enum-varnames: + - ISSUE_TYPE AgentHealthIssuesResponse: - description: A paginated response containing open Agent Health issues. + description: A response containing open Agent Health issues grouped by issue type. properties: data: - $ref: "#/components/schemas/AgentHealthIssueDataArray" + $ref: "#/components/schemas/AgentHealthIssueGroupArray" meta: $ref: "#/components/schemas/AgentHealthIssuesResponseMeta" required: - data - - meta type: object AgentHealthIssuesResponseMeta: - description: Pagination metadata for the matching Agent Health issues. + description: >- + Aggregate counts for the matching Agent Health issues. Present only when `count_by=issue_type` is requested. example: page: - total_count: 3 - total_filtered_count: 1 + counts_by_issue_type: + invalid_config: 8382 + read-only_filesystem_error: 82 + total_count: 25526 properties: page: $ref: "#/components/schemas/AgentHealthIssuesResponsePage" @@ -6774,28 +6796,35 @@ components: - page type: object AgentHealthIssuesResponsePage: - description: Pagination counts for the Agent Health issues. + description: Counts for the matching Agent Health issues. example: - total_count: 3 - total_filtered_count: 1 + counts_by_issue_type: + invalid_config: 8382 + read-only_filesystem_error: 82 + total_count: 25526 properties: + counts_by_issue_type: + additionalProperties: + format: int64 + type: integer + description: The number of returned open issues in each issue-type group. + example: + invalid_config: 8382 + read-only_filesystem_error: 82 + type: object total_count: - description: The total number of open issues in the organization, ignoring filters. - example: 3 - format: int64 - type: integer - total_filtered_count: - description: The total number of open issues matching the filters, across all pages. - example: 1 + description: The total number of open issues matching the filters. + example: 25526 format: int64 type: integer required: - total_count - - total_filtered_count + - counts_by_issue_type type: object AgentHealthRemediation: description: Remediation for the issue. Omitted when no remediation is available. example: + ai_prompt: Help me fix the invalid configuration value in datadog.yaml. script: content: "..." filename: fix.sh @@ -6807,6 +6836,10 @@ components: text: Open datadog.yaml summary: Fix the invalid configuration value. properties: + ai_prompt: + description: A suggested prompt for an AI assistant to help remediate the issue. + example: Help me fix the invalid configuration value in datadog.yaml. + type: string script: $ref: "#/components/schemas/AgentHealthRemediationScript" steps: @@ -159368,43 +159401,31 @@ paths: /api/v2/agenthealth/issues: get: description: |- - 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. operationId: ListAgentHealthIssues parameters: - - description: The number of issues to return per page, from 1 to 100. Defaults to 25. - example: 25 - in: query - name: page[size] - required: false - schema: - default: 25 - format: int64 - maximum: 100 - minimum: 1 - type: integer - - description: The zero-based page number, from 0 to 1000000. Defaults to 0. - example: 0 + - description: >- + 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. + example: issue_type in: query - name: page[number] + name: count_by required: false schema: - default: 0 - format: int64 - maximum: 1000000 - minimum: 0 - type: integer + $ref: "#/components/schemas/AgentHealthIssuesCountBy" - description: |- 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. @@ -159468,27 +159489,35 @@ paths: default: value: data: - - attributes: - category: configuration - description: The Agent configuration file contains an invalid value. - first_seen_at: "2026-11-01T10:00:00Z" - issue_name: Invalid Config - issue_type: invalid_config - resource_id: my-hostname - resource_kind: host - resource_type: host - severity: high - state: open - tags: - - env:prod - title: Invalid Agent configuration - updated_at: "2026-11-09T08:00:00Z" - id: invalid-config:4828e7d6c704c4a3 - type: agent_health_issues + - issue_type: invalid_config + issues: + - category: configuration + description: The Agent configuration file contains an invalid value. + extra: + agent_hostname: i-0ea3e96bf45c427e6 + first_seen_at: "2026-11-01T10:00:00Z" + id: invalid-config:4828e7d6c704c4a3 + issue_name: Invalid Config + remediation: + ai_prompt: Help me fix the invalid configuration value in datadog.yaml. + steps: + - order: 1 + text: Open datadog.yaml + summary: Fix the invalid configuration value. + resource_id: my-hostname + resource_kind: host + resource_type: host + severity: high + state: open + tags: + - env:prod + title: Invalid Agent configuration + updated_at: "2026-11-09T08:00:00Z" meta: page: - total_count: 3 - total_filtered_count: 1 + counts_by_issue_type: + invalid_config: 8382 + total_count: 25526 schema: $ref: "#/components/schemas/AgentHealthIssuesResponse" description: OK @@ -159563,6 +159592,7 @@ paths: issue_name: Invalid Config issue_type: invalid_config remediation: + ai_prompt: Help me fix the invalid configuration value in datadog.yaml. script: content: "..." filename: fix.sh diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 07274057c608..e631e504818c 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -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", diff --git a/features/v2/agent_health.feature b/features/v2/agent_health.feature index 20143df7800d..64eae1a5d3d7 100644 --- a/features/v2/agent_health.feature +++ b/features/v2/agent_health.feature @@ -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 diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 36ab8f2db077..04d81e63fa37 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -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", diff --git a/lib/datadog_api_client/v2/api/agent_health_api.rb b/lib/datadog_api_client/v2/api/agent_health_api.rb index aacb7aa2f14b..480aa9bcf530 100644 --- a/lib/datadog_api_client/v2/api/agent_health_api.rb +++ b/lib/datadog_api_client/v2/api/agent_health_api.rb @@ -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. @@ -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.' @@ -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? diff --git a/lib/datadog_api_client/v2/models/agent_health_issue_attributes.rb b/lib/datadog_api_client/v2/models/agent_health_issue.rb similarity index 86% rename from lib/datadog_api_client/v2/models/agent_health_issue_attributes.rb rename to lib/datadog_api_client/v2/models/agent_health_issue.rb index 85073df385be..062252313fcf 100644 --- a/lib/datadog_api_client/v2/models/agent_health_issue_attributes.rb +++ b/lib/datadog_api_client/v2/models/agent_health_issue.rb @@ -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. @@ -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 @@ -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', @@ -88,9 +96,11 @@ def self.openapi_types { :'category' => :'String', :'description' => :'String', + :'extra' => :'Hash', :'first_seen_at' => :'Time', + :'id' => :'String', :'issue_name' => :'String', - :'issue_type' => :'String', + :'remediation' => :'AgentHealthRemediation', :'resource_id' => :'String', :'resource_kind' => :'String', :'resource_type' => :'String', @@ -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 = {} @@ -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') @@ -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? @@ -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 @@ -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 && @@ -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 diff --git a/lib/datadog_api_client/v2/models/agent_health_issue_data.rb b/lib/datadog_api_client/v2/models/agent_health_issue_group.rb similarity index 62% rename from lib/datadog_api_client/v2/models/agent_health_issue_data.rb rename to lib/datadog_api_client/v2/models/agent_health_issue_group.rb index 0ebe7624d7e2..4e2ee9223040 100644 --- a/lib/datadog_api_client/v2/models/agent_health_issue_data.rb +++ b/lib/datadog_api_client/v2/models/agent_health_issue_group.rb @@ -17,18 +17,15 @@ require 'time' module DatadogAPIClient::V2 - # An open Agent Health issue. - class AgentHealthIssueData + # A group of open Agent Health issues that share an issue type. + class AgentHealthIssueGroup include BaseGenericModel - # Attributes of an open Agent Health issue. - attr_reader :attributes + # The machine-readable type shared by the issues in this group. Issues with no type are grouped under `unknown`. + attr_reader :issue_type - # The unique identifier of the issue. - attr_reader :id - - # The Agent Health issue resource type. - attr_reader :type + # The open issues in a group. + attr_reader :issues attr_accessor :additional_properties @@ -36,9 +33,8 @@ class AgentHealthIssueData # @!visibility private def self.attribute_map { - :'attributes' => :'attributes', - :'id' => :'id', - :'type' => :'type' + :'issue_type' => :'issue_type', + :'issues' => :'issues' } end @@ -46,9 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'AgentHealthIssueAttributes', - :'id' => :'String', - :'type' => :'AgentHealthIssueResourceType' + :'issue_type' => :'String', + :'issues' => :'Array' } end @@ -57,7 +52,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::AgentHealthIssueData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AgentHealthIssueGroup` initialize method" end self.additional_properties = {} @@ -70,16 +65,14 @@ def initialize(attributes = {}) end } - if attributes.key?(:'attributes') - self.attributes = attributes[:'attributes'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] + if attributes.key?(:'issue_type') + self.issue_type = attributes[:'issue_type'] end - if attributes.key?(:'type') - self.type = attributes[:'type'] + if attributes.key?(:'issues') + if (value = attributes[:'issues']).is_a?(Array) + self.issues = value + end end end @@ -87,40 +80,29 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @attributes.nil? - return false if @id.nil? - return false if @type.nil? + return false if @issue_type.nil? + return false if @issues.nil? true end # Custom attribute writer method with validation - # @param attributes [Object] Object to be assigned - # @!visibility private - def attributes=(attributes) - if attributes.nil? - fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' - end - @attributes = attributes - end - - # Custom attribute writer method with validation - # @param id [Object] Object to be assigned + # @param issue_type [Object] Object to be assigned # @!visibility private - def id=(id) - if id.nil? - fail ArgumentError, 'invalid value for "id", id cannot be nil.' + def issue_type=(issue_type) + if issue_type.nil? + fail ArgumentError, 'invalid value for "issue_type", issue_type cannot be nil.' end - @id = id + @issue_type = issue_type end # Custom attribute writer method with validation - # @param type [Object] Object to be assigned + # @param issues [Object] Object to be assigned # @!visibility private - def type=(type) - if type.nil? - fail ArgumentError, 'invalid value for "type", type cannot be nil.' + def issues=(issues) + if issues.nil? + fail ArgumentError, 'invalid value for "issues", issues cannot be nil.' end - @type = type + @issues = issues end # Returns the object in the form of hash, with additionalProperties support. @@ -149,9 +131,8 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - attributes == o.attributes && - id == o.id && - type == o.type && + issue_type == o.issue_type && + issues == o.issues && additional_properties == o.additional_properties end @@ -159,7 +140,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attributes, id, type, additional_properties].hash + [issue_type, issues, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/agent_health_issues_count_by.rb b/lib/datadog_api_client/v2/models/agent_health_issues_count_by.rb new file mode 100644 index 000000000000..87eba8268d35 --- /dev/null +++ b/lib/datadog_api_client/v2/models/agent_health_issues_count_by.rb @@ -0,0 +1,26 @@ +=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 + # The dimension to aggregate issue counts by. Only `issue_type` is supported. + class AgentHealthIssuesCountBy + include BaseEnumModel + + ISSUE_TYPE = "issue_type".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/agent_health_issues_response.rb b/lib/datadog_api_client/v2/models/agent_health_issues_response.rb index 6032732df740..cb338067f303 100644 --- a/lib/datadog_api_client/v2/models/agent_health_issues_response.rb +++ b/lib/datadog_api_client/v2/models/agent_health_issues_response.rb @@ -17,15 +17,15 @@ require 'time' module DatadogAPIClient::V2 - # A paginated response containing open Agent Health issues. + # A response containing open Agent Health issues grouped by issue type. class AgentHealthIssuesResponse include BaseGenericModel - # The open Agent Health issues on this page. + # Open Agent Health issues grouped by issue type. attr_reader :data - # Pagination metadata for the matching Agent Health issues. - attr_reader :meta + # Aggregate counts for the matching Agent Health issues. Present only when `count_by=issue_type` is requested. + attr_accessor :meta attr_accessor :additional_properties @@ -42,7 +42,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'Array', + :'data' => :'Array', :'meta' => :'AgentHealthIssuesResponseMeta' } end @@ -81,7 +81,6 @@ def initialize(attributes = {}) # @!visibility private def valid? return false if @data.nil? - return false if @meta.nil? true end @@ -95,16 +94,6 @@ def data=(data) @data = data end - # Custom attribute writer method with validation - # @param meta [Object] Object to be assigned - # @!visibility private - def meta=(meta) - if meta.nil? - fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' - end - @meta = meta - end - # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private diff --git a/lib/datadog_api_client/v2/models/agent_health_issues_response_meta.rb b/lib/datadog_api_client/v2/models/agent_health_issues_response_meta.rb index 363c74722fdd..b7591e21e0f5 100644 --- a/lib/datadog_api_client/v2/models/agent_health_issues_response_meta.rb +++ b/lib/datadog_api_client/v2/models/agent_health_issues_response_meta.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Pagination metadata for the matching Agent Health issues. + # Aggregate counts for the matching Agent Health issues. Present only when `count_by=issue_type` is requested. class AgentHealthIssuesResponseMeta include BaseGenericModel - # Pagination counts for the Agent Health issues. + # Counts for the matching Agent Health issues. attr_reader :page attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/agent_health_issues_response_page.rb b/lib/datadog_api_client/v2/models/agent_health_issues_response_page.rb index 38fdf455c1c5..3ad2da0e0c17 100644 --- a/lib/datadog_api_client/v2/models/agent_health_issues_response_page.rb +++ b/lib/datadog_api_client/v2/models/agent_health_issues_response_page.rb @@ -17,15 +17,15 @@ require 'time' module DatadogAPIClient::V2 - # Pagination counts for the Agent Health issues. + # Counts for the matching Agent Health issues. class AgentHealthIssuesResponsePage include BaseGenericModel - # The total number of open issues in the organization, ignoring filters. - attr_reader :total_count + # The number of returned open issues in each issue-type group. + attr_reader :counts_by_issue_type - # The total number of open issues matching the filters, across all pages. - attr_reader :total_filtered_count + # The total number of open issues matching the filters. + attr_reader :total_count attr_accessor :additional_properties @@ -33,8 +33,8 @@ class AgentHealthIssuesResponsePage # @!visibility private def self.attribute_map { - :'total_count' => :'total_count', - :'total_filtered_count' => :'total_filtered_count' + :'counts_by_issue_type' => :'counts_by_issue_type', + :'total_count' => :'total_count' } end @@ -42,8 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'total_count' => :'Integer', - :'total_filtered_count' => :'Integer' + :'counts_by_issue_type' => :'Hash', + :'total_count' => :'Integer' } end @@ -65,12 +65,12 @@ def initialize(attributes = {}) end } - if attributes.key?(:'total_count') - self.total_count = attributes[:'total_count'] + if attributes.key?(:'counts_by_issue_type') + self.counts_by_issue_type = attributes[:'counts_by_issue_type'] end - if attributes.key?(:'total_filtered_count') - self.total_filtered_count = attributes[:'total_filtered_count'] + if attributes.key?(:'total_count') + self.total_count = attributes[:'total_count'] end end @@ -78,29 +78,29 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? + return false if @counts_by_issue_type.nil? return false if @total_count.nil? - return false if @total_filtered_count.nil? true end # Custom attribute writer method with validation - # @param total_count [Object] Object to be assigned + # @param counts_by_issue_type [Object] Object to be assigned # @!visibility private - def total_count=(total_count) - if total_count.nil? - fail ArgumentError, 'invalid value for "total_count", total_count cannot be nil.' + def counts_by_issue_type=(counts_by_issue_type) + if counts_by_issue_type.nil? + fail ArgumentError, 'invalid value for "counts_by_issue_type", counts_by_issue_type cannot be nil.' end - @total_count = total_count + @counts_by_issue_type = counts_by_issue_type end # Custom attribute writer method with validation - # @param total_filtered_count [Object] Object to be assigned + # @param total_count [Object] Object to be assigned # @!visibility private - def total_filtered_count=(total_filtered_count) - if total_filtered_count.nil? - fail ArgumentError, 'invalid value for "total_filtered_count", total_filtered_count cannot be nil.' + def total_count=(total_count) + if total_count.nil? + fail ArgumentError, 'invalid value for "total_count", total_count cannot be nil.' end - @total_filtered_count = total_filtered_count + @total_count = total_count end # Returns the object in the form of hash, with additionalProperties support. @@ -129,8 +129,8 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + counts_by_issue_type == o.counts_by_issue_type && total_count == o.total_count && - total_filtered_count == o.total_filtered_count && additional_properties == o.additional_properties end @@ -138,7 +138,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [total_count, total_filtered_count, additional_properties].hash + [counts_by_issue_type, total_count, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/agent_health_remediation.rb b/lib/datadog_api_client/v2/models/agent_health_remediation.rb index 658eb00ebcd8..305381c0c01d 100644 --- a/lib/datadog_api_client/v2/models/agent_health_remediation.rb +++ b/lib/datadog_api_client/v2/models/agent_health_remediation.rb @@ -21,6 +21,9 @@ module DatadogAPIClient::V2 class AgentHealthRemediation include BaseGenericModel + # A suggested prompt for an AI assistant to help remediate the issue. + attr_accessor :ai_prompt + # A script that can be used to remediate the issue. attr_accessor :script @@ -36,6 +39,7 @@ class AgentHealthRemediation # @!visibility private def self.attribute_map { + :'ai_prompt' => :'ai_prompt', :'script' => :'script', :'steps' => :'steps', :'summary' => :'summary' @@ -46,6 +50,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'ai_prompt' => :'String', :'script' => :'AgentHealthRemediationScript', :'steps' => :'Array', :'summary' => :'String' @@ -70,6 +75,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'ai_prompt') + self.ai_prompt = attributes[:'ai_prompt'] + end + if attributes.key?(:'script') self.script = attributes[:'script'] end @@ -111,6 +120,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + ai_prompt == o.ai_prompt && script == o.script && steps == o.steps && summary == o.summary && @@ -121,7 +131,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [script, steps, summary, additional_properties].hash + [ai_prompt, script, steps, summary, additional_properties].hash end end end