From 7b8aa031e58deb101029dedc6986208d395d3c72 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 27 Nov 2025 09:40:37 +0000 Subject: [PATCH] Regenerate client from commit c854967 of spec repo --- .generator/schemas/v2/openapi.yaml | 639 +++++++++++++++++- .../v2/fleet-automation/GetFleetAgentInfo.rb | 8 + .../v2/fleet-automation/ListFleetAgents.rb | 8 + features/scenarios_model_mapping.rb | 11 + features/v2/fleet_automation.feature | 45 ++ features/v2/undo.json | 12 + lib/datadog_api_client/configuration.rb | 2 + lib/datadog_api_client/inflector.rb | 16 + .../v2/api/fleet_automation_api.rb | 167 ++++- .../v2/models/fleet_agent_attributes.rb | 327 +++++++++ .../fleet_agent_attributes_tags_items.rb | 115 ++++ .../v2/models/fleet_agent_info.rb | 165 +++++ .../v2/models/fleet_agent_info_attributes.rb | 137 ++++ .../v2/models/fleet_agent_info_details.rb | 403 +++++++++++ .../models/fleet_agent_info_resource_type.rb | 26 + .../v2/models/fleet_agent_info_response.rb | 123 ++++ .../v2/models/fleet_agents_response.rb | 133 ++++ .../v2/models/fleet_agents_response_data.rb | 105 +++ .../fleet_agents_response_data_attributes.rb | 107 +++ .../v2/models/fleet_agents_response_meta.rb | 105 +++ .../v2/models/fleet_configuration_file.rb | 125 ++++ .../v2/models/fleet_configuration_layer.rb | 155 +++++ .../v2/models/fleet_detected_integration.rb | 115 ++++ .../v2/models/fleet_integration_details.rb | 197 ++++++ .../v2/models/fleet_integrations_by_status.rb | 165 +++++ 25 files changed, 3409 insertions(+), 2 deletions(-) create mode 100644 examples/v2/fleet-automation/GetFleetAgentInfo.rb create mode 100644 examples/v2/fleet-automation/ListFleetAgents.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_agent_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_agent_attributes_tags_items.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_agent_info.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_agent_info_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_agent_info_details.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_agent_info_resource_type.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_agent_info_response.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_agents_response.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_agents_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_agents_response_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_agents_response_meta.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_configuration_file.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_configuration_layer.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_detected_integration.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_integration_details.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_integrations_by_status.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9bceb715496..c87f59f0b11 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -21225,6 +21225,278 @@ components: - PIPELINES_FAILED_DESCENDING - PIPELINES_DURATION_LOST_ASCENDING - PIPELINES_DURATION_LOST_DESCENDING + FleetAgentAttributes: + description: Attributes of a Datadog Agent in the list view. + properties: + agent_version: + description: The Datadog Agent version. + example: 7.50.0 + type: string + api_key_name: + description: The API key name (if available and not redacted). + example: Production API Key + type: string + api_key_uuid: + description: The API key UUID. + example: a1b2c3d4-e5f6-4321-a123-123456789abc + type: string + cloud_provider: + description: The cloud provider where the agent is running. + example: aws + type: string + cluster_name: + description: Kubernetes cluster name (if applicable). + type: string + datadog_agent_key: + description: The unique agent key identifier. + example: my-agent-hostname + type: string + enabled_products: + description: Datadog products enabled on the agent. + items: + type: string + type: array + envs: + description: Environments the agent is reporting from. + items: + type: string + type: array + first_seen_at: + description: Timestamp when the agent was first seen. + format: int64 + type: integer + hostname: + description: The hostname of the agent. + example: my-hostname + type: string + ip_addresses: + description: IP addresses of the agent. + items: + type: string + type: array + is_single_step_instrumentation_enabled: + description: Whether single-step instrumentation is enabled. + type: boolean + last_restart_at: + description: Timestamp of the last agent restart. + format: int64 + type: integer + os: + description: The operating system. + example: linux + type: string + otel_collector_version: + description: OpenTelemetry collector version (if applicable). + type: string + otel_collector_versions: + description: List of OpenTelemetry collector versions (if applicable). + items: + type: string + type: array + pod_name: + description: Kubernetes pod name (if applicable). + type: string + remote_agent_management: + description: Remote agent management status. + example: enabled + type: string + remote_config_status: + description: Remote configuration status. + example: connected + type: string + services: + description: Services running on the agent. + items: + type: string + type: array + tags: + description: Tags associated with the agent. + items: + $ref: '#/components/schemas/FleetAgentAttributesTagsItems' + type: array + team: + description: Team associated with the agent. + type: string + type: object + FleetAgentAttributesTagsItems: + properties: + key: + type: string + value: + type: string + type: object + FleetAgentInfo: + description: Represents detailed information about a specific Datadog Agent. + properties: + attributes: + $ref: '#/components/schemas/FleetAgentInfoAttributes' + id: + description: The unique agent key identifier. + example: my-agent-hostname + type: string + type: + $ref: '#/components/schemas/FleetAgentInfoResourceType' + required: + - id + - type + - attributes + type: object + FleetAgentInfoAttributes: + description: Attributes for agent information. + properties: + agent_infos: + $ref: '#/components/schemas/FleetAgentInfoDetails' + configuration_files: + $ref: '#/components/schemas/FleetConfigurationLayer' + detected_integrations: + description: List of detected integrations. + items: + $ref: '#/components/schemas/FleetDetectedIntegration' + type: array + integrations: + $ref: '#/components/schemas/FleetIntegrationsByStatus' + type: object + FleetAgentInfoDetails: + description: Detailed information about a Datadog Agent. + properties: + agent_version: + description: The Datadog Agent version. + example: 7.50.0 + type: string + api_key_name: + description: The API key name (if available and not redacted). + example: Production API Key + type: string + api_key_uuid: + description: The API key UUID. + example: a1b2c3d4-e5f6-4321-a123-123456789abc + type: string + cloud_provider: + description: The cloud provider where the agent is running. + example: aws + type: string + cluster_name: + description: Kubernetes cluster name (if applicable). + type: string + datadog_agent_key: + description: The unique agent key identifier. + example: my-agent-hostname + type: string + enabled_products: + description: Datadog products enabled on the agent. + items: + type: string + type: array + env: + description: Environments the agent is reporting from. + items: + type: string + type: array + first_seen_at: + description: Timestamp when the agent was first seen. + format: int64 + type: integer + hostname: + description: The hostname of the agent. + example: my-hostname + type: string + hostname_aliases: + description: Alternative hostname list for the agent. + items: + type: string + type: array + install_method_installer_version: + description: The version of the installer used. + example: 1.2.3 + type: string + install_method_tool: + description: The tool used to install the agent. + example: chef + type: string + ip_addresses: + description: IP addresses of the agent. + items: + type: string + type: array + is_single_step_instrumentation_enabled: + description: Whether single-step instrumentation is enabled. + type: boolean + last_restart_at: + description: Timestamp of the last agent restart. + format: int64 + type: integer + os: + description: The operating system. + example: linux + type: string + os_version: + description: The operating system version. + example: Ubuntu 20.04 + type: string + otel_collector_version: + description: OpenTelemetry collector version (if applicable). + type: string + otel_collector_versions: + description: List of OpenTelemetry collector versions (if applicable). + items: + type: string + type: array + otel_collectors: + description: OpenTelemetry collectors associated with the agent (if applicable). + items: + $ref: '#/components/schemas/FleetOtelCollector' + type: array + pod_name: + description: Kubernetes pod name (if applicable). + type: string + python_version: + description: The Python version used by the agent. + example: 3.9.5 + type: string + region: + description: Regions where the agent is running. + items: + type: string + type: array + remote_agent_management: + description: Remote agent management status. + example: enabled + type: string + remote_config_status: + description: Remote configuration status. + example: connected + type: string + services: + description: Services running on the agent. + items: + type: string + type: array + tags: + description: Tags associated with the agent. + items: + type: string + type: array + team: + description: Team associated with the agent. + type: string + type: object + FleetAgentInfoResourceType: + default: datadog_agent_key + description: The type of Agent info resource. + enum: + - datadog_agent_key + example: datadog_agent_key + type: string + x-enum-varnames: + - DATADOG_AGENT_KEY + FleetAgentInfoResponse: + description: Response containing detailed information about a specific agent. + properties: + data: + $ref: '#/components/schemas/FleetAgentInfo' + required: + - data + type: object FleetAgentVersion: description: Represents an available Datadog Agent version. properties: @@ -21267,6 +21539,77 @@ components: required: - data type: object + FleetAgentsResponse: + description: Response containing a paginated list of Datadog Agents. + properties: + data: + $ref: '#/components/schemas/FleetAgentsResponseData' + meta: + $ref: '#/components/schemas/FleetAgentsResponseMeta' + required: + - data + type: object + FleetAgentsResponseData: + description: The response data containing status and agents array. + properties: + attributes: + $ref: '#/components/schemas/FleetAgentsResponseDataAttributes' + type: object + FleetAgentsResponseDataAttributes: + properties: + agents: + description: Array of agents matching the query criteria. + items: + $ref: '#/components/schemas/FleetAgentAttributes' + type: array + type: object + FleetAgentsResponseMeta: + description: Metadata for the list of agents response. + properties: + total_filtered_count: + description: Total number of agents matching the filter criteria across + all pages. + example: 150 + format: int64 + type: integer + type: object + FleetConfigurationFile: + description: A configuration file for an integration. + properties: + file_content: + description: The raw content of the configuration file. + type: string + file_path: + description: Path to the configuration file. + example: /conf.d/postgres.d/postgres.yaml + type: string + filename: + description: Name of the configuration file. + example: postgres.yaml + type: string + type: object + FleetConfigurationLayer: + description: Configuration information organized by layers. + properties: + compiled_configuration: + description: The final compiled configuration. + type: string + env_configuration: + description: Configuration from environment variables. + type: string + file_configuration: + description: Configuration from files. + type: string + parsed_configuration: + description: Parsed configuration output. + type: string + remote_configuration: + description: Remote configuration settings. + type: string + runtime_configuration: + description: Runtime configuration. + type: string + type: object FleetDeployment: description: A deployment that defines automated configuration changes for a fleet of hosts. @@ -21590,6 +21933,93 @@ components: page: $ref: '#/components/schemas/FleetDeploymentsPage' type: object + FleetDetectedIntegration: + description: An integration detected on the agent but not necessarily configured. + properties: + escaped_name: + description: Escaped integration name. + example: postgresql + type: string + prefix: + description: Integration prefix identifier. + example: postgres + type: string + type: object + FleetIntegrationDetails: + description: Detailed information about a single integration. + properties: + data_type: + description: Type of data collected (metrics, logs). + example: metrics + type: string + error_messages: + description: Error messages if the integration has issues. + items: + type: string + type: array + init_config: + description: Initialization configuration (YAML format). + type: string + instance_config: + description: Instance-specific configuration (YAML format). + type: string + is_custom_check: + description: Whether this is a custom integration. + type: boolean + log_config: + description: Log collection configuration (YAML format). + type: string + name: + description: Name of the integration instance. + type: string + source_index: + description: Index in the configuration file. + format: int64 + type: integer + source_path: + description: Path to the configuration file. + type: string + type: + description: Integration type. + example: postgres + type: string + type: object + FleetIntegrationsByStatus: + description: Integrations organized by their status. + properties: + configuration_files: + description: Configuration files for integrations. + items: + $ref: '#/components/schemas/FleetConfigurationFile' + type: array + datadog_agent_key: + description: The unique agent key identifier. + type: string + error_integrations: + description: Integrations with errors. + items: + $ref: '#/components/schemas/FleetIntegrationDetails' + type: array + missing_integrations: + description: Detected but not configured integrations. + items: + $ref: '#/components/schemas/FleetDetectedIntegration' + type: array + warning_integrations: + description: Integrations with warnings. + items: + $ref: '#/components/schemas/FleetIntegrationDetails' + type: array + working_integrations: + description: Integrations that are working correctly. + items: + $ref: '#/components/schemas/FleetIntegrationDetails' + type: array + type: object + FleetOtelCollector: + additionalProperties: {} + description: OpenTelemetry collector information. + type: object FleetSchedule: description: A schedule that automatically creates deployments based on a recurrence rule. @@ -56356,7 +56786,7 @@ info: version: '1.0' openapi: 3.0.0 paths: - /api/unstable/fleet/agents: + /api/unstable/fleet/agent_versions: get: description: 'Retrieve a list of all available Datadog Agent versions. @@ -56399,6 +56829,142 @@ paths: x-unstable: 'This endpoint is in Preview and may introduce breaking changes. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/unstable/fleet/agents: + get: + description: '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.' + operationId: ListFleetAgents + parameters: + - description: Page number for pagination (must be greater than 0). + in: query + name: page_number + required: false + schema: + format: int64 + minimum: 1 + type: integer + - description: Number of results per page (must be greater than 0 and less than + or equal to 100). + in: query + name: page_size + required: false + schema: + default: 10 + format: int64 + maximum: 100 + minimum: 1 + type: integer + - description: Attribute to sort by. + in: query + name: sort_attribute + required: false + schema: + type: string + - description: Sort order (true for descending, false for ascending). + in: query + name: sort_descending + required: false + schema: + type: boolean + - description: Comma-separated list of tags to filter agents. + in: query + name: tags + required: false + schema: + type: string + - description: Filter string for narrowing down agent results. + example: hostname:my-hostname OR env:dev + in: query + name: filter + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FleetAgentsResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List all Datadog Agents + tags: + - Fleet Automation + x-permission: + operator: AND + permissions: + - hosts_read + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/unstable/fleet/agents/{agent_key}: + get: + description: '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' + operationId: GetFleetAgentInfo + parameters: + - description: The unique identifier (agent key) for the Datadog Agent. + in: path + name: agent_key + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FleetAgentInfoResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get detailed information about an agent + tags: + - Fleet Automation + x-permission: + operator: AND + permissions: + - hosts_read + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/unstable/fleet/deployments: get: description: 'Retrieve a list of all deployments for fleet automation. @@ -56492,6 +57058,77 @@ paths: type: file filter_query: env:prod type: deployment + comprehensive_configuration: + summary: Comprehensive example with multiple configuration file types + value: + data: + attributes: + config_operations: + - file_op: merge-patch + file_path: /datadog.yaml + patch: + apm_config: + apm_dd_url: https://trace.agent.datadoghq.com + enabled: true + log_level: info + logs_enabled: true + process_config: + enabled: true + - file_op: merge-patch + file_path: /security-agent.yaml + patch: + runtime_security_config: + enabled: true + fim_enabled: true + - file_op: merge-patch + file_path: /system-probe.yaml + patch: + network_config: + enabled: true + service_monitoring_config: + enabled: true + - file_op: merge-patch + file_path: /application_monitoring.yaml + patch: + enabled: true + server: + host: 0.0.0.0 + port: 8126 + - file_op: merge-patch + file_path: /conf.d/logs.d/custom-app.yaml + patch: + logs: + - path: /var/log/custom-app/*.log + service: custom-app + source: custom + type: file + - file_op: merge-patch + file_path: /conf.d/docker.d/docker-logs.yaml + patch: + logs: + - service: docker + source: docker + type: docker + - file_op: merge-patch + file_path: /conf.d/snmp.d/network-devices.yaml + patch: + init_config: + loader: core + instances: + - community_string: public + ip_address: 192.168.1.1 + - file_op: merge-patch + file_path: /conf.d/postgres.d/conf.yaml + patch: + instances: + - dbname: postgres + host: localhost + port: 5432 + username: datadog + - file_op: delete + file_path: /conf.d/deprecated-integration.yaml + filter_query: env:prod AND datacenter:us-east-1 + type: deployment delete_config_file: summary: Delete a configuration file value: diff --git a/examples/v2/fleet-automation/GetFleetAgentInfo.rb b/examples/v2/fleet-automation/GetFleetAgentInfo.rb new file mode 100644 index 00000000000..f8d19b2a0cb --- /dev/null +++ b/examples/v2/fleet-automation/GetFleetAgentInfo.rb @@ -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") diff --git a/examples/v2/fleet-automation/ListFleetAgents.rb b/examples/v2/fleet-automation/ListFleetAgents.rb new file mode 100644 index 00000000000..04c3cf7ae55 --- /dev/null +++ b/examples/v2/fleet-automation/ListFleetAgents.rb @@ -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() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 15e1897d6c5..2ac0b7fc82d 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -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", diff --git a/features/v2/fleet_automation.feature b/features/v2/fleet_automation.feature index 0024399c745..b21fe22c60f 100644 --- a/features/v2/fleet_automation.feature +++ b/features/v2/fleet_automation.feature @@ -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 diff --git a/features/v2/undo.json b/features/v2/undo.json index 3799e64e630..4ab137c75c6 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -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": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 63e87298198..97979f68768 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -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, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 427fdcf8659..cb6ce9d7666 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -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", @@ -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", diff --git a/lib/datadog_api_client/v2/api/fleet_automation_api.rb b/lib/datadog_api_client/v2/api/fleet_automation_api.rb index dfcd6881403..a4561365c56 100644 --- a/lib/datadog_api_client/v2/api/fleet_automation_api.rb +++ b/lib/datadog_api_client/v2/api/fleet_automation_api.rb @@ -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 @@ -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 @@ -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] || {} diff --git a/lib/datadog_api_client/v2/models/fleet_agent_attributes.rb b/lib/datadog_api_client/v2/models/fleet_agent_attributes.rb new file mode 100644 index 00000000000..064e9ec7c13 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agent_attributes.rb @@ -0,0 +1,327 @@ +=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 + # Attributes of a Datadog Agent in the list view. + class FleetAgentAttributes + include BaseGenericModel + + # The Datadog Agent version. + attr_accessor :agent_version + + # The API key name (if available and not redacted). + attr_accessor :api_key_name + + # The API key UUID. + attr_accessor :api_key_uuid + + # The cloud provider where the agent is running. + attr_accessor :cloud_provider + + # Kubernetes cluster name (if applicable). + attr_accessor :cluster_name + + # The unique agent key identifier. + attr_accessor :datadog_agent_key + + # Datadog products enabled on the agent. + attr_accessor :enabled_products + + # Environments the agent is reporting from. + attr_accessor :envs + + # Timestamp when the agent was first seen. + attr_accessor :first_seen_at + + # The hostname of the agent. + attr_accessor :hostname + + # IP addresses of the agent. + attr_accessor :ip_addresses + + # Whether single-step instrumentation is enabled. + attr_accessor :is_single_step_instrumentation_enabled + + # Timestamp of the last agent restart. + attr_accessor :last_restart_at + + # The operating system. + attr_accessor :os + + # OpenTelemetry collector version (if applicable). + attr_accessor :otel_collector_version + + # List of OpenTelemetry collector versions (if applicable). + attr_accessor :otel_collector_versions + + # Kubernetes pod name (if applicable). + attr_accessor :pod_name + + # Remote agent management status. + attr_accessor :remote_agent_management + + # Remote configuration status. + attr_accessor :remote_config_status + + # Services running on the agent. + attr_accessor :services + + # Tags associated with the agent. + attr_accessor :tags + + # Team associated with the agent. + attr_accessor :team + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'agent_version' => :'agent_version', + :'api_key_name' => :'api_key_name', + :'api_key_uuid' => :'api_key_uuid', + :'cloud_provider' => :'cloud_provider', + :'cluster_name' => :'cluster_name', + :'datadog_agent_key' => :'datadog_agent_key', + :'enabled_products' => :'enabled_products', + :'envs' => :'envs', + :'first_seen_at' => :'first_seen_at', + :'hostname' => :'hostname', + :'ip_addresses' => :'ip_addresses', + :'is_single_step_instrumentation_enabled' => :'is_single_step_instrumentation_enabled', + :'last_restart_at' => :'last_restart_at', + :'os' => :'os', + :'otel_collector_version' => :'otel_collector_version', + :'otel_collector_versions' => :'otel_collector_versions', + :'pod_name' => :'pod_name', + :'remote_agent_management' => :'remote_agent_management', + :'remote_config_status' => :'remote_config_status', + :'services' => :'services', + :'tags' => :'tags', + :'team' => :'team' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'agent_version' => :'String', + :'api_key_name' => :'String', + :'api_key_uuid' => :'String', + :'cloud_provider' => :'String', + :'cluster_name' => :'String', + :'datadog_agent_key' => :'String', + :'enabled_products' => :'Array', + :'envs' => :'Array', + :'first_seen_at' => :'Integer', + :'hostname' => :'String', + :'ip_addresses' => :'Array', + :'is_single_step_instrumentation_enabled' => :'Boolean', + :'last_restart_at' => :'Integer', + :'os' => :'String', + :'otel_collector_version' => :'String', + :'otel_collector_versions' => :'Array', + :'pod_name' => :'String', + :'remote_agent_management' => :'String', + :'remote_config_status' => :'String', + :'services' => :'Array', + :'tags' => :'Array', + :'team' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'agent_version') + self.agent_version = attributes[:'agent_version'] + end + + if attributes.key?(:'api_key_name') + self.api_key_name = attributes[:'api_key_name'] + end + + if attributes.key?(:'api_key_uuid') + self.api_key_uuid = attributes[:'api_key_uuid'] + end + + if attributes.key?(:'cloud_provider') + self.cloud_provider = attributes[:'cloud_provider'] + end + + if attributes.key?(:'cluster_name') + self.cluster_name = attributes[:'cluster_name'] + end + + if attributes.key?(:'datadog_agent_key') + self.datadog_agent_key = attributes[:'datadog_agent_key'] + end + + if attributes.key?(:'enabled_products') + if (value = attributes[:'enabled_products']).is_a?(Array) + self.enabled_products = value + end + end + + if attributes.key?(:'envs') + if (value = attributes[:'envs']).is_a?(Array) + self.envs = value + end + end + + if attributes.key?(:'first_seen_at') + self.first_seen_at = attributes[:'first_seen_at'] + end + + if attributes.key?(:'hostname') + self.hostname = attributes[:'hostname'] + end + + if attributes.key?(:'ip_addresses') + if (value = attributes[:'ip_addresses']).is_a?(Array) + self.ip_addresses = value + end + end + + if attributes.key?(:'is_single_step_instrumentation_enabled') + self.is_single_step_instrumentation_enabled = attributes[:'is_single_step_instrumentation_enabled'] + end + + if attributes.key?(:'last_restart_at') + self.last_restart_at = attributes[:'last_restart_at'] + end + + if attributes.key?(:'os') + self.os = attributes[:'os'] + end + + if attributes.key?(:'otel_collector_version') + self.otel_collector_version = attributes[:'otel_collector_version'] + end + + if attributes.key?(:'otel_collector_versions') + if (value = attributes[:'otel_collector_versions']).is_a?(Array) + self.otel_collector_versions = value + end + end + + if attributes.key?(:'pod_name') + self.pod_name = attributes[:'pod_name'] + end + + if attributes.key?(:'remote_agent_management') + self.remote_agent_management = attributes[:'remote_agent_management'] + end + + if attributes.key?(:'remote_config_status') + self.remote_config_status = attributes[:'remote_config_status'] + end + + if attributes.key?(:'services') + if (value = attributes[:'services']).is_a?(Array) + self.services = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'team') + self.team = attributes[:'team'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + agent_version == o.agent_version && + api_key_name == o.api_key_name && + api_key_uuid == o.api_key_uuid && + cloud_provider == o.cloud_provider && + cluster_name == o.cluster_name && + datadog_agent_key == o.datadog_agent_key && + enabled_products == o.enabled_products && + envs == o.envs && + first_seen_at == o.first_seen_at && + hostname == o.hostname && + ip_addresses == o.ip_addresses && + is_single_step_instrumentation_enabled == o.is_single_step_instrumentation_enabled && + last_restart_at == o.last_restart_at && + os == o.os && + otel_collector_version == o.otel_collector_version && + otel_collector_versions == o.otel_collector_versions && + pod_name == o.pod_name && + remote_agent_management == o.remote_agent_management && + remote_config_status == o.remote_config_status && + services == o.services && + tags == o.tags && + team == o.team && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [agent_version, api_key_name, api_key_uuid, cloud_provider, cluster_name, datadog_agent_key, enabled_products, envs, first_seen_at, hostname, ip_addresses, is_single_step_instrumentation_enabled, last_restart_at, os, otel_collector_version, otel_collector_versions, pod_name, remote_agent_management, remote_config_status, services, tags, team, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_agent_attributes_tags_items.rb b/lib/datadog_api_client/v2/models/fleet_agent_attributes_tags_items.rb new file mode 100644 index 00000000000..4abe700f6de --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agent_attributes_tags_items.rb @@ -0,0 +1,115 @@ +=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 + # + class FleetAgentAttributesTagsItems + include BaseGenericModel + + # + attr_accessor :key + + # + attr_accessor :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'key' => :'key', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'key' => :'String', + :'value' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentAttributesTagsItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + key == o.key && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [key, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_agent_info.rb b/lib/datadog_api_client/v2/models/fleet_agent_info.rb new file mode 100644 index 00000000000..beaf24d2acd --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agent_info.rb @@ -0,0 +1,165 @@ +=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 + # Represents detailed information about a specific Datadog Agent. + class FleetAgentInfo + include BaseGenericModel + + # Attributes for agent information. + attr_reader :attributes + + # The unique agent key identifier. + attr_reader :id + + # The type of Agent info resource. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FleetAgentInfoAttributes', + :'id' => :'String', + :'type' => :'FleetAgentInfoResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentInfo` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @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? + 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 + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_agent_info_attributes.rb b/lib/datadog_api_client/v2/models/fleet_agent_info_attributes.rb new file mode 100644 index 00000000000..e5c8f96120d --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agent_info_attributes.rb @@ -0,0 +1,137 @@ +=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 + # Attributes for agent information. + class FleetAgentInfoAttributes + include BaseGenericModel + + # Detailed information about a Datadog Agent. + attr_accessor :agent_infos + + # Configuration information organized by layers. + attr_accessor :configuration_files + + # List of detected integrations. + attr_accessor :detected_integrations + + # Integrations organized by their status. + attr_accessor :integrations + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'agent_infos' => :'agent_infos', + :'configuration_files' => :'configuration_files', + :'detected_integrations' => :'detected_integrations', + :'integrations' => :'integrations' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'agent_infos' => :'FleetAgentInfoDetails', + :'configuration_files' => :'FleetConfigurationLayer', + :'detected_integrations' => :'Array', + :'integrations' => :'FleetIntegrationsByStatus' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentInfoAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'agent_infos') + self.agent_infos = attributes[:'agent_infos'] + end + + if attributes.key?(:'configuration_files') + self.configuration_files = attributes[:'configuration_files'] + end + + if attributes.key?(:'detected_integrations') + if (value = attributes[:'detected_integrations']).is_a?(Array) + self.detected_integrations = value + end + end + + if attributes.key?(:'integrations') + self.integrations = attributes[:'integrations'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + agent_infos == o.agent_infos && + configuration_files == o.configuration_files && + detected_integrations == o.detected_integrations && + integrations == o.integrations && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [agent_infos, configuration_files, detected_integrations, integrations, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_agent_info_details.rb b/lib/datadog_api_client/v2/models/fleet_agent_info_details.rb new file mode 100644 index 00000000000..6fbccab5c66 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agent_info_details.rb @@ -0,0 +1,403 @@ +=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 + # Detailed information about a Datadog Agent. + class FleetAgentInfoDetails + include BaseGenericModel + + # The Datadog Agent version. + attr_accessor :agent_version + + # The API key name (if available and not redacted). + attr_accessor :api_key_name + + # The API key UUID. + attr_accessor :api_key_uuid + + # The cloud provider where the agent is running. + attr_accessor :cloud_provider + + # Kubernetes cluster name (if applicable). + attr_accessor :cluster_name + + # The unique agent key identifier. + attr_accessor :datadog_agent_key + + # Datadog products enabled on the agent. + attr_accessor :enabled_products + + # Environments the agent is reporting from. + attr_accessor :env + + # Timestamp when the agent was first seen. + attr_accessor :first_seen_at + + # The hostname of the agent. + attr_accessor :hostname + + # Alternative hostname list for the agent. + attr_accessor :hostname_aliases + + # The version of the installer used. + attr_accessor :install_method_installer_version + + # The tool used to install the agent. + attr_accessor :install_method_tool + + # IP addresses of the agent. + attr_accessor :ip_addresses + + # Whether single-step instrumentation is enabled. + attr_accessor :is_single_step_instrumentation_enabled + + # Timestamp of the last agent restart. + attr_accessor :last_restart_at + + # The operating system. + attr_accessor :os + + # The operating system version. + attr_accessor :os_version + + # OpenTelemetry collector version (if applicable). + attr_accessor :otel_collector_version + + # List of OpenTelemetry collector versions (if applicable). + attr_accessor :otel_collector_versions + + # OpenTelemetry collectors associated with the agent (if applicable). + attr_accessor :otel_collectors + + # Kubernetes pod name (if applicable). + attr_accessor :pod_name + + # The Python version used by the agent. + attr_accessor :python_version + + # Regions where the agent is running. + attr_accessor :region + + # Remote agent management status. + attr_accessor :remote_agent_management + + # Remote configuration status. + attr_accessor :remote_config_status + + # Services running on the agent. + attr_accessor :services + + # Tags associated with the agent. + attr_accessor :tags + + # Team associated with the agent. + attr_accessor :team + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'agent_version' => :'agent_version', + :'api_key_name' => :'api_key_name', + :'api_key_uuid' => :'api_key_uuid', + :'cloud_provider' => :'cloud_provider', + :'cluster_name' => :'cluster_name', + :'datadog_agent_key' => :'datadog_agent_key', + :'enabled_products' => :'enabled_products', + :'env' => :'env', + :'first_seen_at' => :'first_seen_at', + :'hostname' => :'hostname', + :'hostname_aliases' => :'hostname_aliases', + :'install_method_installer_version' => :'install_method_installer_version', + :'install_method_tool' => :'install_method_tool', + :'ip_addresses' => :'ip_addresses', + :'is_single_step_instrumentation_enabled' => :'is_single_step_instrumentation_enabled', + :'last_restart_at' => :'last_restart_at', + :'os' => :'os', + :'os_version' => :'os_version', + :'otel_collector_version' => :'otel_collector_version', + :'otel_collector_versions' => :'otel_collector_versions', + :'otel_collectors' => :'otel_collectors', + :'pod_name' => :'pod_name', + :'python_version' => :'python_version', + :'region' => :'region', + :'remote_agent_management' => :'remote_agent_management', + :'remote_config_status' => :'remote_config_status', + :'services' => :'services', + :'tags' => :'tags', + :'team' => :'team' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'agent_version' => :'String', + :'api_key_name' => :'String', + :'api_key_uuid' => :'String', + :'cloud_provider' => :'String', + :'cluster_name' => :'String', + :'datadog_agent_key' => :'String', + :'enabled_products' => :'Array', + :'env' => :'Array', + :'first_seen_at' => :'Integer', + :'hostname' => :'String', + :'hostname_aliases' => :'Array', + :'install_method_installer_version' => :'String', + :'install_method_tool' => :'String', + :'ip_addresses' => :'Array', + :'is_single_step_instrumentation_enabled' => :'Boolean', + :'last_restart_at' => :'Integer', + :'os' => :'String', + :'os_version' => :'String', + :'otel_collector_version' => :'String', + :'otel_collector_versions' => :'Array', + :'otel_collectors' => :'Array>', + :'pod_name' => :'String', + :'python_version' => :'String', + :'region' => :'Array', + :'remote_agent_management' => :'String', + :'remote_config_status' => :'String', + :'services' => :'Array', + :'tags' => :'Array', + :'team' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentInfoDetails` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'agent_version') + self.agent_version = attributes[:'agent_version'] + end + + if attributes.key?(:'api_key_name') + self.api_key_name = attributes[:'api_key_name'] + end + + if attributes.key?(:'api_key_uuid') + self.api_key_uuid = attributes[:'api_key_uuid'] + end + + if attributes.key?(:'cloud_provider') + self.cloud_provider = attributes[:'cloud_provider'] + end + + if attributes.key?(:'cluster_name') + self.cluster_name = attributes[:'cluster_name'] + end + + if attributes.key?(:'datadog_agent_key') + self.datadog_agent_key = attributes[:'datadog_agent_key'] + end + + if attributes.key?(:'enabled_products') + if (value = attributes[:'enabled_products']).is_a?(Array) + self.enabled_products = value + end + end + + if attributes.key?(:'env') + if (value = attributes[:'env']).is_a?(Array) + self.env = value + end + end + + if attributes.key?(:'first_seen_at') + self.first_seen_at = attributes[:'first_seen_at'] + end + + if attributes.key?(:'hostname') + self.hostname = attributes[:'hostname'] + end + + if attributes.key?(:'hostname_aliases') + if (value = attributes[:'hostname_aliases']).is_a?(Array) + self.hostname_aliases = value + end + end + + if attributes.key?(:'install_method_installer_version') + self.install_method_installer_version = attributes[:'install_method_installer_version'] + end + + if attributes.key?(:'install_method_tool') + self.install_method_tool = attributes[:'install_method_tool'] + end + + if attributes.key?(:'ip_addresses') + if (value = attributes[:'ip_addresses']).is_a?(Array) + self.ip_addresses = value + end + end + + if attributes.key?(:'is_single_step_instrumentation_enabled') + self.is_single_step_instrumentation_enabled = attributes[:'is_single_step_instrumentation_enabled'] + end + + if attributes.key?(:'last_restart_at') + self.last_restart_at = attributes[:'last_restart_at'] + end + + if attributes.key?(:'os') + self.os = attributes[:'os'] + end + + if attributes.key?(:'os_version') + self.os_version = attributes[:'os_version'] + end + + if attributes.key?(:'otel_collector_version') + self.otel_collector_version = attributes[:'otel_collector_version'] + end + + if attributes.key?(:'otel_collector_versions') + if (value = attributes[:'otel_collector_versions']).is_a?(Array) + self.otel_collector_versions = value + end + end + + if attributes.key?(:'otel_collectors') + if (value = attributes[:'otel_collectors']).is_a?(Array) + self.otel_collectors = value + end + end + + if attributes.key?(:'pod_name') + self.pod_name = attributes[:'pod_name'] + end + + if attributes.key?(:'python_version') + self.python_version = attributes[:'python_version'] + end + + if attributes.key?(:'region') + if (value = attributes[:'region']).is_a?(Array) + self.region = value + end + end + + if attributes.key?(:'remote_agent_management') + self.remote_agent_management = attributes[:'remote_agent_management'] + end + + if attributes.key?(:'remote_config_status') + self.remote_config_status = attributes[:'remote_config_status'] + end + + if attributes.key?(:'services') + if (value = attributes[:'services']).is_a?(Array) + self.services = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'team') + self.team = attributes[:'team'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + agent_version == o.agent_version && + api_key_name == o.api_key_name && + api_key_uuid == o.api_key_uuid && + cloud_provider == o.cloud_provider && + cluster_name == o.cluster_name && + datadog_agent_key == o.datadog_agent_key && + enabled_products == o.enabled_products && + env == o.env && + first_seen_at == o.first_seen_at && + hostname == o.hostname && + hostname_aliases == o.hostname_aliases && + install_method_installer_version == o.install_method_installer_version && + install_method_tool == o.install_method_tool && + ip_addresses == o.ip_addresses && + is_single_step_instrumentation_enabled == o.is_single_step_instrumentation_enabled && + last_restart_at == o.last_restart_at && + os == o.os && + os_version == o.os_version && + otel_collector_version == o.otel_collector_version && + otel_collector_versions == o.otel_collector_versions && + otel_collectors == o.otel_collectors && + pod_name == o.pod_name && + python_version == o.python_version && + region == o.region && + remote_agent_management == o.remote_agent_management && + remote_config_status == o.remote_config_status && + services == o.services && + tags == o.tags && + team == o.team && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [agent_version, api_key_name, api_key_uuid, cloud_provider, cluster_name, datadog_agent_key, enabled_products, env, first_seen_at, hostname, hostname_aliases, install_method_installer_version, install_method_tool, ip_addresses, is_single_step_instrumentation_enabled, last_restart_at, os, os_version, otel_collector_version, otel_collector_versions, otel_collectors, pod_name, python_version, region, remote_agent_management, remote_config_status, services, tags, team, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_agent_info_resource_type.rb b/lib/datadog_api_client/v2/models/fleet_agent_info_resource_type.rb new file mode 100644 index 00000000000..8c5c8add01a --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agent_info_resource_type.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 type of Agent info resource. + class FleetAgentInfoResourceType + include BaseEnumModel + + DATADOG_AGENT_KEY = "datadog_agent_key".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_agent_info_response.rb b/lib/datadog_api_client/v2/models/fleet_agent_info_response.rb new file mode 100644 index 00000000000..b4b28f278a8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agent_info_response.rb @@ -0,0 +1,123 @@ +=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 + # Response containing detailed information about a specific agent. + class FleetAgentInfoResponse + include BaseGenericModel + + # Represents detailed information about a specific Datadog Agent. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'FleetAgentInfo' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentInfoResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_agents_response.rb b/lib/datadog_api_client/v2/models/fleet_agents_response.rb new file mode 100644 index 00000000000..c50eeaff805 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agents_response.rb @@ -0,0 +1,133 @@ +=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 + # Response containing a paginated list of Datadog Agents. + class FleetAgentsResponse + include BaseGenericModel + + # The response data containing status and agents array. + attr_reader :data + + # Metadata for the list of agents response. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'FleetAgentsResponseData', + :'meta' => :'FleetAgentsResponseMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_agents_response_data.rb b/lib/datadog_api_client/v2/models/fleet_agents_response_data.rb new file mode 100644 index 00000000000..c570a540036 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agents_response_data.rb @@ -0,0 +1,105 @@ +=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 response data containing status and agents array. + class FleetAgentsResponseData + include BaseGenericModel + + # + attr_accessor :attributes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FleetAgentsResponseDataAttributes' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentsResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_agents_response_data_attributes.rb b/lib/datadog_api_client/v2/models/fleet_agents_response_data_attributes.rb new file mode 100644 index 00000000000..2c314456874 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agents_response_data_attributes.rb @@ -0,0 +1,107 @@ +=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 + # + class FleetAgentsResponseDataAttributes + include BaseGenericModel + + # Array of agents matching the query criteria. + attr_accessor :agents + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'agents' => :'agents' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'agents' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentsResponseDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'agents') + if (value = attributes[:'agents']).is_a?(Array) + self.agents = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + agents == o.agents && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [agents, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_agents_response_meta.rb b/lib/datadog_api_client/v2/models/fleet_agents_response_meta.rb new file mode 100644 index 00000000000..6c851508d89 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agents_response_meta.rb @@ -0,0 +1,105 @@ +=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 + # Metadata for the list of agents response. + class FleetAgentsResponseMeta + include BaseGenericModel + + # Total number of agents matching the filter criteria across all pages. + attr_accessor :total_filtered_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total_filtered_count' => :'total_filtered_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_filtered_count' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentsResponseMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'total_filtered_count') + self.total_filtered_count = attributes[:'total_filtered_count'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_filtered_count == o.total_filtered_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total_filtered_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_configuration_file.rb b/lib/datadog_api_client/v2/models/fleet_configuration_file.rb new file mode 100644 index 00000000000..fbc8a99116c --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_configuration_file.rb @@ -0,0 +1,125 @@ +=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 + # A configuration file for an integration. + class FleetConfigurationFile + include BaseGenericModel + + # The raw content of the configuration file. + attr_accessor :file_content + + # Path to the configuration file. + attr_accessor :file_path + + # Name of the configuration file. + attr_accessor :filename + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'file_content' => :'file_content', + :'file_path' => :'file_path', + :'filename' => :'filename' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'file_content' => :'String', + :'file_path' => :'String', + :'filename' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetConfigurationFile` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'file_content') + self.file_content = attributes[:'file_content'] + end + + if attributes.key?(:'file_path') + self.file_path = attributes[:'file_path'] + end + + if attributes.key?(:'filename') + self.filename = attributes[:'filename'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + file_content == o.file_content && + file_path == o.file_path && + filename == o.filename && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [file_content, file_path, filename, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_configuration_layer.rb b/lib/datadog_api_client/v2/models/fleet_configuration_layer.rb new file mode 100644 index 00000000000..e69a90d4338 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_configuration_layer.rb @@ -0,0 +1,155 @@ +=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 + # Configuration information organized by layers. + class FleetConfigurationLayer + include BaseGenericModel + + # The final compiled configuration. + attr_accessor :compiled_configuration + + # Configuration from environment variables. + attr_accessor :env_configuration + + # Configuration from files. + attr_accessor :file_configuration + + # Parsed configuration output. + attr_accessor :parsed_configuration + + # Remote configuration settings. + attr_accessor :remote_configuration + + # Runtime configuration. + attr_accessor :runtime_configuration + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'compiled_configuration' => :'compiled_configuration', + :'env_configuration' => :'env_configuration', + :'file_configuration' => :'file_configuration', + :'parsed_configuration' => :'parsed_configuration', + :'remote_configuration' => :'remote_configuration', + :'runtime_configuration' => :'runtime_configuration' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'compiled_configuration' => :'String', + :'env_configuration' => :'String', + :'file_configuration' => :'String', + :'parsed_configuration' => :'String', + :'remote_configuration' => :'String', + :'runtime_configuration' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetConfigurationLayer` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'compiled_configuration') + self.compiled_configuration = attributes[:'compiled_configuration'] + end + + if attributes.key?(:'env_configuration') + self.env_configuration = attributes[:'env_configuration'] + end + + if attributes.key?(:'file_configuration') + self.file_configuration = attributes[:'file_configuration'] + end + + if attributes.key?(:'parsed_configuration') + self.parsed_configuration = attributes[:'parsed_configuration'] + end + + if attributes.key?(:'remote_configuration') + self.remote_configuration = attributes[:'remote_configuration'] + end + + if attributes.key?(:'runtime_configuration') + self.runtime_configuration = attributes[:'runtime_configuration'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + compiled_configuration == o.compiled_configuration && + env_configuration == o.env_configuration && + file_configuration == o.file_configuration && + parsed_configuration == o.parsed_configuration && + remote_configuration == o.remote_configuration && + runtime_configuration == o.runtime_configuration && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [compiled_configuration, env_configuration, file_configuration, parsed_configuration, remote_configuration, runtime_configuration, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_detected_integration.rb b/lib/datadog_api_client/v2/models/fleet_detected_integration.rb new file mode 100644 index 00000000000..874f6465dc9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_detected_integration.rb @@ -0,0 +1,115 @@ +=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 + # An integration detected on the agent but not necessarily configured. + class FleetDetectedIntegration + include BaseGenericModel + + # Escaped integration name. + attr_accessor :escaped_name + + # Integration prefix identifier. + attr_accessor :prefix + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'escaped_name' => :'escaped_name', + :'prefix' => :'prefix' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'escaped_name' => :'String', + :'prefix' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDetectedIntegration` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'escaped_name') + self.escaped_name = attributes[:'escaped_name'] + end + + if attributes.key?(:'prefix') + self.prefix = attributes[:'prefix'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + escaped_name == o.escaped_name && + prefix == o.prefix && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [escaped_name, prefix, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_integration_details.rb b/lib/datadog_api_client/v2/models/fleet_integration_details.rb new file mode 100644 index 00000000000..13884da1504 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_integration_details.rb @@ -0,0 +1,197 @@ +=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 + # Detailed information about a single integration. + class FleetIntegrationDetails + include BaseGenericModel + + # Type of data collected (metrics, logs). + attr_accessor :data_type + + # Error messages if the integration has issues. + attr_accessor :error_messages + + # Initialization configuration (YAML format). + attr_accessor :init_config + + # Instance-specific configuration (YAML format). + attr_accessor :instance_config + + # Whether this is a custom integration. + attr_accessor :is_custom_check + + # Log collection configuration (YAML format). + attr_accessor :log_config + + # Name of the integration instance. + attr_accessor :name + + # Index in the configuration file. + attr_accessor :source_index + + # Path to the configuration file. + attr_accessor :source_path + + # Integration type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_type' => :'data_type', + :'error_messages' => :'error_messages', + :'init_config' => :'init_config', + :'instance_config' => :'instance_config', + :'is_custom_check' => :'is_custom_check', + :'log_config' => :'log_config', + :'name' => :'name', + :'source_index' => :'source_index', + :'source_path' => :'source_path', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_type' => :'String', + :'error_messages' => :'Array', + :'init_config' => :'String', + :'instance_config' => :'String', + :'is_custom_check' => :'Boolean', + :'log_config' => :'String', + :'name' => :'String', + :'source_index' => :'Integer', + :'source_path' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetIntegrationDetails` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data_type') + self.data_type = attributes[:'data_type'] + end + + if attributes.key?(:'error_messages') + if (value = attributes[:'error_messages']).is_a?(Array) + self.error_messages = value + end + end + + if attributes.key?(:'init_config') + self.init_config = attributes[:'init_config'] + end + + if attributes.key?(:'instance_config') + self.instance_config = attributes[:'instance_config'] + end + + if attributes.key?(:'is_custom_check') + self.is_custom_check = attributes[:'is_custom_check'] + end + + if attributes.key?(:'log_config') + self.log_config = attributes[:'log_config'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'source_index') + self.source_index = attributes[:'source_index'] + end + + if attributes.key?(:'source_path') + self.source_path = attributes[:'source_path'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data_type == o.data_type && + error_messages == o.error_messages && + init_config == o.init_config && + instance_config == o.instance_config && + is_custom_check == o.is_custom_check && + log_config == o.log_config && + name == o.name && + source_index == o.source_index && + source_path == o.source_path && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_type, error_messages, init_config, instance_config, is_custom_check, log_config, name, source_index, source_path, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_integrations_by_status.rb b/lib/datadog_api_client/v2/models/fleet_integrations_by_status.rb new file mode 100644 index 00000000000..058fc46423e --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_integrations_by_status.rb @@ -0,0 +1,165 @@ +=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 + # Integrations organized by their status. + class FleetIntegrationsByStatus + include BaseGenericModel + + # Configuration files for integrations. + attr_accessor :configuration_files + + # The unique agent key identifier. + attr_accessor :datadog_agent_key + + # Integrations with errors. + attr_accessor :error_integrations + + # Detected but not configured integrations. + attr_accessor :missing_integrations + + # Integrations with warnings. + attr_accessor :warning_integrations + + # Integrations that are working correctly. + attr_accessor :working_integrations + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'configuration_files' => :'configuration_files', + :'datadog_agent_key' => :'datadog_agent_key', + :'error_integrations' => :'error_integrations', + :'missing_integrations' => :'missing_integrations', + :'warning_integrations' => :'warning_integrations', + :'working_integrations' => :'working_integrations' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'configuration_files' => :'Array', + :'datadog_agent_key' => :'String', + :'error_integrations' => :'Array', + :'missing_integrations' => :'Array', + :'warning_integrations' => :'Array', + :'working_integrations' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetIntegrationsByStatus` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'configuration_files') + if (value = attributes[:'configuration_files']).is_a?(Array) + self.configuration_files = value + end + end + + if attributes.key?(:'datadog_agent_key') + self.datadog_agent_key = attributes[:'datadog_agent_key'] + end + + if attributes.key?(:'error_integrations') + if (value = attributes[:'error_integrations']).is_a?(Array) + self.error_integrations = value + end + end + + if attributes.key?(:'missing_integrations') + if (value = attributes[:'missing_integrations']).is_a?(Array) + self.missing_integrations = value + end + end + + if attributes.key?(:'warning_integrations') + if (value = attributes[:'warning_integrations']).is_a?(Array) + self.warning_integrations = value + end + end + + if attributes.key?(:'working_integrations') + if (value = attributes[:'working_integrations']).is_a?(Array) + self.working_integrations = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + configuration_files == o.configuration_files && + datadog_agent_key == o.datadog_agent_key && + error_integrations == o.error_integrations && + missing_integrations == o.missing_integrations && + warning_integrations == o.warning_integrations && + working_integrations == o.working_integrations && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [configuration_files, datadog_agent_key, error_integrations, missing_integrations, warning_integrations, working_integrations, additional_properties].hash + end + end +end