From 3d385dee69fd24ee85ad8c574a993d92044860e3 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 3 Aug 2026 09:15:27 +0000 Subject: [PATCH] Regenerate client from commit 6ca8252 of spec repo --- .generator/schemas/v2/openapi.yaml | 2813 ++++++++++------- .../fleet-automation/CancelFleetDeployment.rb | 8 - .../CancelFleetDeploymentV2.rb | 8 + .../CreateFleetDeploymentConfigure.rb | 26 - .../CreateFleetDeploymentConfigureV2.rb | 24 + ...e.rb => CreateFleetDeploymentUpgradeV2.rb} | 13 +- .../fleet-automation/GetFleetAgentDetailV2.rb | 5 + .../v2/fleet-automation/GetFleetAgentInfo.rb | 8 - .../v2/fleet-automation/GetFleetDeployment.rb | 8 - ..._1482493803.rb => GetFleetDeploymentV2.rb} | 5 +- .../v2/fleet-automation/GetFleetSchedule.rb | 8 - .../v2/fleet-automation/GetFleetScheduleV2.rb | 8 + .../ListFleetAgentVersions.rb | 8 - .../ListFleetAgentVersionsV2.rb | 5 + .../v2/fleet-automation/ListFleetAgents.rb | 8 - .../v2/fleet-automation/ListFleetAgentsV2.rb | 5 + .../fleet-automation/ListFleetDeployments.rb | 8 - .../ListFleetDeploymentsV2.rb | 5 + .../v2/fleet-automation/ListFleetSchedules.rb | 8 - .../fleet-automation/ListFleetSchedulesV2.rb | 5 + features/scenarios_model_mapping.rb | 66 +- features/v2/fleet_automation.feature | 208 +- features/v2/given.json | 52 +- features/v2/undo.json | 148 +- lib/datadog_api_client/configuration.rb | 10 - lib/datadog_api_client/inflector.rb | 81 +- .../v2/api/fleet_automation_api.rb | 439 ++- .../fleet_agent_configuration_files_v2.rb | 167 + .../v2/models/fleet_agent_detail_v2.rb | 165 + ...rb => fleet_agent_detail_v2_attributes.rb} | 48 +- ...t.rb => fleet_agent_detail_v2_response.rb} | 10 +- ...ails.rb => fleet_agent_info_details_v2.rb} | 134 +- ...{fleet_agent_info.rb => fleet_agent_v2.rb} | 14 +- ...ibutes.rb => fleet_agent_v2_attributes.rb} | 166 +- ...nt_v2_attributes_instrumentation_status.rb | 27 + ...ype.rb => fleet_agent_v2_resource_type.rb} | 6 +- ...t_version.rb => fleet_agent_version_v2.rb} | 27 +- ...b => fleet_agent_version_v2_attributes.rb} | 6 +- ...> fleet_agent_version_v2_resource_type.rb} | 4 +- ...tes.rb => fleet_agent_versions_v2_page.rb} | 24 +- .../fleet_agent_versions_v2_response.rb | 135 + .../fleet_agent_versions_v2_response_meta.rb | 105 + ...sponse_meta.rb => fleet_agents_v2_page.rb} | 20 +- ...esponse.rb => fleet_agents_v2_response.rb} | 16 +- .../models/fleet_agents_v2_response_meta.rb | 105 + ...file.rb => fleet_configuration_file_v2.rb} | 30 +- ...eet_deployment_configure_v2_attributes.rb} | 50 +- ...> fleet_deployment_configure_v2_create.rb} | 10 +- ...deployment_configure_v2_create_request.rb} | 14 +- .../fleet_deployment_configure_v2_dry_run.rb | 166 + ...loyment_configure_v2_dry_run_attributes.rb | 125 + ...eployment_configure_v2_dry_run_response.rb | 123 + ..._deployment_configure_v2_dry_run_result.rb | 126 + .../fleet_deployment_configure_v2_package.rb | 154 + ...ployment_package_upgrade_v2_attributes.rb} | 19 +- ...t_deployment_package_upgrade_v2_create.rb} | 10 +- ...ment_package_upgrade_v2_create_request.rb} | 10 +- .../v2/models/fleet_deployment_v2.rb | 165 + .../models/fleet_deployment_v2_attributes.rb | 243 ++ .../v2/models/fleet_deployment_v2_cancel.rb | 165 + .../fleet_deployment_v2_cancel_attributes.rb | 115 + .../fleet_deployment_v2_cancel_response.rb | 123 + ...=> fleet_deployment_v2_create_response.rb} | 10 +- ..._data.rb => fleet_deployment_v2_detail.rb} | 16 +- .../fleet_deployment_v2_detail_agent.rb | 157 + .../fleet_deployment_v2_detail_attributes.rb | 347 ++ .../fleet_deployment_v2_detail_response.rb | 123 + .../v2/models/fleet_deployments_v2_page.rb | 115 + ...se.rb => fleet_deployments_v2_response.rb} | 10 +- .../fleet_deployments_v2_response_meta.rb | 105 + ...ils.rb => fleet_integration_details_v2.rb} | 38 +- ....rb => fleet_integrations_by_status_v2.rb} | 34 +- .../fleet_otel_collector_configuration_v2.rb | 125 + .../v2/models/fleet_schedule_v2.rb | 165 + .../v2/models/fleet_schedule_v2_attributes.rb | 247 ++ .../fleet_schedule_v2_notification_rule.rb | 123 + .../fleet_schedule_v2_recurrence_rule.rb | 150 + ...ponse.rb => fleet_schedule_v2_response.rb} | 14 +- ...nts_page.rb => fleet_schedules_v2_page.rb} | 8 +- .../v2/models/fleet_schedules_v2_response.rb | 135 + ...rb => fleet_schedules_v2_response_meta.rb} | 10 +- 81 files changed, 6827 insertions(+), 1922 deletions(-) delete mode 100644 examples/v2/fleet-automation/CancelFleetDeployment.rb create mode 100644 examples/v2/fleet-automation/CancelFleetDeploymentV2.rb delete mode 100644 examples/v2/fleet-automation/CreateFleetDeploymentConfigure.rb create mode 100644 examples/v2/fleet-automation/CreateFleetDeploymentConfigureV2.rb rename examples/v2/fleet-automation/{CreateFleetDeploymentUpgrade.rb => CreateFleetDeploymentUpgradeV2.rb} (53%) create mode 100644 examples/v2/fleet-automation/GetFleetAgentDetailV2.rb delete mode 100644 examples/v2/fleet-automation/GetFleetAgentInfo.rb delete mode 100644 examples/v2/fleet-automation/GetFleetDeployment.rb rename examples/v2/fleet-automation/{GetFleetDeployment_1482493803.rb => GetFleetDeploymentV2.rb} (57%) delete mode 100644 examples/v2/fleet-automation/GetFleetSchedule.rb create mode 100644 examples/v2/fleet-automation/GetFleetScheduleV2.rb delete mode 100644 examples/v2/fleet-automation/ListFleetAgentVersions.rb create mode 100644 examples/v2/fleet-automation/ListFleetAgentVersionsV2.rb delete mode 100644 examples/v2/fleet-automation/ListFleetAgents.rb create mode 100644 examples/v2/fleet-automation/ListFleetAgentsV2.rb delete mode 100644 examples/v2/fleet-automation/ListFleetDeployments.rb create mode 100644 examples/v2/fleet-automation/ListFleetDeploymentsV2.rb delete mode 100644 examples/v2/fleet-automation/ListFleetSchedules.rb create mode 100644 examples/v2/fleet-automation/ListFleetSchedulesV2.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_agent_configuration_files_v2.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_agent_detail_v2.rb rename lib/datadog_api_client/v2/models/{fleet_agent_info_attributes.rb => fleet_agent_detail_v2_attributes.rb} (75%) rename lib/datadog_api_client/v2/models/{fleet_deployment_configure_create_request.rb => fleet_agent_detail_v2_response.rb} (91%) rename lib/datadog_api_client/v2/models/{fleet_agent_info_details.rb => fleet_agent_info_details_v2.rb} (67%) rename lib/datadog_api_client/v2/models/{fleet_agent_info.rb => fleet_agent_v2.rb} (92%) rename lib/datadog_api_client/v2/models/{fleet_agent_attributes.rb => fleet_agent_v2_attributes.rb} (58%) create mode 100644 lib/datadog_api_client/v2/models/fleet_agent_v2_attributes_instrumentation_status.rb rename lib/datadog_api_client/v2/models/{fleet_agent_info_resource_type.rb => fleet_agent_v2_resource_type.rb} (82%) rename lib/datadog_api_client/v2/models/{fleet_agent_version.rb => fleet_agent_version_v2.rb} (83%) rename lib/datadog_api_client/v2/models/{fleet_agent_version_attributes.rb => fleet_agent_version_v2_attributes.rb} (94%) rename lib/datadog_api_client/v2/models/{fleet_agent_version_resource_type.rb => fleet_agent_version_v2_resource_type.rb} (88%) rename lib/datadog_api_client/v2/models/{fleet_agents_response_data_attributes.rb => fleet_agent_versions_v2_page.rb} (81%) create mode 100644 lib/datadog_api_client/v2/models/fleet_agent_versions_v2_response.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_agent_versions_v2_response_meta.rb rename lib/datadog_api_client/v2/models/{fleet_agents_response_meta.rb => fleet_agents_v2_page.rb} (82%) rename lib/datadog_api_client/v2/models/{fleet_agents_response.rb => fleet_agents_v2_response.rb} (89%) create mode 100644 lib/datadog_api_client/v2/models/fleet_agents_v2_response_meta.rb rename lib/datadog_api_client/v2/models/{fleet_configuration_file.rb => fleet_configuration_file_v2.rb} (78%) rename lib/datadog_api_client/v2/models/{fleet_deployment_configure_attributes.rb => fleet_deployment_configure_v2_attributes.rb} (69%) rename lib/datadog_api_client/v2/models/{fleet_deployment_configure_create.rb => fleet_deployment_configure_v2_create.rb} (92%) rename lib/datadog_api_client/v2/models/{fleet_agent_versions_response.rb => fleet_deployment_configure_v2_create_request.rb} (89%) create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_dry_run.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_dry_run_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_dry_run_response.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_dry_run_result.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_package.rb rename lib/datadog_api_client/v2/models/{fleet_deployment_package_upgrade_attributes.rb => fleet_deployment_package_upgrade_v2_attributes.rb} (87%) rename lib/datadog_api_client/v2/models/{fleet_deployment_package_upgrade_create.rb => fleet_deployment_package_upgrade_v2_create.rb} (93%) rename lib/datadog_api_client/v2/models/{fleet_deployment_package_upgrade_create_request.rb => fleet_deployment_package_upgrade_v2_create_request.rb} (92%) create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_v2.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_v2_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_v2_cancel.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_v2_cancel_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_v2_cancel_response.rb rename lib/datadog_api_client/v2/models/{fleet_agent_info_response.rb => fleet_deployment_v2_create_response.rb} (91%) rename lib/datadog_api_client/v2/models/{fleet_agents_response_data.rb => fleet_deployment_v2_detail.rb} (91%) create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_v2_detail_agent.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_v2_detail_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployment_v2_detail_response.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_deployments_v2_page.rb rename lib/datadog_api_client/v2/models/{fleet_deployments_response.rb => fleet_deployments_v2_response.rb} (92%) create mode 100644 lib/datadog_api_client/v2/models/fleet_deployments_v2_response_meta.rb rename lib/datadog_api_client/v2/models/{fleet_integration_details.rb => fleet_integration_details_v2.rb} (82%) rename lib/datadog_api_client/v2/models/{fleet_integrations_by_status.rb => fleet_integrations_by_status_v2.rb} (83%) create mode 100644 lib/datadog_api_client/v2/models/fleet_otel_collector_configuration_v2.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_schedule_v2.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_schedule_v2_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_schedule_v2_notification_rule.rb create mode 100644 lib/datadog_api_client/v2/models/fleet_schedule_v2_recurrence_rule.rb rename lib/datadog_api_client/v2/models/{fleet_schedules_response.rb => fleet_schedule_v2_response.rb} (90%) rename lib/datadog_api_client/v2/models/{fleet_deployments_page.rb => fleet_schedules_v2_page.rb} (93%) create mode 100644 lib/datadog_api_client/v2/models/fleet_schedules_v2_response.rb rename lib/datadog_api_client/v2/models/{fleet_deployments_response_meta.rb => fleet_schedules_v2_response_meta.rb} (91%) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5f48d382ebe5..d8f50ea93052 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -38703,9 +38703,85 @@ components: - PIPELINES_FAILED_DESCENDING - PIPELINES_DURATION_LOST_ASCENDING - PIPELINES_DURATION_LOST_DESCENDING - FleetAgentAttributes: - description: Attributes of a Datadog Agent in the list view. + FleetAgentAttributesTagsItems: + description: A key-value pair representing a tag associated with a Datadog Agent. + properties: + key: + description: The tag key. + type: string + value: + description: The tag value. + type: string + type: object + FleetAgentConfigurationFilesV2: + description: Configuration details for an agent, organized by configuration layer. + properties: + agent_configuration: + $ref: "#/components/schemas/FleetConfigurationLayer" + application_monitoring_configuration: + $ref: "#/components/schemas/FleetConfigurationLayer" + datadog_agent_key: + description: The unique agent key identifier. + example: "a1b2c3d4e5f67890a1b2c3d4e5f67890" + type: string + otel_collectors_configuration: + description: >- + Configuration for OpenTelemetry collectors associated with the agent. Present only when the agent has associated OpenTelemetry collectors. + items: + $ref: "#/components/schemas/FleetOtelCollectorConfigurationV2" + type: array + security_agent_configuration: + $ref: "#/components/schemas/FleetConfigurationLayer" + system_probe_configuration: + $ref: "#/components/schemas/FleetConfigurationLayer" + version: + description: The configuration version. + type: string + type: object + FleetAgentDetailV2: + description: Detailed information about a specific Datadog Agent. + properties: + attributes: + $ref: "#/components/schemas/FleetAgentDetailV2Attributes" + id: + description: The unique agent key identifier. + example: "a1b2c3d4e5f67890a1b2c3d4e5f67890" + type: string + type: + $ref: "#/components/schemas/FleetAgentV2ResourceType" + required: + - id + - type + - attributes + type: object + FleetAgentDetailV2Attributes: + description: Attributes for the v2 agent detail response. + properties: + agent_infos: + $ref: "#/components/schemas/FleetAgentInfoDetailsV2" + configuration_files: + $ref: "#/components/schemas/FleetAgentConfigurationFilesV2" + description: Configuration file details, present only when `configuration_files` is included in the `include` query parameter. + integrations: + $ref: "#/components/schemas/FleetIntegrationsByStatusV2" + description: Integration details, present only when `integrations` is included in the `include` query parameter. + required: + - agent_infos + type: object + FleetAgentDetailV2Response: + description: Response containing detailed information about a specific Datadog Agent. + properties: + data: + $ref: "#/components/schemas/FleetAgentDetailV2" + required: + - data + type: object + FleetAgentInfoDetailsV2: + description: Detailed information about a Datadog Agent. properties: + active_ha_agent: + description: The currently active agent in the high-availability group. + type: string agent_version: description: The Datadog Agent version. example: "7.50.0" @@ -38725,9 +38801,24 @@ components: cluster_name: description: Kubernetes cluster name (if applicable). type: string + config_id: + description: The configuration identifier applied to the agent. + type: string datadog_agent_key: description: The unique agent key identifier. - example: "my-agent-hostname" + example: "a1b2c3d4e5f67890a1b2c3d4e5f67890" + type: string + datadog_data_center: + description: The Datadog data center the agent reports to. + example: "us1" + type: string + ecs_fargate_cluster_name: + description: The ECS Fargate cluster name, if the agent runs in an ECS Fargate environment. + example: "my-ecs-cluster" + type: string + ecs_fargate_task_arn: + description: The ECS Fargate task ARN, if the agent runs in an ECS Fargate environment. + example: "arn:aws:ecs:us-east-1:123456789012:task/my-cluster/abc123" type: string enabled_products: description: Datadog products enabled on the agent. @@ -38735,7 +38826,7 @@ components: description: A Datadog product enabled on the agent. type: string type: array - envs: + env: description: Environments the agent is reporting from. items: description: An environment name the agent is reporting from. @@ -38745,10 +38836,33 @@ components: description: Timestamp when the agent was first seen. format: int64 type: integer + ha_agent_hosts: + description: Hosts participating in the agent's high-availability group. + items: + description: A hostname participating in the high-availability group. + type: string + type: array + ha_agent_state: + description: The high-availability state of the agent. + type: string hostname: description: The hostname of the agent. example: "my-hostname" type: string + hostname_aliases: + description: Alternative hostname list for the agent. + items: + description: An alternative hostname alias for the agent. + 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: @@ -38766,6 +38880,22 @@ components: description: The operating system. example: "linux" type: string + os_version: + description: The operating system version. + example: "Ubuntu 20.04" + type: string + otel_collector_deployment_types: + description: OpenTelemetry collector deployment types associated with the agent. + items: + description: An OpenTelemetry collector deployment type. + type: string + type: array + otel_collector_distributions: + description: OpenTelemetry collector distributions associated with the agent. + items: + description: An OpenTelemetry collector distribution. + type: string + type: array otel_collector_version: description: OpenTelemetry collector version (if applicable). type: string @@ -38775,9 +38905,33 @@ components: description: An OpenTelemetry collector version string. type: string type: array + otel_collectors: + description: OpenTelemetry collectors associated with the agent (if applicable). + items: + $ref: "#/components/schemas/FleetOtelCollector" + type: array + otel_resource_attributes: + description: OpenTelemetry resource attributes reported by the agent. + items: + description: An OpenTelemetry resource attribute. + type: string + type: array pod_name: description: Kubernetes pod name (if applicable). type: string + preferred_ha_active_agent: + description: The preferred active agent in the high-availability group. + 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: + description: A region where the agent is running. + type: string + type: array remote_agent_management: description: Remote agent management status. example: "enabled" @@ -38792,69 +38946,48 @@ components: description: A service name running on the agent. type: string type: array + support_agent_upgrade: + description: Whether the agent supports remote agent upgrade. + type: boolean tags: description: Tags associated with the agent. items: - $ref: "#/components/schemas/FleetAgentAttributesTagsItems" + description: A tag string assigned to the agent. + type: string type: array team: description: Team associated with the agent. type: string type: object - FleetAgentAttributesTagsItems: - description: A key-value pair representing a tag associated with a Datadog Agent. - properties: - key: - description: The tag key. - type: string - value: - description: The tag value. - type: string - type: object - FleetAgentInfo: - description: Represents detailed information about a specific Datadog Agent. + FleetAgentV2: + description: A Datadog Agent resource in the v2 list response. properties: attributes: - $ref: "#/components/schemas/FleetAgentInfoAttributes" + $ref: "#/components/schemas/FleetAgentV2Attributes" id: description: The unique agent key identifier. example: "my-agent-hostname" type: string type: - $ref: "#/components/schemas/FleetAgentInfoResourceType" + $ref: "#/components/schemas/FleetAgentV2ResourceType" 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. + FleetAgentV2Attributes: + description: Attributes of a Datadog Agent in the v2 list response. 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). + description: The name of the API key used by the agent, if available and not redacted. example: "Production API Key" type: string api_key_uuid: - description: The API key UUID. + description: The UUID of the API key used by the agent. example: "a1b2c3d4-e5f6-4321-a123-123456789abc" type: string cloud_provider: @@ -38862,11 +38995,20 @@ components: example: "aws" type: string cluster_name: - description: Kubernetes cluster name (if applicable). + description: The Kubernetes cluster name, if the agent runs in a cluster. + example: "production-us-east-1" type: string - datadog_agent_key: - description: The unique agent key identifier. - example: "my-agent-hostname" + datadog_data_center: + description: The Datadog data center the agent reports to. + example: "us1" + type: string + ecs_fargate_cluster_name: + description: The ECS Fargate cluster name, if the agent runs in an ECS Fargate environment. + example: "my-ecs-cluster" + type: string + ecs_fargate_task_arn: + description: The ECS Fargate task ARN, if the agent runs in an ECS Fargate environment. + example: "arn:aws:ecs:us-east-1:123456789012:task/my-cluster/abc123" type: string enabled_products: description: Datadog products enabled on the agent. @@ -38881,81 +39023,91 @@ components: type: string type: array first_seen_at: - description: Timestamp when the agent was first seen. + description: Unix timestamp when the agent was first seen. + example: 1699900000 format: int64 type: integer + fleet_policies: + description: Identifiers of fleet policies applied to the agent. + items: + description: A fleet policy identifier applied to the agent. + type: string + type: array hostname: description: The hostname of the agent. example: "my-hostname" type: string - hostname_aliases: - description: Alternative hostname list for the agent. + instrumentation_error_counts: + description: >- + Number of instrumentation errors on the agent. Absent from the response when the count is zero. + example: 3 + format: int64 + type: integer + instrumentation_status: + $ref: "#/components/schemas/FleetAgentV2AttributesInstrumentationStatus" + integrations: + description: Names of integrations configured on the agent. items: - description: An alternative hostname alias for the agent. + description: An integration name configured on the agent. 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. + description: IP addresses of the agent host. items: - description: An IP address of the agent. + description: An IP address of the agent host. type: string type: array is_single_step_instrumentation_enabled: - description: Whether single-step instrumentation is enabled. + description: Whether single-step instrumentation is enabled on the agent. + example: true type: boolean last_restart_at: - description: Timestamp of the last agent restart. + description: Unix timestamp of the last agent restart. + example: 1699999999 format: int64 type: integer os: - description: The operating system. + description: The operating system of the host. example: "linux" type: string - os_version: - description: The operating system version. - example: "Ubuntu 20.04" - type: string + otel_collector_deployment_types: + description: OpenTelemetry collector deployment types associated with the agent. + items: + description: An OpenTelemetry collector deployment type. + type: string + type: array + otel_collector_distributions: + description: OpenTelemetry collector distributions associated with the agent. + items: + description: An OpenTelemetry collector distribution. + type: string + type: array otel_collector_version: - description: OpenTelemetry collector version (if applicable). + description: The primary OpenTelemetry collector version, if applicable. + example: "0.91.0" type: string otel_collector_versions: - description: List of OpenTelemetry collector versions (if applicable). + description: All OpenTelemetry collector versions associated with the agent. items: description: An OpenTelemetry collector version string. type: string type: array - otel_collectors: - description: OpenTelemetry collectors associated with the agent (if applicable). + otel_resource_attributes: + description: OpenTelemetry resource attributes reported by the agent. items: - $ref: "#/components/schemas/FleetOtelCollector" + description: An OpenTelemetry resource attribute. + type: string 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" + description: The Kubernetes pod name, if the agent runs as a pod. + example: "datadog-agent-abc123" type: string - region: - description: Regions where the agent is running. - items: - description: A region where the agent is running. - type: string - type: array remote_agent_management: - description: Remote agent management status. + description: The remote agent management status. example: "enabled" type: string remote_config_status: - description: Remote configuration status. + description: The remote configuration connection status of the agent. example: "connected" type: string services: @@ -38965,124 +39117,135 @@ components: type: string type: array tags: - description: Tags associated with the agent. + description: >- + Tags associated with the agent. Returned as an empty array when the agent has no tags. items: - description: A tag string assigned to the agent. - type: string + $ref: "#/components/schemas/FleetAgentAttributesTagsItems" type: array team: - description: Team associated with the agent. + description: The team associated with the agent. + example: "platform" type: string type: object - FleetAgentInfoResourceType: - default: datadog_agent_key - description: The type of Agent info resource. + FleetAgentV2AttributesInstrumentationStatus: + description: The single-step instrumentation status of the Agent. enum: - - datadog_agent_key - example: datadog_agent_key + - success + - failure + example: "success" 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. + - SUCCESS + - FAILURE + FleetAgentV2ResourceType: + default: agent + description: The type of the agent resource. + enum: + - agent + example: agent + type: string + x-enum-varnames: + - AGENT + FleetAgentVersionV2: + description: An available Datadog Agent version resource. properties: attributes: - $ref: "#/components/schemas/FleetAgentVersionAttributes" + $ref: "#/components/schemas/FleetAgentVersionV2Attributes" id: - description: Unique identifier for the Agent version (same as version). - example: "7.50.0" + description: The agent version string used as the unique identifier. + example: "7.81.1" type: string type: - $ref: "#/components/schemas/FleetAgentVersionResourceType" + $ref: "#/components/schemas/FleetAgentVersionV2ResourceType" required: - id - type + - attributes type: object - FleetAgentVersionAttributes: + FleetAgentVersionV2Attributes: description: Attributes of an available Datadog Agent version. properties: version: - description: The Agent version string. - example: "7.50.0" + description: The agent version string. + example: "7.81.1" type: string type: object - FleetAgentVersionResourceType: + FleetAgentVersionV2ResourceType: default: agent_version - description: The type of Agent version resource. + description: The type of the agent version resource. enum: - agent_version example: agent_version type: string x-enum-varnames: - AGENT_VERSION - FleetAgentVersionsResponse: - description: Response containing a list of available Agent versions. + FleetAgentVersionsV2Page: + description: Pagination details for the v2 list of agent versions. + properties: + total_count: + description: Total number of available agent versions. + example: 10 + format: int64 + type: integer + type: object + FleetAgentVersionsV2Response: + description: Response containing a list of available Datadog Agent versions. properties: data: - description: Array of available Agent versions. + description: Array of available agent versions. items: - $ref: "#/components/schemas/FleetAgentVersion" + $ref: "#/components/schemas/FleetAgentVersionV2" type: array + meta: + $ref: "#/components/schemas/FleetAgentVersionsV2ResponseMeta" required: - data type: object - FleetAgentsResponse: - description: Response containing a paginated list of Datadog Agents. + FleetAgentVersionsV2ResponseMeta: + description: Metadata for the v2 list of agent versions. properties: - data: - $ref: "#/components/schemas/FleetAgentsResponseData" - meta: - $ref: "#/components/schemas/FleetAgentsResponseMeta" - required: - - data + page: + $ref: "#/components/schemas/FleetAgentVersionsV2Page" type: object - FleetAgentsResponseData: - description: The response data containing status and agents array. + FleetAgentsV2Page: + description: Pagination details for the v2 list of agents. properties: - attributes: - $ref: "#/components/schemas/FleetAgentsResponseDataAttributes" - id: - description: Status identifier. - example: "done" - type: string - type: - description: Resource type. - example: "status" - type: string - required: - - id - - type - - attributes + total_count: + description: Total number of agents in the fleet, regardless of any filter. + example: 500 + format: int64 + type: integer + total_filtered_count: + description: Total number of agents matching the current filter criteria. + example: 42 + format: int64 + type: integer type: object - FleetAgentsResponseDataAttributes: - description: Attributes of the fleet agents response containing the list of agents. + FleetAgentsV2Response: + description: Response containing a paginated list of Datadog Agents. properties: - agents: + data: description: Array of agents matching the query criteria. items: - $ref: "#/components/schemas/FleetAgentAttributes" + $ref: "#/components/schemas/FleetAgentV2" type: array + meta: + $ref: "#/components/schemas/FleetAgentsV2ResponseMeta" + required: + - data type: object - FleetAgentsResponseMeta: - description: Metadata for the list of agents response. + FleetAgentsV2ResponseMeta: + description: Metadata for the v2 list of agents, including pagination information. properties: - total_filtered_count: - description: Total number of agents matching the filter criteria across all pages. - example: 150 - format: int64 - type: integer + page: + $ref: "#/components/schemas/FleetAgentsV2Page" type: object - FleetConfigurationFile: + FleetConfigurationFileV2: description: A configuration file for an integration. properties: + agent_hash: + description: Hash of the configuration file as seen by the agent. + type: string file_content: description: The raw content of the configuration file. type: string @@ -39094,6 +39257,9 @@ components: description: Name of the configuration file. example: "postgres.yaml" type: string + fleet_hash: + description: Hash of the configuration file as applied by fleet management. + type: string type: object FleetConfigurationLayer: description: Configuration information organized by layers. @@ -39175,40 +39341,137 @@ components: format: int64 type: integer type: object - FleetDeploymentConfigureAttributes: - description: Attributes for creating a new configuration deployment. + FleetDeploymentConfigureV2Attributes: + description: Attributes for creating a new v2 configuration deployment. properties: config_operations: description: Ordered list of configuration file operations to perform on the target hosts. items: $ref: "#/components/schemas/FleetDeploymentOperation" type: array + dry_run: + description: |- + Set to `true` to validate the configuration and resolve target hosts and packages + without deploying anything. Returns a 200 with the validation result instead of + creating and starting a real deployment. + example: false + type: boolean filter_query: description: Query used to filter and select target hosts for the deployment. Uses the Datadog query syntax. example: "env:prod AND service:web" type: string + target_packages: + description: |- + List of packages and their target versions to additionally deploy alongside + the configuration change. + items: + $ref: "#/components/schemas/FleetDeploymentConfigureV2Package" + type: array required: + - filter_query - config_operations type: object - FleetDeploymentConfigureCreate: - description: Data for creating a new configuration deployment. + FleetDeploymentConfigureV2Create: + description: Data for creating a new v2 configuration deployment. + properties: + attributes: + $ref: "#/components/schemas/FleetDeploymentConfigureV2Attributes" + type: + $ref: "#/components/schemas/FleetDeploymentResourceType" + required: + - type + - attributes + type: object + FleetDeploymentConfigureV2CreateRequest: + description: Request payload for creating a new v2 configuration deployment. + properties: + data: + $ref: "#/components/schemas/FleetDeploymentConfigureV2Create" + required: + - data + type: object + FleetDeploymentConfigureV2DryRun: + description: The result of a configuration deployment dry run. properties: attributes: - $ref: "#/components/schemas/FleetDeploymentConfigureAttributes" + $ref: "#/components/schemas/FleetDeploymentConfigureV2DryRunAttributes" + id: + description: |- + Always `"dry-run"` for a dry-run response. Does not identify a real deployment + and cannot be used to fetch a deployment by ID. + example: "dry-run" + type: string type: $ref: "#/components/schemas/FleetDeploymentResourceType" required: + - id - type - attributes type: object - FleetDeploymentConfigureCreateRequest: - description: Request payload for creating a new configuration deployment. + FleetDeploymentConfigureV2DryRunAttributes: + description: Attributes of a configuration deployment dry-run response. + properties: + dry_run: + $ref: "#/components/schemas/FleetDeploymentConfigureV2DryRunResult" + query: + description: Query used to filter and select target hosts for the deployment. + example: "env:prod AND service:web" + type: string + total_hosts: + description: Total number of hosts targeted by the dry run. + example: 42 + format: int64 + type: integer + type: object + FleetDeploymentConfigureV2DryRunResponse: + description: Response containing the result of a configuration deployment dry run. properties: data: - $ref: "#/components/schemas/FleetDeploymentConfigureCreate" + $ref: "#/components/schemas/FleetDeploymentConfigureV2DryRun" required: - data type: object + FleetDeploymentConfigureV2DryRunResult: + description: Validation result of a configuration deployment dry run. + properties: + config_validated: + description: Whether the configuration passed schema validation. + example: true + type: boolean + non_upgradable_by_reason: + additionalProperties: + format: int64 + type: integer + description: |- + Breakdown of ineligible host counts by reason. Only includes reasons with a + non-zero count. Absent from the response when no targeted host is ineligible. + example: {} + type: object + non_upgradable_hosts: + description: Number of targeted hosts that are not eligible to receive this configuration. + example: 0 + format: int64 + type: integer + type: object + FleetDeploymentConfigureV2Package: + description: A package and its target version to additionally deploy alongside a configuration change. + properties: + apm_instrumentation: + description: APM auto-instrumentation mode to enable for this package, if applicable. + example: "host" + type: string + name: + description: The name of the package to deploy. + example: "datadog-agent" + type: string + version: + description: The target version of the package to deploy. + example: "7.52.0" + type: string + required: + - name + - version + type: object FleetDeploymentFileOp: description: |- Type of file operation to perform on the target configuration file. @@ -39332,8 +39595,8 @@ components: - name - version type: object - FleetDeploymentPackageUpgradeAttributes: - description: Attributes for creating a new package upgrade deployment. + FleetDeploymentPackageUpgradeV2Attributes: + description: Attributes for creating a new v2 package upgrade deployment. properties: filter_query: description: Query used to filter and select target hosts for the deployment. Uses the Datadog query syntax. @@ -39345,24 +39608,25 @@ components: $ref: "#/components/schemas/FleetDeploymentPackage" type: array required: + - filter_query - target_packages type: object - FleetDeploymentPackageUpgradeCreate: - description: Data for creating a new package upgrade deployment. + FleetDeploymentPackageUpgradeV2Create: + description: Data for creating a new v2 package upgrade deployment. properties: attributes: - $ref: "#/components/schemas/FleetDeploymentPackageUpgradeAttributes" + $ref: "#/components/schemas/FleetDeploymentPackageUpgradeV2Attributes" type: $ref: "#/components/schemas/FleetDeploymentResourceType" required: - type - attributes type: object - FleetDeploymentPackageUpgradeCreateRequest: - description: Request payload for creating a new package upgrade deployment. + FleetDeploymentPackageUpgradeV2CreateRequest: + description: Request payload for creating a new v2 package upgrade deployment. properties: data: - $ref: "#/components/schemas/FleetDeploymentPackageUpgradeCreate" + $ref: "#/components/schemas/FleetDeploymentPackageUpgradeV2Create" required: - data type: object @@ -39389,33 +39653,328 @@ components: hosts: $ref: "#/components/schemas/FleetDeploymentHostsPage" type: object - FleetDeploymentsPage: - description: Pagination details for the list of deployments. + FleetDeploymentV2: + description: A deployment in the v2 API response. + properties: + attributes: + $ref: "#/components/schemas/FleetDeploymentV2Attributes" + id: + description: Unique identifier for the deployment. + example: "k7Q-3mX-p9Z" + type: string + type: + $ref: "#/components/schemas/FleetDeploymentResourceType" + required: + - id + - type + - attributes + type: object + FleetDeploymentV2Attributes: + description: Attributes of a deployment in the v2 API response. + properties: + author: + description: Handle of the user who triggered the deployment. + example: "alice@datadoghq.com" + type: string + config_operations: + description: |- + Ordered list of configuration file operations applied by this deployment. + Absent for package deployments, which have no configuration file operations. + items: + $ref: "#/components/schemas/FleetDeploymentOperation" + type: array + duration_seconds: + description: |- + Duration of the deployment in seconds, computed as `finished_at - started_at`. + Zero if the deployment has not finished. + example: 1000 + format: int64 + type: integer + error_summary: + description: Top-level error message for the deployment. Populated only when the deployment has failed. + example: "A host failed to update" + type: string + estimated_finished_at: + description: Estimated completion time of the deployment as a Unix timestamp. Zero if not available. + example: 1699999999 + format: int64 + type: integer + finished_at: + description: Time the deployment finished as a Unix timestamp. Zero if not yet finished. + example: 0 + format: int64 + type: integer + is_scheduled: + description: Whether this deployment was triggered by a schedule (`schedule_id` is non-empty). + example: true + type: boolean + query: + description: Query used to filter and select target hosts for the deployment. + example: "env:prod AND service:web" + type: string + schedule_id: + description: Identifier of the schedule that triggered this deployment. Empty if triggered manually. + example: "sched-123" + type: string + started_at: + description: Time the deployment started as a Unix timestamp. Zero if not yet started. + example: 1699990000 + format: int64 + type: integer + status: + description: |- + Current high-level status of the deployment (for example, "pending", "running", + "completed", "failed"). + example: "pending" + type: string + target_versions: + description: Package versions targeted by this deployment. + example: ["7.52.0"] + items: + type: string + type: array + total_hosts: + description: Total number of hosts targeted by this deployment. + example: 42 + format: int64 + type: integer + update_type: + description: |- + Type of update operation performed by this deployment + (for example, "update_config_operations", "update_package"). + example: "update_config_operations" + type: string + type: object + FleetDeploymentV2Cancel: + description: A deployment cancellation response. + properties: + attributes: + $ref: "#/components/schemas/FleetDeploymentV2CancelAttributes" + id: + description: Unique identifier for the deployment. + example: "k7Q-3mX-p9Z" + type: string + type: + $ref: "#/components/schemas/FleetDeploymentResourceType" + required: + - id + - type + - attributes + type: object + FleetDeploymentV2CancelAttributes: + description: Attributes of a deployment cancellation response. + properties: + message: + description: Human-readable message describing the outcome of the cancellation request. + example: "Cancellation has been requested; the deployment is stopping." + type: string + status: + description: Status of the deployment after the cancellation request. + example: "stopping" + type: string + type: object + FleetDeploymentV2CancelResponse: + description: Response containing the result of a deployment cancellation request. + properties: + data: + $ref: "#/components/schemas/FleetDeploymentV2Cancel" + required: + - data + type: object + FleetDeploymentV2CreateResponse: + description: Response containing the newly created deployment. + properties: + data: + $ref: "#/components/schemas/FleetDeploymentV2" + required: + - data + type: object + FleetDeploymentV2Detail: + description: Detailed information about a deployment. + properties: + attributes: + $ref: "#/components/schemas/FleetDeploymentV2DetailAttributes" + id: + description: Unique identifier for the deployment. + example: "k7Q-3mX-p9Z" + type: string + type: + $ref: "#/components/schemas/FleetDeploymentResourceType" + required: + - id + - type + - attributes + type: object + FleetDeploymentV2DetailAgent: + description: Per-host status entry for a deployment. + properties: + error: + description: Error message if the deployment failed on this host. + example: "" + type: string + hostname: + description: Hostname of the agent. + example: "web-01.example.com" + type: string + running_step: + description: Name of the step currently executing on this host. + example: "applying_config" + type: string + status: + description: Deployment status for this host (for example, "pending", "running", "succeeded", "failed"). + example: "running" + type: string + status_details: + description: Additional details about the current deployment status on this host. + example: "step 2/3" + type: string + versions: + description: Package version details for this host. + items: + $ref: "#/components/schemas/FleetDeploymentHostPackage" + type: array + type: object + FleetDeploymentV2DetailAttributes: + description: Attributes of a deployment detail response. + properties: + author: + description: Handle of the user who triggered the deployment. + example: "carol@datadoghq.com" + type: string + canceled_hosts: + description: Number of hosts on which the deployment was canceled. + example: 1 + format: int64 + minimum: 0 + type: integer + config_operations: + description: |- + Ordered list of configuration file operations applied by this deployment. + Absent for package deployments, which have no configuration file operations. + items: + $ref: "#/components/schemas/FleetDeploymentOperation" + type: array + duration_seconds: + description: |- + Duration of the deployment in seconds, computed as `finished_at - started_at`. + Zero if the deployment has not finished. + example: 3600 + format: int64 + type: integer + error_summary: + description: Top-level error message for the deployment. Populated only when the deployment has failed. + example: "A host failed to update" + type: string + estimated_finished_at: + description: Estimated completion time of the deployment as a Unix timestamp. Zero if not available. + example: 1699999999 + format: int64 + type: integer + failed_hosts: + description: Number of hosts on which the deployment failed. + example: 1 + format: int64 + minimum: 0 + type: integer + high_level_status: + description: |- + Current high-level status of the deployment (for example, "pending", "running", + "completed", "failed"). + example: "running" + type: string + hosts: + description: Per-host status list for this deployment. + items: + $ref: "#/components/schemas/FleetDeploymentV2DetailAgent" + type: array + is_scheduled: + description: Whether this deployment was triggered by a schedule (`schedule_id` is non-empty). + example: true + type: boolean + query: + description: Query used to filter and select target hosts for the deployment. + example: "env:prod AND service:web" + type: string + running_hosts: + description: Number of hosts on which the deployment is currently running. + example: 1 + format: int64 + minimum: 0 + type: integer + schedule_id: + description: Identifier of the schedule that triggered this deployment. Empty if triggered manually. + example: "sched-789" + type: string + skipped_hosts: + description: Number of hosts that were skipped during the deployment. + example: 1 + format: int64 + minimum: 0 + type: integer + succeeded_hosts: + description: Number of hosts on which the deployment succeeded. + example: 1 + format: int64 + minimum: 0 + type: integer + target_versions: + description: Distinct package versions targeted by this deployment, in first-seen order. + example: ["7.52.0"] + items: + type: string + type: array + total_hosts: + description: Total number of hosts targeted by this deployment. + example: 42 + format: int64 + type: integer + update_type: + description: |- + Type of update operation performed by this deployment + (for example, "update_config_operations", "update_package"). + example: "update_config_operations" + type: string + type: object + FleetDeploymentV2DetailResponse: + description: Response containing detailed information about a single deployment. + properties: + data: + $ref: "#/components/schemas/FleetDeploymentV2Detail" + required: + - data + type: object + FleetDeploymentsV2Page: + description: Pagination details for the v2 list of deployments. properties: total_count: description: Total number of deployments available across all pages. example: 25 format: int64 type: integer + total_filtered_count: + description: Total number of deployments matching the current filter query. + example: 10 + format: int64 + type: integer type: object - FleetDeploymentsResponse: + FleetDeploymentsV2Response: description: Response containing a paginated list of deployments. properties: data: description: Array of deployments matching the query criteria. items: - $ref: "#/components/schemas/FleetDeployment" + $ref: "#/components/schemas/FleetDeploymentV2" type: array meta: - $ref: "#/components/schemas/FleetDeploymentsResponseMeta" + $ref: "#/components/schemas/FleetDeploymentsV2ResponseMeta" required: - data type: object - FleetDeploymentsResponseMeta: - description: Metadata for the list of deployments, including pagination information. + FleetDeploymentsV2ResponseMeta: + description: Metadata for the v2 list of deployments, including pagination information. properties: page: - $ref: "#/components/schemas/FleetDeploymentsPage" + $ref: "#/components/schemas/FleetDeploymentsV2Page" type: object FleetDetectedIntegration: description: An integration detected on the agent but not necessarily configured. @@ -39429,11 +39988,11 @@ components: example: "postgres" type: string type: object - FleetIntegrationDetails: + FleetIntegrationDetailsV2: description: Detailed information about a single integration. properties: data_type: - description: Type of data collected (metrics, logs). + description: Type of data collected, such as metrics or logs. example: "metrics" type: string error_messages: @@ -39451,12 +40010,23 @@ components: is_custom_check: description: Whether this is a custom integration. type: boolean + is_default: + description: Whether this is a default integration instance. + type: boolean + is_init: + description: Whether this integration configuration is an init config. + type: boolean log_config: description: Log collection configuration (YAML format). type: string name: description: Name of the integration instance. type: string + pod_count: + description: >- + Number of pods running this integration. Absent from the response when the count is zero. + format: int64 + type: integer source_index: description: Index in the configuration file. format: int64 @@ -39469,13 +40039,16 @@ components: example: "postgres" type: string type: object - FleetIntegrationsByStatus: + FleetIntegrationsByStatusV2: description: Integrations organized by their status. properties: + cluster_name: + description: The Kubernetes cluster name, if the agent runs in a cluster. + type: string configuration_files: description: Configuration files for integrations. items: - $ref: "#/components/schemas/FleetConfigurationFile" + $ref: "#/components/schemas/FleetConfigurationFileV2" type: array datadog_agent_key: description: The unique agent key identifier. @@ -39483,8 +40056,11 @@ components: error_integrations: description: Integrations with errors. items: - $ref: "#/components/schemas/FleetIntegrationDetails" + $ref: "#/components/schemas/FleetIntegrationDetailsV2" type: array + k8s_cluster_key: + description: The Kubernetes cluster key, if the agent runs in a cluster. + type: string missing_integrations: description: Detected but not configured integrations. items: @@ -39493,18 +40069,31 @@ components: warning_integrations: description: Integrations with warnings. items: - $ref: "#/components/schemas/FleetIntegrationDetails" + $ref: "#/components/schemas/FleetIntegrationDetailsV2" type: array working_integrations: description: Integrations that are working correctly. items: - $ref: "#/components/schemas/FleetIntegrationDetails" + $ref: "#/components/schemas/FleetIntegrationDetailsV2" type: array type: object FleetOtelCollector: additionalProperties: {} description: OpenTelemetry collector information. type: object + FleetOtelCollectorConfigurationV2: + description: Configuration for a single OpenTelemetry collector associated with the agent. + properties: + collector_id: + description: The unique identifier of the OpenTelemetry collector. + type: string + compiled_configuration: + description: The final compiled configuration of the OpenTelemetry collector. + type: string + distribution: + description: The distribution of the OpenTelemetry collector. + type: string + type: object FleetSchedule: description: A schedule that automatically creates deployments based on a recurrence rule. properties: @@ -39727,17 +40316,169 @@ components: x-enum-varnames: - ACTIVE - INACTIVE - FleetSchedulesResponse: - description: Response containing a list of schedules. + FleetScheduleV2: + description: A fleet upgrade schedule resource in the v2 API response. + properties: + attributes: + $ref: "#/components/schemas/FleetScheduleV2Attributes" + id: + description: Unique identifier for the schedule. + example: "abc-def-ghi-123" + type: string + type: + $ref: "#/components/schemas/FleetScheduleResourceType" + required: + - id + - type + - attributes + type: object + FleetScheduleV2Attributes: + description: Attributes of a fleet schedule in the v2 API response. + properties: + created_at: + description: RFC3339 timestamp when the schedule was created. + example: "2023-11-14T22:13:19Z" + type: string + created_by: + description: User handle of the person who created the schedule. + example: "user@example.com" + type: string + is_default: + description: Whether this is the default schedule for the organization. + example: false + type: boolean + name: + description: Human-readable name for the schedule. + example: "Weekly Production Agent Updates" + type: string + next_run: + description: |- + RFC3339 timestamp of the next scheduled maintenance window start time. + Absent when the next run time cannot be computed. + example: "2025-01-06T02:00:00Z" + type: string + notification_rule: + $ref: "#/components/schemas/FleetScheduleV2NotificationRule" + query: + description: Query used to filter and select target hosts for scheduled deployments. + example: "env:prod AND service:web" + type: string + rule: + $ref: "#/components/schemas/FleetScheduleV2RecurrenceRule" + status: + $ref: "#/components/schemas/FleetScheduleStatus" + updated_at: + description: RFC3339 timestamp when the schedule was last updated. + example: "2023-11-14T22:13:19Z" + type: string + updated_by: + description: User handle of the person who last updated the schedule. + example: "user@example.com" + type: string + version_to_latest: + description: |- + Number of major versions behind the latest to target for upgrades. + - 0: Always upgrade to the latest version. + - 1: Upgrade to latest minus 1 major version. + - 2: Upgrade to latest minus 2 major versions. + example: 0 + format: int64 + maximum: 2 + minimum: 0 + type: integer + type: object + FleetScheduleV2NotificationRule: + description: |- + Notification configuration attached to a schedule. + + Included when available. If the notification rule cannot be retrieved, this field is + omitted and the schedule is still returned. If the notification rule is retrieved but its + handles cannot be resolved, it is still included with an empty `handles` array. + properties: + handles: + description: Notification handles (for example, Slack channels or PagerDuty integrations). + items: + description: A notification handle. + type: string + type: array + tags: + description: Tags associated with the notification rule. + items: + description: A tag string. + type: string + type: array + type: object + FleetScheduleV2RecurrenceRule: + description: Defines the recurrence pattern for the schedule. + properties: + days_of_week: + description: |- + Days of the week when the schedule triggers. Valid values are + "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun". + example: ["Mon", "Wed", "Fri"] + items: + description: A day of the week (for example, "Mon"). + type: string + type: array + interval: + description: |- + Interval between schedule runs in weeks. 1 means the schedule runs every week + on the specified days. Higher values repeat every N weeks. + example: 1 + format: int64 + type: integer + maintenance_window_duration: + description: Duration of the maintenance window in minutes. + example: 120 + format: int64 + type: integer + start_maintenance_window: + description: |- + Start time of the maintenance window in 24-hour clock format (HH:MM). + Deployments are triggered at this time on the specified days. + example: "02:00" + type: string + timezone: + description: Timezone in IANA Time Zone Database format. + example: "America/New_York" + type: string + type: object + FleetScheduleV2Response: + description: Response containing a single fleet schedule. + properties: + data: + $ref: "#/components/schemas/FleetScheduleV2" + required: + - data + type: object + FleetSchedulesV2Page: + description: Pagination details for the v2 list of schedules. + properties: + total_count: + description: Total number of schedules returned. + example: 5 + format: int64 + type: integer + type: object + FleetSchedulesV2Response: + description: Response containing a list of fleet schedules. properties: data: - description: Array of schedules. + description: Array of schedules for the organization. items: - $ref: "#/components/schemas/FleetSchedule" + $ref: "#/components/schemas/FleetScheduleV2" type: array + meta: + $ref: "#/components/schemas/FleetSchedulesV2ResponseMeta" required: - data type: object + FleetSchedulesV2ResponseMeta: + description: Metadata for the v2 list of schedules response. + properties: + page: + $ref: "#/components/schemas/FleetSchedulesV2Page" + type: object FleetTracerAttributes: description: Attributes of a fleet tracer representing a service instance reporting telemetry. properties: @@ -117813,208 +118554,6 @@ info: version: "1.0" openapi: 3.0.0 paths: - /api/unstable/fleet/agent_versions: - get: - description: |- - Retrieve a list of all available Datadog Agent versions. - - This endpoint returns the available Agent versions that can be deployed to your fleet. - These versions are used when creating deployments or configuring schedules for - automated Agent upgrades. - operationId: ListFleetAgentVersions - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - - attributes: - version: "7.50.0" - id: "7.50.0" - type: agent_version - schema: - $ref: "#/components/schemas/FleetAgentVersionsResponse" - 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 available Agent versions - 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: - 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 (starts at 0). - in: query - name: page_number - required: false - schema: - default: 0 - format: int64 - minimum: 0 - 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: - examples: - default: - value: - data: - attributes: - agents: - - agent_version: "7.50.0" - datadog_agent_key: my-agent-hostname - hostname: my-hostname - os: linux - id: done - type: status - meta: - total_filtered_count: 1 - 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: - examples: - default: - value: - data: - attributes: - agent_infos: - agent_version: "7.50.0" - datadog_agent_key: my-agent-hostname - hostname: my-hostname - os: linux - id: my-agent-hostname - type: datadog_agent_key - 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/agents/{agent_key}/tracers: get: description: |- @@ -118107,629 +118646,7 @@ 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/deployments: - get: - description: |- - Retrieve a list of all deployments for fleet automation. - Use the `page_size` and `page_offset` parameters to paginate results. - operationId: ListFleetDeployments - parameters: - - description: Number of deployments to return per page. Maximum value is 100. - in: query - name: page_size - required: false - schema: - default: 10 - format: int64 - maximum: 100 - type: integer - - description: Index of the first deployment to return. Use this with `page_size` to paginate through results. - in: query - name: page_offset - required: false - schema: - default: 0 - format: int64 - type: integer - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - - attributes: - filter_query: "env:prod AND service:web" - high_level_status: running - total_hosts: 10 - id: aeadc05e-98a8-11ec-ac2c-da7ad0900001 - type: deployment - meta: - page: - total_count: 1 - schema: - $ref: "#/components/schemas/FleetDeploymentsResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: List all deployments - 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/configure: - post: - description: |- - Create a new deployment to apply configuration changes - to a fleet of hosts matching the specified filter query. - - This endpoint supports two types of configuration operations: - - `merge-patch`: Merges the provided patch data with the existing configuration file, - creating the file if it doesn't exist - - `delete`: Removes the specified configuration file from the target hosts - - The deployment is created and started automatically. You can specify multiple configuration - operations that will be executed in order on each target host. Use the filter query to target - specific hosts using the Datadog query syntax. - operationId: CreateFleetDeploymentConfigure - requestBody: - content: - application/json: - examples: - add_log_integration: - summary: Add log integrations for multiple services - value: - data: - attributes: - config_operations: - - file_op: "merge-patch" - file_path: "/conf.d/postgres.d/logs.yaml" - patch: - logs: - - path: "/var/log/postgres.log" - service: "postgres1" - source: "postgres" - type: file - - file_op: "merge-patch" - file_path: "/conf.d/kafka.d/logs.yaml" - patch: - logs: - - path: "/var/log/kafka.log" - service: "kafka1" - source: "kafka" - 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 - default: - 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: - data: - attributes: - config_operations: - - file_op: "delete" - file_path: "/conf.d/old-integration.yaml" - filter_query: "env:dev" - type: deployment - enable_apm_and_logs: - summary: Enable APM and Logs products - value: - data: - attributes: - config_operations: - - file_op: "merge-patch" - file_path: "/datadog.yaml" - patch: - apm_config: - enabled: true - log_level: "debug" - logs_enabled: true - filter_query: "env:prod AND service:web" - type: deployment - simple_log_level: - summary: Set log level to info - value: - data: - attributes: - config_operations: - - file_op: "merge-patch" - file_path: "/datadog.yaml" - patch: - log_level: "info" - filter_query: "env:staging" - type: deployment - schema: - $ref: "#/components/schemas/FleetDeploymentConfigureCreateRequest" - description: Request payload containing the deployment details. - required: true - responses: - "201": - content: - application/json: - examples: - default: - value: - data: - attributes: - config_operations: - - file_op: merge-patch - file_path: /datadog.yaml - patch: - log_level: info - filter_query: env:prod AND service:web - high_level_status: pending - total_hosts: 42 - id: abc-123 - type: deployment - schema: - $ref: "#/components/schemas/FleetDeploymentResponse" - description: CREATED - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: Create a configuration deployment - tags: - - Fleet Automation - "x-permission": - operator: AND - permissions: - - agent_upgrade_write - - fleet_policies_write - 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/upgrade: - post: - description: |- - Create and immediately start a new package upgrade - on hosts matching the specified filter query. - - This endpoint allows you to upgrade the Datadog Agent to a specific version - on hosts matching the specified filter query. - - The deployment is created and started automatically. The system will: - 1. Identify all hosts matching the filter query - 2. Validate that the specified version is available - 3. Begin rolling out the package upgrade to the target hosts - operationId: CreateFleetDeploymentUpgrade - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - filter_query: env:prod AND service:web - target_packages: - - name: datadog-agent - version: 7.52.0 - type: deployment - upgrade_agent: - summary: Upgrade Datadog Agent to version 7.52.0 - value: - data: - attributes: - filter_query: "env:prod AND service:web" - target_packages: - - name: "datadog-agent" - version: "7.52.0" - type: deployment - upgrade_multiple_packages: - summary: Upgrade multiple packages - value: - data: - attributes: - filter_query: "env:staging" - target_packages: - - name: "datadog-agent" - version: "7.52.0-1" - - name: "datadog-apm-inject" - version: "0.10.0" - type: deployment - schema: - $ref: "#/components/schemas/FleetDeploymentPackageUpgradeCreateRequest" - description: Request payload containing the package upgrade details. - required: true - responses: - "201": - content: - application/json: - examples: - default: - value: - data: - attributes: - filter_query: "env:prod AND service:web" - high_level_status: pending - total_hosts: 0 - id: aeadc05e-98a8-11ec-ac2c-da7ad0900001 - type: deployment - schema: - $ref: "#/components/schemas/FleetDeploymentResponse" - description: CREATED - "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: Upgrade hosts - tags: - - Fleet Automation - "x-permission": - operator: AND - permissions: - - agent_upgrade_write - - fleet_policies_write - 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/{deployment_id}: - get: - description: |- - Retrieve detailed information about a specific deployment using its unique identifier. - This endpoint returns comprehensive information about a deployment, including: - - Deployment metadata (ID, type, filter query) - - Total number of target hosts - - Current high-level status (pending, running, succeeded, failed) - - Estimated completion time - - Configuration operations that were or are being applied - - Detailed host list: A paginated array of hosts included in this deployment with individual - host status, current package versions, and any errors - - The host list provides visibility into the per-host execution status, allowing you to: - - Monitor which hosts have completed successfully - - Identify hosts that are still in progress - - Investigate failures on specific hosts - - View current package versions installed on each host (including initial, target, and current - versions for each package) - - Pagination: Use the `limit` and `page` query parameters to paginate through hosts. The response - includes pagination metadata in the `meta.hosts` field with information about the current page, - total pages, and total host count. The default page size is 50 hosts, with a maximum of 100. - operationId: GetFleetDeployment - parameters: - - description: The unique identifier of the deployment to retrieve. - example: "abc-def-ghi" - in: path - name: deployment_id - required: true - schema: - type: string - - description: Maximum number of hosts to return per page. Default is 50, maximum is 100. - in: query - name: limit - required: false - schema: - default: 50 - format: int64 - maximum: 100 - type: integer - - description: Page index for pagination (zero-based). Use this to retrieve subsequent pages of hosts. - in: query - name: page - required: false - schema: - default: 0 - format: int64 - type: integer - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - filter_query: "env:prod AND service:web" - high_level_status: running - total_hosts: 10 - id: aeadc05e-98a8-11ec-ac2c-da7ad0900001 - type: deployment - schema: - $ref: "#/components/schemas/FleetDeploymentResponse" - 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 a configuration deployment by ID - 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/{deployment_id}/cancel: - post: - description: |- - Cancel an active deployment and stop all pending operations. - When you cancel a deployment: - - All pending operations on hosts that haven't started yet are stopped - - Operations currently in progress on hosts may complete or be interrupted, depending on their current state - - Configuration changes or package upgrades already applied to hosts are not rolled back - - After cancellation, you can view the final state of the deployment using the GET endpoint to see which hosts - were successfully updated before the cancellation. - operationId: CancelFleetDeployment - parameters: - - description: The unique identifier of the deployment to cancel. - example: "abc-def-ghi" - in: path - name: deployment_id - required: true - schema: - type: string - responses: - "204": - description: Deployment successfully canceled. - "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: Cancel a deployment - tags: - - Fleet Automation - "x-permission": - operator: AND - permissions: - - agent_upgrade_write - - fleet_policies_write - 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/schedules: - get: - description: |- - Retrieve a list of all schedules for automated fleet deployments. - - Schedules allow you to automate package upgrades by defining maintenance windows - and recurrence rules. Each schedule automatically creates deployments based on its - configuration. - operationId: ListFleetSchedules - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - - attributes: - created_at_unix: 1699999999 - created_by: test@example.com - name: Weekly Production Agent Updates - query: env:prod AND service:web - rule: - days_of_week: - - Mon - - Wed - maintenance_window_duration: 120 - start_maintenance_window: "02:00" - timezone: America/New_York - status: active - updated_at_unix: 1699999999 - updated_by: test@example.com - version_to_latest: 0 - id: abc-def-ghi-123 - type: schedule - schema: - $ref: "#/components/schemas/FleetSchedulesResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: List all schedules - 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/). post: description: |- Create a new schedule for automated package upgrades. @@ -118890,77 +118807,6 @@ 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/). - get: - description: |- - Retrieve detailed information about a specific schedule using its unique identifier. - - This endpoint returns comprehensive information about a schedule, including: - - Schedule metadata (ID, name, creation/update timestamps) - - Filter query for selecting target hosts - - Recurrence rule defining when deployments are triggered - - Version strategy for package upgrades - - Current status (active or inactive) - operationId: GetFleetSchedule - parameters: - - description: The unique identifier of the schedule to retrieve. - example: "abc-def-ghi-123" - in: path - name: id - required: true - schema: - type: string - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - created_at_unix: 1699999999 - created_by: test@example.com - name: Weekly Production Agent Updates - query: env:prod AND service:web - rule: - days_of_week: - - Mon - - Wed - maintenance_window_duration: 120 - start_maintenance_window: "02:00" - timezone: America/New_York - status: active - updated_at_unix: 1699999999 - updated_by: test@example.com - version_to_latest: 0 - id: abc-def-ghi-123 - type: schedule - schema: - $ref: "#/components/schemas/FleetScheduleResponse" - 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 a schedule by ID - 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/). patch: description: |- Partially update a schedule by providing only the fields you want to change. @@ -142702,6 +142548,813 @@ paths: operator: AND permissions: - feature_flag_config_write + /api/v2/fleet/agent_versions: + get: + description: |- + Retrieve the list of Datadog Agent versions available for deployment. + + Returns `200` with an empty `data` array if the Agent package exists in the catalog + but has no available versions, and `404` only if the Agent package itself is absent + from the catalog. + operationId: ListFleetAgentVersionsV2 + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + version: "7.80.4" + id: "7.80.4" + type: agent_version + - attributes: + version: "7.81.1" + id: "7.81.1" + type: agent_version + meta: + page: + total_count: 2 + schema: + $ref: "#/components/schemas/FleetAgentVersionsV2Response" + description: OK + "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 available Datadog Agent versions + tags: + - Fleet Automation + "x-permission": + operator: AND + permissions: + - hosts_read + /api/v2/fleet/agents: + get: + description: |- + Retrieve a paginated list of Datadog Agents. + + Returns agents with support for pagination, sorting, and filtering. + Use `page_number` and `page_size` to navigate pages, `filter` to narrow by field values, + and `tags` to filter by agent tags. + operationId: ListFleetAgentsV2 + parameters: + - description: Page number for pagination, starting at 0. + in: query + name: page_number + required: false + schema: + default: 0 + format: int64 + minimum: 0 + type: integer + - description: Number of agents to return per page. Maximum value is 100. Defaults to 10. + in: query + name: page_size + required: false + schema: + default: 10 + format: int64 + maximum: 100 + minimum: 1 + type: integer + - description: Filter string to narrow down agent results. + example: "hostname:my-hostname OR env:dev" + in: query + name: filter + required: false + schema: + type: string + - description: >- + Comma-separated list of tag keys to select which tags are included in each agent's `tags` attribute. Does not filter which agents are returned. + in: query + name: tags + required: false + schema: + type: string + - description: >- + Agent attribute to sort results by. Must be a supported attribute name; unsupported values return a 400 error. + in: query + name: sort_attribute + required: false + schema: + type: string + - description: Set to `true` to sort results in descending order. Defaults to ascending. + in: query + name: sort_descending + required: false + schema: + type: boolean + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + agent_version: "7.50.0" + api_key_name: "Production API Key" + api_key_uuid: "a1b2c3d4-e5f6-4321-a123-123456789abc" + cloud_provider: aws + datadog_data_center: us1 + enabled_products: + - apm + - logs + env: + - prod + first_seen_at: 1699900000 + fleet_policies: [] + hostname: my-hostname + integrations: + - mysql + ip_addresses: + - "10.0.0.1" + is_single_step_instrumentation_enabled: false + last_restart_at: 1699999999 + os: linux + otel_collector_versions: [] + remote_agent_management: enabled + remote_config_status: connected + services: + - web + tags: + - key: team + value: platform + id: my-agent-hostname + type: agent + meta: + page: + total_count: 500 + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/FleetAgentsV2Response" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List all Datadog Agents + tags: + - Fleet Automation + "x-permission": + operator: AND + permissions: + - hosts_read + /api/v2/fleet/agents/{agent_key}: + get: + description: |- + Retrieve detailed information about a specific Datadog Agent. + + By default, only `agent_infos` is returned. Use the `include` query parameter to + request additional data: `integrations` and/or `configuration_files`. + operationId: GetFleetAgentDetailV2 + parameters: + - description: >- + The unique identifier (Agent key) for the Datadog Agent. Must be a 32-character lowercase hexadecimal string. + example: "a1b2c3d4e5f67890a1b2c3d4e5f67890" + in: path + name: agent_key + required: true + schema: + pattern: "^[0-9a-f]{32}$" + type: string + - description: >- + Comma-separated list of additional fields to include in the response. Valid values are `integrations` and `configuration_files`. Omitting this parameter returns only `agent_infos`. Unrecognized values are silently ignored rather than causing an error. + example: "integrations,configuration_files" + in: query + name: include + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + agent_infos: + agent_version: "7.50.0" + datadog_agent_key: a1b2c3d4e5f67890a1b2c3d4e5f67890 + hostname: my-hostname + os: linux + id: a1b2c3d4e5f67890a1b2c3d4e5f67890 + type: agent + schema: + $ref: "#/components/schemas/FleetAgentDetailV2Response" + 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 + /api/v2/fleet/deployments: + get: + description: Retrieve a paginated list of all deployments for fleet automation. + operationId: ListFleetDeploymentsV2 + parameters: + - description: Number of deployments to return per page. Maximum value is 100. + in: query + name: page_size + required: false + schema: + default: 10 + format: int64 + maximum: 100 + type: integer + - description: Page number for pagination, starting at 0. + in: query + name: page_number + required: false + schema: + default: 0 + format: int64 + minimum: 0 + type: integer + - description: |- + Field to sort results by (for example, `start_date`). Must be a supported field + name; unsupported values return a 400 error. + in: query + name: sort + required: false + schema: + type: string + - description: |- + Set to `true` to sort in ascending order. This setting has no effect unless `sort` is also set. + Defaults to descending order. + in: query + name: ascending + required: false + schema: + type: boolean + - description: |- + Query used to filter deployments. Uses the Datadog query syntax. Filtering on an + unsupported field returns a 400 error. For example: + - `status:failed` or `status:done_with_errors`: deployments that need investigation. + - `status:running`: deployments currently in flight. + - `update_type:update_package` or `update_type:update_config_operations`: deployments of a given type. + example: "status:failed" + in: query + name: filter + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + author: "alice@datadoghq.com" + config_operations: + - file_op: merge-patch + file_path: "/datadog.yaml" + patch: + logs_enabled: true + duration_seconds: 0 + error_summary: "" + estimated_finished_at: 1699999999 + finished_at: 0 + is_scheduled: true + query: "env:prod AND service:web" + schedule_id: "sched-123" + started_at: 1699990000 + status: running + target_versions: ["7.52.0"] + total_hosts: 10 + update_type: update_config_operations + id: k7Q-3mX-p9Z + type: deployment + meta: + page: + total_count: 1 + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/FleetDeploymentsV2Response" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List all deployments + tags: + - Fleet Automation + "x-permission": + operator: AND + permissions: + - hosts_read + /api/v2/fleet/deployments/configure: + post: + description: |- + Create a new deployment to apply configuration changes + to a fleet of hosts matching the specified filter query. + + This endpoint supports two types of configuration operations: + - `merge-patch`: Merges the provided patch data with the existing configuration file, + creating the file if it doesn't exist. + - `delete`: Removes the specified configuration file from the target hosts. + + You can optionally use `target_packages` to apply the configuration change only to specific package versions. + + The deployment is created and started automatically. You can specify multiple configuration + operations to execute in order on each target host. Use the filter query to target + specific hosts using the Datadog query syntax. + + Set `dry_run` to `true` to validate the configuration and resolve target hosts and packages without deploying anything. A dry run returns a 200 with the validation result instead of creating and starting a deployment. + + Returns a 400 if `filter_query` or `config_operations` is missing, a target package is missing a name or version or cannot be resolved, the configuration fails validation, or the filter query does not match any host eligible for the deployment. + operationId: CreateFleetDeploymentConfigureV2 + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + config_operations: + - file_op: merge-patch + file_path: /datadog.yaml + patch: + apm_config: + enabled: true + log_level: info + logs_enabled: true + filter_query: env:prod AND datacenter:us-east-1 + type: deployment + dry_run: + summary: Dry run + value: + data: + attributes: + config_operations: + - file_op: merge-patch + file_path: /datadog.yaml + patch: + log_level: info + dry_run: true + filter_query: env:prod AND datacenter:us-east-1 + type: deployment + schema: + $ref: "#/components/schemas/FleetDeploymentConfigureV2CreateRequest" + description: Request payload containing the deployment details. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + dry_run: + config_validated: true + non_upgradable_hosts: 0 + query: "env:prod AND datacenter:us-east-1" + total_hosts: 42 + id: dry-run + type: deployment + schema: + $ref: "#/components/schemas/FleetDeploymentConfigureV2DryRunResponse" + description: OK + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + author: "alice@datadoghq.com" + duration_seconds: 0 + error_summary: "" + estimated_finished_at: 0 + finished_at: 0 + is_scheduled: false + query: "env:prod AND datacenter:us-east-1" + started_at: 1699990000 + status: pending + target_versions: [] + update_type: update_config_operations + id: k7Q-3mX-p9Z + type: deployment + schema: + $ref: "#/components/schemas/FleetDeploymentV2CreateResponse" + description: CREATED + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a configuration deployment + tags: + - Fleet Automation + "x-permission": + operator: AND + permissions: + - agent_upgrade_write + - fleet_policies_write + /api/v2/fleet/deployments/upgrade: + post: + description: |- + Create and immediately start a new package upgrade + on hosts matching the specified filter query. + + This endpoint allows you to upgrade the Datadog Agent to a specific version + on hosts matching the specified filter query. + + The deployment is created and started automatically. The system: + 1. Identifies all hosts matching the filter query. + 2. Validates that the specified version is available. + 3. Begins rolling out the package upgrade to the target hosts. + + Returns a 400 if `filter_query` or `target_packages` is missing, a target package is missing a name or version, or the filter query does not match any host eligible for the upgrade. Returns a 409 if a conflicting upgrade is already running on one or more target hosts. + operationId: CreateFleetDeploymentUpgradeV2 + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + filter_query: env:prod AND service:web + target_packages: + - name: datadog-agent + version: 7.52.0 + type: deployment + schema: + $ref: "#/components/schemas/FleetDeploymentPackageUpgradeV2CreateRequest" + description: Request payload containing the package upgrade details. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + author: "alice@datadoghq.com" + duration_seconds: 0 + error_summary: "" + estimated_finished_at: 0 + finished_at: 0 + is_scheduled: false + query: "env:prod AND service:web" + started_at: 1699990000 + status: pending + target_versions: ["7.52.0"] + update_type: update_package + id: k7Q-3mX-p9Z + type: deployment + schema: + $ref: "#/components/schemas/FleetDeploymentV2CreateResponse" + description: CREATED + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Upgrade hosts + tags: + - Fleet Automation + "x-permission": + operator: AND + permissions: + - agent_upgrade_write + - fleet_policies_write + /api/v2/fleet/deployments/{deployment_id}: + get: + description: |- + Retrieve detailed information about a specific deployment, including its current status, + configuration operations, and per-host execution status. + + Returns a 404 if no deployment matches the given ID or if you do not have access to it. + operationId: GetFleetDeploymentV2 + parameters: + - description: The unique identifier of the deployment to retrieve. + example: "k7Q-3mX-p9Z" + in: path + name: deployment_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + author: "carol@datadoghq.com" + canceled_hosts: 1 + config_operations: + - file_op: merge-patch + file_path: "/datadog.yaml" + patch: + logs_enabled: true + duration_seconds: 0 + error_summary: "" + estimated_finished_at: 1699999999 + failed_hosts: 1 + high_level_status: running + hosts: + - hostname: web-01.example.com + running_step: applying_config + status: running + status_details: "step 2/3" + versions: + - current_version: "7.50.0" + package_name: datadog-agent + target_version: "7.52.0" + - hostname: web-02.example.com + status: succeeded + versions: + - current_version: "7.52.0" + package_name: datadog-agent + target_version: "7.52.0" + is_scheduled: true + query: "env:prod AND service:web" + running_hosts: 1 + schedule_id: "sched-789" + skipped_hosts: 1 + succeeded_hosts: 1 + target_versions: ["7.52.0"] + total_hosts: 5 + update_type: update_config_operations + id: k7Q-3mX-p9Z + type: deployment + schema: + $ref: "#/components/schemas/FleetDeploymentV2DetailResponse" + 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 a deployment by ID + tags: + - Fleet Automation + "x-permission": + operator: AND + permissions: + - hosts_read + /api/v2/fleet/deployments/{deployment_id}/cancel: + post: + description: |- + Cancel an active deployment and stop all pending operations. + When you cancel a deployment: + - All pending operations on hosts that haven't started yet are stopped. + - Operations currently in progress on hosts may complete or be interrupted, depending on their current status. + - Configuration changes or package upgrades already applied to hosts are not rolled back. + + After cancellation, you can view the final state of the deployment using the GET endpoint to see which hosts + were successfully updated before the cancellation. + + Only deployments with a `pending` or `running` status can be canceled. Returns a 400 if the deployment is not in a cancelable status. Returns a 404 if no deployment matches the specified ID or if you do not have access to it. + operationId: CancelFleetDeploymentV2 + parameters: + - description: The unique identifier of the deployment to cancel. + example: "k7Q-3mX-p9Z" + in: path + name: deployment_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + message: "Cancellation has been requested; the deployment is stopping." + status: stopping + id: k7Q-3mX-p9Z + type: deployment + schema: + $ref: "#/components/schemas/FleetDeploymentV2CancelResponse" + 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: Cancel a deployment + tags: + - Fleet Automation + "x-permission": + operator: AND + permissions: + - agent_upgrade_write + - fleet_policies_write + /api/v2/fleet/schedules: + get: + description: |- + Retrieve all upgrade schedules for the organization. + + Schedules automate package upgrades by defining maintenance windows and recurrence rules. + Each schedule automatically creates deployments based on its configuration. + operationId: ListFleetSchedulesV2 + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2023-11-14T22:13:19Z" + created_by: user@example.com + is_default: false + name: Weekly Production Agent Updates + next_run: "2025-01-06T02:00:00Z" + query: env:prod AND service:web + rule: + days_of_week: + - Mon + - Wed + interval: 1 + maintenance_window_duration: 120 + start_maintenance_window: "02:00" + timezone: America/New_York + status: active + updated_at: "2023-11-14T22:13:19Z" + updated_by: user@example.com + version_to_latest: 0 + id: abc-def-ghi-123 + type: schedule + meta: + page: + total_count: 1 + schema: + $ref: "#/components/schemas/FleetSchedulesV2Response" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List all schedules + tags: + - Fleet Automation + "x-permission": + operator: OR + permissions: + - hosts_read + /api/v2/fleet/schedules/{id}: + get: + description: |- + Retrieve detailed information about a specific schedule by its unique identifier. + operationId: GetFleetScheduleV2 + parameters: + - description: The unique identifier of the schedule to retrieve. + example: "abc-def-ghi-123" + in: path + name: id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2023-11-14T22:13:19Z" + created_by: user@example.com + is_default: false + name: Weekly Production Agent Updates + next_run: "2025-01-06T02:00:00Z" + query: env:prod AND service:web + rule: + days_of_week: + - Mon + - Wed + interval: 1 + maintenance_window_duration: 120 + start_maintenance_window: "02:00" + timezone: America/New_York + status: active + updated_at: "2023-11-14T22:13:19Z" + updated_by: user@example.com + version_to_latest: 0 + id: abc-def-ghi-123 + type: schedule + schema: + $ref: "#/components/schemas/FleetScheduleV2Response" + 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 a schedule by ID + tags: + - Fleet Automation + "x-permission": + operator: OR + permissions: + - hosts_read /api/v2/forms: get: description: Get all forms for the authenticated user's organization. diff --git a/examples/v2/fleet-automation/CancelFleetDeployment.rb b/examples/v2/fleet-automation/CancelFleetDeployment.rb deleted file mode 100644 index 41f565d6a03a..000000000000 --- a/examples/v2/fleet-automation/CancelFleetDeployment.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Cancel a deployment returns "Deployment successfully canceled." response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.cancel_fleet_deployment".to_sym] = true -end -api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new -api_instance.cancel_fleet_deployment("deployment_id") diff --git a/examples/v2/fleet-automation/CancelFleetDeploymentV2.rb b/examples/v2/fleet-automation/CancelFleetDeploymentV2.rb new file mode 100644 index 000000000000..0e8967ebd3b9 --- /dev/null +++ b/examples/v2/fleet-automation/CancelFleetDeploymentV2.rb @@ -0,0 +1,8 @@ +# Cancel a deployment returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new + +# there is a valid "deployment" in the system +DEPLOYMENT_ID = ENV["DEPLOYMENT_ID"] +p api_instance.cancel_fleet_deployment_v2(DEPLOYMENT_ID) diff --git a/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.rb b/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.rb deleted file mode 100644 index 3cb060517cf2..000000000000 --- a/examples/v2/fleet-automation/CreateFleetDeploymentConfigure.rb +++ /dev/null @@ -1,26 +0,0 @@ -# Create a configuration deployment returns "CREATED" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.create_fleet_deployment_configure".to_sym] = true -end -api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new - -body = DatadogAPIClient::V2::FleetDeploymentConfigureCreateRequest.new({ - data: DatadogAPIClient::V2::FleetDeploymentConfigureCreate.new({ - attributes: DatadogAPIClient::V2::FleetDeploymentConfigureAttributes.new({ - config_operations: [ - DatadogAPIClient::V2::FleetDeploymentOperation.new({ - file_op: DatadogAPIClient::V2::FleetDeploymentFileOp::MERGE_PATCH, - file_path: "/datadog.yaml", - patch: { - "apm_config": "{'enabled': True}", "log_level": "debug", "logs_enabled": "True", - }, - }), - ], - filter_query: "env:prod AND service:web", - }), - type: DatadogAPIClient::V2::FleetDeploymentResourceType::DEPLOYMENT, - }), -}) -p api_instance.create_fleet_deployment_configure(body) diff --git a/examples/v2/fleet-automation/CreateFleetDeploymentConfigureV2.rb b/examples/v2/fleet-automation/CreateFleetDeploymentConfigureV2.rb new file mode 100644 index 000000000000..06a40659fc64 --- /dev/null +++ b/examples/v2/fleet-automation/CreateFleetDeploymentConfigureV2.rb @@ -0,0 +1,24 @@ +# Create a configuration deployment returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new + +body = DatadogAPIClient::V2::FleetDeploymentConfigureV2CreateRequest.new({ + data: DatadogAPIClient::V2::FleetDeploymentConfigureV2Create.new({ + attributes: DatadogAPIClient::V2::FleetDeploymentConfigureV2Attributes.new({ + config_operations: [ + DatadogAPIClient::V2::FleetDeploymentOperation.new({ + file_op: DatadogAPIClient::V2::FleetDeploymentFileOp::MERGE_PATCH, + file_path: "/datadog.yaml", + patch: { + "log_level": "info", + }, + }), + ], + dry_run: true, + filter_query: "env:prod AND service:example-fleet-automation", + }), + type: DatadogAPIClient::V2::FleetDeploymentResourceType::DEPLOYMENT, + }), +}) +p api_instance.create_fleet_deployment_configure_v2(body) diff --git a/examples/v2/fleet-automation/CreateFleetDeploymentUpgrade.rb b/examples/v2/fleet-automation/CreateFleetDeploymentUpgradeV2.rb similarity index 53% rename from examples/v2/fleet-automation/CreateFleetDeploymentUpgrade.rb rename to examples/v2/fleet-automation/CreateFleetDeploymentUpgradeV2.rb index d245b2e237a4..93b1f60339a6 100644 --- a/examples/v2/fleet-automation/CreateFleetDeploymentUpgrade.rb +++ b/examples/v2/fleet-automation/CreateFleetDeploymentUpgradeV2.rb @@ -1,15 +1,12 @@ # Upgrade hosts returns "CREATED" response require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.create_fleet_deployment_upgrade".to_sym] = true -end api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new -body = DatadogAPIClient::V2::FleetDeploymentPackageUpgradeCreateRequest.new({ - data: DatadogAPIClient::V2::FleetDeploymentPackageUpgradeCreate.new({ - attributes: DatadogAPIClient::V2::FleetDeploymentPackageUpgradeAttributes.new({ - filter_query: "env:prod AND service:web", +body = DatadogAPIClient::V2::FleetDeploymentPackageUpgradeV2CreateRequest.new({ + data: DatadogAPIClient::V2::FleetDeploymentPackageUpgradeV2Create.new({ + attributes: DatadogAPIClient::V2::FleetDeploymentPackageUpgradeV2Attributes.new({ + filter_query: "env:prod AND service:example-fleet-automation", target_packages: [ DatadogAPIClient::V2::FleetDeploymentPackage.new({ name: "datadog-agent", @@ -20,4 +17,4 @@ type: DatadogAPIClient::V2::FleetDeploymentResourceType::DEPLOYMENT, }), }) -p api_instance.create_fleet_deployment_upgrade(body) +p api_instance.create_fleet_deployment_upgrade_v2(body) diff --git a/examples/v2/fleet-automation/GetFleetAgentDetailV2.rb b/examples/v2/fleet-automation/GetFleetAgentDetailV2.rb new file mode 100644 index 000000000000..f88bc09beafc --- /dev/null +++ b/examples/v2/fleet-automation/GetFleetAgentDetailV2.rb @@ -0,0 +1,5 @@ +# Get detailed information about an agent returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new +p api_instance.get_fleet_agent_detail_v2("a1b2c3d4e5f67890a1b2c3d4e5f67890") diff --git a/examples/v2/fleet-automation/GetFleetAgentInfo.rb b/examples/v2/fleet-automation/GetFleetAgentInfo.rb deleted file mode 100644 index f8d19b2a0cb6..000000000000 --- a/examples/v2/fleet-automation/GetFleetAgentInfo.rb +++ /dev/null @@ -1,8 +0,0 @@ -# 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/GetFleetDeployment.rb b/examples/v2/fleet-automation/GetFleetDeployment.rb deleted file mode 100644 index 0b294306dd82..000000000000 --- a/examples/v2/fleet-automation/GetFleetDeployment.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Get a configuration deployment by ID returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.get_fleet_deployment".to_sym] = true -end -api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new -p api_instance.get_fleet_deployment("deployment_id") diff --git a/examples/v2/fleet-automation/GetFleetDeployment_1482493803.rb b/examples/v2/fleet-automation/GetFleetDeploymentV2.rb similarity index 57% rename from examples/v2/fleet-automation/GetFleetDeployment_1482493803.rb rename to examples/v2/fleet-automation/GetFleetDeploymentV2.rb index 19fa3f945652..788a1b28093d 100644 --- a/examples/v2/fleet-automation/GetFleetDeployment_1482493803.rb +++ b/examples/v2/fleet-automation/GetFleetDeploymentV2.rb @@ -1,11 +1,8 @@ # Get a deployment by ID returns "OK" response require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.get_fleet_deployment".to_sym] = true -end api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new # there is a valid "deployment" in the system DEPLOYMENT_ID = ENV["DEPLOYMENT_ID"] -p api_instance.get_fleet_deployment(DEPLOYMENT_ID) +p api_instance.get_fleet_deployment_v2(DEPLOYMENT_ID) diff --git a/examples/v2/fleet-automation/GetFleetSchedule.rb b/examples/v2/fleet-automation/GetFleetSchedule.rb deleted file mode 100644 index b630e14b0c9e..000000000000 --- a/examples/v2/fleet-automation/GetFleetSchedule.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Get a schedule by ID returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.get_fleet_schedule".to_sym] = true -end -api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new -p api_instance.get_fleet_schedule("id") diff --git a/examples/v2/fleet-automation/GetFleetScheduleV2.rb b/examples/v2/fleet-automation/GetFleetScheduleV2.rb new file mode 100644 index 000000000000..066588f5a7ca --- /dev/null +++ b/examples/v2/fleet-automation/GetFleetScheduleV2.rb @@ -0,0 +1,8 @@ +# Get a schedule by ID returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new + +# there is a valid "fleet_schedule" in the system +SCHEDULE_ID = ENV["SCHEDULE_ID"] +p api_instance.get_fleet_schedule_v2(SCHEDULE_ID) diff --git a/examples/v2/fleet-automation/ListFleetAgentVersions.rb b/examples/v2/fleet-automation/ListFleetAgentVersions.rb deleted file mode 100644 index 9fde32f6934a..000000000000 --- a/examples/v2/fleet-automation/ListFleetAgentVersions.rb +++ /dev/null @@ -1,8 +0,0 @@ -# List all available Agent versions returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.list_fleet_agent_versions".to_sym] = true -end -api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new -p api_instance.list_fleet_agent_versions() diff --git a/examples/v2/fleet-automation/ListFleetAgentVersionsV2.rb b/examples/v2/fleet-automation/ListFleetAgentVersionsV2.rb new file mode 100644 index 000000000000..e29abbd8e1ac --- /dev/null +++ b/examples/v2/fleet-automation/ListFleetAgentVersionsV2.rb @@ -0,0 +1,5 @@ +# List available Datadog Agent versions returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new +p api_instance.list_fleet_agent_versions_v2() diff --git a/examples/v2/fleet-automation/ListFleetAgents.rb b/examples/v2/fleet-automation/ListFleetAgents.rb deleted file mode 100644 index 04c3cf7ae550..000000000000 --- a/examples/v2/fleet-automation/ListFleetAgents.rb +++ /dev/null @@ -1,8 +0,0 @@ -# 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/examples/v2/fleet-automation/ListFleetAgentsV2.rb b/examples/v2/fleet-automation/ListFleetAgentsV2.rb new file mode 100644 index 000000000000..3881b0d8dd37 --- /dev/null +++ b/examples/v2/fleet-automation/ListFleetAgentsV2.rb @@ -0,0 +1,5 @@ +# List all Datadog Agents returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new +p api_instance.list_fleet_agents_v2() diff --git a/examples/v2/fleet-automation/ListFleetDeployments.rb b/examples/v2/fleet-automation/ListFleetDeployments.rb deleted file mode 100644 index 872e5d7440f7..000000000000 --- a/examples/v2/fleet-automation/ListFleetDeployments.rb +++ /dev/null @@ -1,8 +0,0 @@ -# List all deployments returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.list_fleet_deployments".to_sym] = true -end -api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new -p api_instance.list_fleet_deployments() diff --git a/examples/v2/fleet-automation/ListFleetDeploymentsV2.rb b/examples/v2/fleet-automation/ListFleetDeploymentsV2.rb new file mode 100644 index 000000000000..8e3efe159251 --- /dev/null +++ b/examples/v2/fleet-automation/ListFleetDeploymentsV2.rb @@ -0,0 +1,5 @@ +# List all deployments returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new +p api_instance.list_fleet_deployments_v2() diff --git a/examples/v2/fleet-automation/ListFleetSchedules.rb b/examples/v2/fleet-automation/ListFleetSchedules.rb deleted file mode 100644 index 0cc7f8496038..000000000000 --- a/examples/v2/fleet-automation/ListFleetSchedules.rb +++ /dev/null @@ -1,8 +0,0 @@ -# List all schedules returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.list_fleet_schedules".to_sym] = true -end -api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new -p api_instance.list_fleet_schedules() diff --git a/examples/v2/fleet-automation/ListFleetSchedulesV2.rb b/examples/v2/fleet-automation/ListFleetSchedulesV2.rb new file mode 100644 index 000000000000..c21c7b6d8e68 --- /dev/null +++ b/examples/v2/fleet-automation/ListFleetSchedulesV2.rb @@ -0,0 +1,5 @@ +# List all schedules returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::FleetAutomationAPI.new +p api_instance.list_fleet_schedules_v2() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 3140acefbdb7..c4bfa9ae1080 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -839,17 +839,6 @@ "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.ListFleetAgentTracers" => { "agent_key" => "String", "page_number" => "Integer", @@ -857,33 +846,12 @@ "sort_attribute" => "String", "sort_descending" => "Boolean", }, - "v2.ListFleetDeployments" => { - "page_size" => "Integer", - "page_offset" => "Integer", - }, - "v2.CreateFleetDeploymentConfigure" => { - "body" => "FleetDeploymentConfigureCreateRequest", - }, - "v2.CreateFleetDeploymentUpgrade" => { - "body" => "FleetDeploymentPackageUpgradeCreateRequest", - }, - "v2.GetFleetDeployment" => { - "deployment_id" => "String", - "limit" => "Integer", - "page" => "Integer", - }, - "v2.CancelFleetDeployment" => { - "deployment_id" => "String", - }, "v2.CreateFleetSchedule" => { "body" => "FleetScheduleCreateRequest", }, "v2.DeleteFleetSchedule" => { "id" => "String", }, - "v2.GetFleetSchedule" => { - "id" => "String", - }, "v2.UpdateFleetSchedule" => { "id" => "String", "body" => "FleetSchedulePatchRequest", @@ -898,6 +866,40 @@ "sort_descending" => "Boolean", "filter" => "String", }, + "v2.ListFleetAgentsV2" => { + "page_number" => "Integer", + "page_size" => "Integer", + "filter" => "String", + "tags" => "String", + "sort_attribute" => "String", + "sort_descending" => "Boolean", + }, + "v2.GetFleetAgentDetailV2" => { + "agent_key" => "String", + "include" => "String", + }, + "v2.ListFleetDeploymentsV2" => { + "page_size" => "Integer", + "page_number" => "Integer", + "sort" => "String", + "ascending" => "Boolean", + "filter" => "String", + }, + "v2.CreateFleetDeploymentConfigureV2" => { + "body" => "FleetDeploymentConfigureV2CreateRequest", + }, + "v2.CreateFleetDeploymentUpgradeV2" => { + "body" => "FleetDeploymentPackageUpgradeV2CreateRequest", + }, + "v2.GetFleetDeploymentV2" => { + "deployment_id" => "String", + }, + "v2.CancelFleetDeploymentV2" => { + "deployment_id" => "String", + }, + "v2.GetFleetScheduleV2" => { + "id" => "String", + }, "v2.DeleteLLMObsCustomEvalConfig" => { "eval_name" => "String", }, diff --git a/features/v2/fleet_automation.feature b/features/v2/fleet_automation.feature index 3fede3c72f0b..06d0251beb98 100644 --- a/features/v2/fleet_automation.feature +++ b/features/v2/fleet_automation.feature @@ -14,46 +14,49 @@ Feature: Fleet Automation And a valid "appKeyAuth" key in the system And an instance of "FleetAutomation" API - @generated @skip @team:DataDog/fleet-automation + @skip @team:DataDog/fleet-automation Scenario: Cancel a deployment returns "Bad Request" response - Given operation "CancelFleetDeployment" enabled - And new "CancelFleetDeployment" request - And request contains "deployment_id" parameter from "REPLACE.ME" + Given new "CancelFleetDeploymentV2" request + And request contains "deployment_id" parameter with value "not-a-valid-deployment-id" When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/fleet-automation - Scenario: Cancel a deployment returns "Deployment successfully canceled." response - Given operation "CancelFleetDeployment" enabled - And new "CancelFleetDeployment" request - And request contains "deployment_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 204 Deployment successfully canceled. - - @generated @skip @team:DataDog/fleet-automation + @skip @team:DataDog/fleet-automation Scenario: Cancel a deployment returns "Not Found" response - Given operation "CancelFleetDeployment" enabled - And new "CancelFleetDeployment" request - And request contains "deployment_id" parameter from "REPLACE.ME" + Given new "CancelFleetDeploymentV2" request + And request contains "deployment_id" parameter with value "000-000-000" When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/fleet-automation + @skip @team:DataDog/fleet-automation + Scenario: Cancel a deployment returns "OK" response + Given there is a valid "deployment" in the system + And new "CancelFleetDeploymentV2" request + And request contains "deployment_id" parameter from "deployment.id" + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/fleet-automation Scenario: Create a configuration deployment returns "Bad Request" response - Given operation "CreateFleetDeploymentConfigure" enabled - And new "CreateFleetDeploymentConfigure" request - And body with value {"data": {"attributes": {"config_operations": [{"file_op": "merge-patch", "file_path": "/datadog.yaml", "patch": {"apm_config": {"enabled": true}, "log_level": "debug", "logs_enabled": true}}], "filter_query": "env:prod AND service:web"}, "type": "deployment"}} + Given new "CreateFleetDeploymentConfigureV2" request + And body with value {"data": {"attributes": {"filter_query": "env:prod AND service:{{ unique_lower }}"}, "type": "deployment"}} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/fleet-automation + @skip @team:DataDog/fleet-automation Scenario: Create a configuration deployment returns "CREATED" response - Given operation "CreateFleetDeploymentConfigure" enabled - And new "CreateFleetDeploymentConfigure" request - And body with value {"data": {"attributes": {"config_operations": [{"file_op": "merge-patch", "file_path": "/datadog.yaml", "patch": {"apm_config": {"enabled": true}, "log_level": "debug", "logs_enabled": true}}], "filter_query": "env:prod AND service:web"}, "type": "deployment"}} + Given new "CreateFleetDeploymentConfigureV2" request + And body with value {"data": {"attributes": {"config_operations": [{"file_op": "merge-patch", "file_path": "/datadog.yaml", "patch": {"apm_config": {"enabled": true}, "log_level": "info", "logs_enabled": true}}], "filter_query": "env:prod AND service:{{ unique_lower }}"}, "type": "deployment"}} When the request is sent Then the response status is 201 CREATED + @skip @team:DataDog/fleet-automation + Scenario: Create a configuration deployment returns "OK" response + Given new "CreateFleetDeploymentConfigureV2" request + And body with value {"data": {"attributes": {"config_operations": [{"file_op": "merge-patch", "file_path": "/datadog.yaml", "patch": {"log_level": "info"}}], "dry_run": true, "filter_query": "env:prod AND service:{{ unique_lower }}"}, "type": "deployment"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/fleet-automation Scenario: Create a schedule returns "Bad Request" response Given operation "CreateFleetSchedule" enabled @@ -94,141 +97,92 @@ Feature: Fleet Automation When the request is sent Then the response status is 204 Schedule successfully deleted. - @generated @skip @team:DataDog/fleet-automation - Scenario: Get a configuration deployment by ID returns "Bad Request" response - Given operation "GetFleetDeployment" enabled - And new "GetFleetDeployment" request - And request contains "deployment_id" parameter from "REPLACE.ME" + @skip @team:DataDog/fleet-automation + Scenario: Get a deployment by ID returns "Bad Request" response + Given new "GetFleetDeploymentV2" request + And request contains "deployment_id" parameter with value "not-a-valid-deployment-id" When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/fleet-automation - Scenario: Get a configuration deployment by ID returns "Not Found" response - Given operation "GetFleetDeployment" enabled - And new "GetFleetDeployment" request - And request contains "deployment_id" parameter from "REPLACE.ME" + @skip @team:DataDog/fleet-automation + Scenario: Get a deployment by ID returns "Not Found" response + Given new "GetFleetDeploymentV2" request + And request contains "deployment_id" parameter with value "000-000-000" When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/fleet-automation - Scenario: Get a configuration deployment by ID returns "OK" response - Given operation "GetFleetDeployment" enabled - And new "GetFleetDeployment" request - And request contains "deployment_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 200 OK - @skip @team:DataDog/fleet-automation Scenario: Get a deployment by ID returns "OK" response - Given operation "GetFleetDeployment" enabled - And there is a valid "deployment" in the system - And new "GetFleetDeployment" request + Given there is a valid "deployment" in the system + And new "GetFleetDeploymentV2" request And request contains "deployment_id" parameter from "deployment.id" When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/fleet-automation + @skip @team:DataDog/fleet-automation Scenario: Get a schedule by ID returns "Bad Request" response - Given operation "GetFleetSchedule" enabled - And new "GetFleetSchedule" request - And request contains "id" parameter from "REPLACE.ME" + Given new "GetFleetScheduleV2" request + And request contains "id" parameter with value "not-a-valid-schedule-id" When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/fleet-automation + @skip @team:DataDog/fleet-automation Scenario: Get a schedule by ID returns "Not Found" response - Given operation "GetFleetSchedule" enabled - And new "GetFleetSchedule" request - And request contains "id" parameter from "REPLACE.ME" + Given new "GetFleetScheduleV2" request + And request contains "id" parameter with value "000-000-000" When the request is sent Then the response status is 404 Not Found @skip @team:DataDog/fleet-automation Scenario: Get a schedule by ID returns "OK" response - Given operation "GetFleetSchedule" enabled - And there is a valid "fleet_schedule" in the system - And new "GetFleetSchedule" request - And request contains "id" parameter from "REPLACE.ME" + Given there is a valid "fleet_schedule" in the system + And new "GetFleetScheduleV2" request + And request contains "id" parameter from "schedule.id" When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/fleet-automation + @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" + Given new "GetFleetAgentDetailV2" request + And request contains "agent_key" parameter with value "not-a-valid-agent-key" When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/fleet-automation + @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" + Given new "GetFleetAgentDetailV2" request + And request contains "agent_key" parameter with value "00000000000000000000000000000000" When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/fleet-automation + @integration-only @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" + Given new "GetFleetAgentDetailV2" request + And request contains "agent_key" parameter with value "a1b2c3d4e5f67890a1b2c3d4e5f67890" 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 + Given new "ListFleetAgentsV2" 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 - And new "ListFleetAgentVersions" request - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/fleet-automation - Scenario: List all available Agent versions returns "Not Found" response - Given operation "ListFleetAgentVersions" enabled - And new "ListFleetAgentVersions" request - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/fleet-automation - Scenario: List all available Agent versions returns "OK" response - Given operation "ListFleetAgentVersions" enabled - And new "ListFleetAgentVersions" request + Given new "ListFleetAgentsV2" request When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/fleet-automation Scenario: List all deployments returns "Bad Request" response - Given operation "ListFleetDeployments" enabled - And new "ListFleetDeployments" request + Given new "ListFleetDeploymentsV2" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/fleet-automation Scenario: List all deployments returns "OK" response - Given operation "ListFleetDeployments" enabled - And new "ListFleetDeployments" request + Given new "ListFleetDeploymentsV2" request When the request is sent Then the response status is 200 OK @@ -255,15 +209,25 @@ Feature: Fleet Automation @generated @skip @team:DataDog/fleet-automation Scenario: List all schedules returns "Bad Request" response - Given operation "ListFleetSchedules" enabled - And new "ListFleetSchedules" request + Given new "ListFleetSchedulesV2" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/fleet-automation Scenario: List all schedules returns "OK" response - Given operation "ListFleetSchedules" enabled - And new "ListFleetSchedules" request + Given new "ListFleetSchedulesV2" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/fleet-automation + Scenario: List available Datadog Agent versions returns "Not Found" response + Given new "ListFleetAgentVersionsV2" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/fleet-automation + Scenario: List available Datadog Agent versions returns "OK" response + Given new "ListFleetAgentVersionsV2" request When the request is sent Then the response status is 200 OK @@ -342,26 +306,24 @@ Feature: Fleet Automation When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/fleet-automation + @skip @team:DataDog/fleet-automation Scenario: Upgrade hosts returns "Bad Request" response - Given operation "CreateFleetDeploymentUpgrade" enabled - And new "CreateFleetDeploymentUpgrade" request - And body with value {"data": {"attributes": {"filter_query": "env:prod AND service:web", "target_packages": [{"name": "datadog-agent", "version": "7.52.0"}]}, "type": "deployment"}} + Given new "CreateFleetDeploymentUpgradeV2" request + And body with value {"data": {"attributes": {"filter_query": "env:prod AND service:{{ unique_lower }}"}, "type": "deployment"}} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/fleet-automation + @skip @team:DataDog/fleet-automation Scenario: Upgrade hosts returns "CREATED" response - Given operation "CreateFleetDeploymentUpgrade" enabled - And new "CreateFleetDeploymentUpgrade" request - And body with value {"data": {"attributes": {"filter_query": "env:prod AND service:web", "target_packages": [{"name": "datadog-agent", "version": "7.52.0"}]}, "type": "deployment"}} + Given new "CreateFleetDeploymentUpgradeV2" request + And body with value {"data": {"attributes": {"filter_query": "env:prod AND service:{{ unique_lower }}", "target_packages": [{"name": "datadog-agent", "version": "7.52.0"}]}, "type": "deployment"}} When the request is sent Then the response status is 201 CREATED - @generated @skip @team:DataDog/fleet-automation - Scenario: Upgrade hosts returns "Not Found" response - Given operation "CreateFleetDeploymentUpgrade" enabled - And new "CreateFleetDeploymentUpgrade" request - And body with value {"data": {"attributes": {"filter_query": "env:prod AND service:web", "target_packages": [{"name": "datadog-agent", "version": "7.52.0"}]}, "type": "deployment"}} + @skip @team:DataDog/fleet-automation + Scenario: Upgrade hosts returns "Conflict" response + Given there is a valid "package_deployment" in the system + And new "CreateFleetDeploymentUpgradeV2" request + And body with value {"data": {"attributes": {"filter_query": "env:prod AND service:{{ unique_lower }}", "target_packages": [{"name": "datadog-agent", "version": "7.52.0"}]}, "type": "deployment"}} When the request is sent - Then the response status is 404 Not Found + Then the response status is 409 Conflict diff --git a/features/v2/given.json b/features/v2/given.json index 6f57cbefde83..6e48ed1fc534 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1,30 +1,4 @@ [ - { - "parameters": [ - { - "name": "body", - "value": "{\n \"data\": {\n \"type\": \"deployment\",\n \"attributes\": {\n \"filter_query\": \"env:prod AND service:{{ unique_lower }}\",\n \"config_operations\": [\n {\n \"file_op\": \"merge-patch\",\n \"file_path\": \"/datadog.yaml\",\n \"patch\": {\n \"log_level\": \"info\"\n }\n }\n ]\n }\n }\n}" - } - ], - "source": "data", - "step": "there is a valid \"deployment\" in the system", - "key": "deployment", - "tag": "Fleet Automation", - "operationId": "CreateFleetDeploymentConfigure" - }, - { - "parameters": [ - { - "name": "body", - "value": "{\n \"data\": {\n \"type\": \"deployment\",\n \"attributes\": {\n \"filter_query\": \"env:prod AND service:{{ unique_lower }}\",\n \"target_packages\": [\n {\n \"name\": \"datadog-agent\",\n \"version\": \"7.52.0\"\n }\n ]\n }\n }\n}" - } - ], - "source": "data", - "step": "there is a valid \"package_deployment\" in the system", - "key": "package_deployment", - "tag": "Fleet Automation", - "operationId": "CreateFleetDeploymentUpgrade" - }, { "parameters": [ { @@ -498,6 +472,32 @@ "tag": "Feature Flags", "operationId": "UpdateAllocationsForFeatureFlagInEnvironment" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"deployment\",\n \"attributes\": {\n \"filter_query\": \"env:prod AND service:{{ unique_lower }}\",\n \"config_operations\": [\n {\n \"file_op\": \"merge-patch\",\n \"file_path\": \"/datadog.yaml\",\n \"patch\": {\n \"log_level\": \"info\"\n }\n }\n ]\n }\n }\n}" + } + ], + "source": "data", + "step": "there is a valid \"deployment\" in the system", + "key": "deployment", + "tag": "Fleet Automation", + "operationId": "CreateFleetDeploymentConfigureV2" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"deployment\",\n \"attributes\": {\n \"filter_query\": \"env:prod AND service:{{ unique_lower }}\",\n \"target_packages\": [\n {\n \"name\": \"datadog-agent\",\n \"version\": \"7.52.0\"\n }\n ]\n }\n }\n}" + } + ], + "source": "data", + "step": "there is a valid \"package_deployment\" in the system", + "key": "package_deployment", + "tag": "Fleet Automation", + "operationId": "CreateFleetDeploymentUpgradeV2" + }, { "parameters": [ { diff --git a/features/v2/undo.json b/features/v2/undo.json index 9c1ff8a4f2fd..133ab9ade47d 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1,78 +1,10 @@ { - "ListFleetAgentVersions": { - "tag": "Fleet Automation", - "undo": { - "type": "safe" - } - }, - "ListFleetAgents": { - "tag": "Fleet Automation", - "undo": { - "type": "safe" - } - }, - "GetFleetAgentInfo": { - "tag": "Fleet Automation", - "undo": { - "type": "safe" - } - }, "ListFleetAgentTracers": { "tag": "Fleet Automation", "undo": { "type": "safe" } }, - "ListFleetDeployments": { - "tag": "Fleet Automation", - "undo": { - "type": "safe" - } - }, - "CreateFleetDeploymentConfigure": { - "tag": "Fleet Automation", - "undo": { - "operationId": "CancelFleetDeployment", - "parameters": [ - { - "name": "deployment_id", - "source": "data.id" - } - ], - "type": "unsafe" - } - }, - "CreateFleetDeploymentUpgrade": { - "tag": "Fleet Automation", - "undo": { - "operationId": "CancelFleetDeployment", - "parameters": [ - { - "name": "deployment_id", - "source": "data.id" - } - ], - "type": "unsafe" - } - }, - "GetFleetDeployment": { - "tag": "Fleet Automation", - "undo": { - "type": "safe" - } - }, - "CancelFleetDeployment": { - "tag": "Fleet Automation", - "undo": { - "type": "idempotent" - } - }, - "ListFleetSchedules": { - "tag": "Fleet Automation", - "undo": { - "type": "safe" - } - }, "CreateFleetSchedule": { "tag": "Fleet Automation", "undo": { @@ -92,12 +24,6 @@ "type": "unsafe" } }, - "GetFleetSchedule": { - "tag": "Fleet Automation", - "undo": { - "type": "safe" - } - }, "UpdateFleetSchedule": { "tag": "Fleet Automation", "undo": { @@ -2747,6 +2673,80 @@ "type": "idempotent" } }, + "ListFleetAgentVersionsV2": { + "tag": "Fleet Automation", + "undo": { + "type": "safe" + } + }, + "ListFleetAgentsV2": { + "tag": "Fleet Automation", + "undo": { + "type": "safe" + } + }, + "GetFleetAgentDetailV2": { + "tag": "Fleet Automation", + "undo": { + "type": "safe" + } + }, + "ListFleetDeploymentsV2": { + "tag": "Fleet Automation", + "undo": { + "type": "safe" + } + }, + "CreateFleetDeploymentConfigureV2": { + "tag": "Fleet Automation", + "undo": { + "operationId": "CancelFleetDeploymentV2", + "parameters": [ + { + "name": "deployment_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "CreateFleetDeploymentUpgradeV2": { + "tag": "Fleet Automation", + "undo": { + "operationId": "CancelFleetDeploymentV2", + "parameters": [ + { + "name": "deployment_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "GetFleetDeploymentV2": { + "tag": "Fleet Automation", + "undo": { + "type": "safe" + } + }, + "CancelFleetDeploymentV2": { + "tag": "Fleet Automation", + "undo": { + "type": "idempotent" + } + }, + "ListFleetSchedulesV2": { + "tag": "Fleet Automation", + "undo": { + "type": "safe" + } + }, + "GetFleetScheduleV2": { + "tag": "Fleet Automation", + "undo": { + "type": "safe" + } + }, "ListForms": { "tag": "Forms", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index e77b416a870c..5a416e62be64 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -189,19 +189,9 @@ def initialize @http_proxypass = nil @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) @unstable_operations = { - "v2.cancel_fleet_deployment": false, - "v2.create_fleet_deployment_configure": false, - "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_tracers": false, - "v2.list_fleet_agent_versions": false, - "v2.list_fleet_deployments": false, - "v2.list_fleet_schedules": false, "v2.list_fleet_tracers": false, "v2.trigger_fleet_schedule": false, "v2.update_fleet_schedule": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index df29244cf7d7..1bc8cbc8c62f 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3362,46 +3362,66 @@ 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_agent_configuration_files_v2" => "FleetAgentConfigurationFilesV2", + "v2.fleet_agent_detail_v2" => "FleetAgentDetailV2", + "v2.fleet_agent_detail_v2_attributes" => "FleetAgentDetailV2Attributes", + "v2.fleet_agent_detail_v2_response" => "FleetAgentDetailV2Response", + "v2.fleet_agent_info_details_v2" => "FleetAgentInfoDetailsV2", + "v2.fleet_agents_v2_page" => "FleetAgentsV2Page", + "v2.fleet_agents_v2_response" => "FleetAgentsV2Response", + "v2.fleet_agents_v2_response_meta" => "FleetAgentsV2ResponseMeta", + "v2.fleet_agent_v2" => "FleetAgentV2", + "v2.fleet_agent_v2_attributes" => "FleetAgentV2Attributes", + "v2.fleet_agent_v2_attributes_instrumentation_status" => "FleetAgentV2AttributesInstrumentationStatus", + "v2.fleet_agent_v2_resource_type" => "FleetAgentV2ResourceType", + "v2.fleet_agent_versions_v2_page" => "FleetAgentVersionsV2Page", + "v2.fleet_agent_versions_v2_response" => "FleetAgentVersionsV2Response", + "v2.fleet_agent_versions_v2_response_meta" => "FleetAgentVersionsV2ResponseMeta", + "v2.fleet_agent_version_v2" => "FleetAgentVersionV2", + "v2.fleet_agent_version_v2_attributes" => "FleetAgentVersionV2Attributes", + "v2.fleet_agent_version_v2_resource_type" => "FleetAgentVersionV2ResourceType", + "v2.fleet_configuration_file_v2" => "FleetConfigurationFileV2", "v2.fleet_configuration_layer" => "FleetConfigurationLayer", "v2.fleet_deployment" => "FleetDeployment", "v2.fleet_deployment_attributes" => "FleetDeploymentAttributes", - "v2.fleet_deployment_configure_attributes" => "FleetDeploymentConfigureAttributes", - "v2.fleet_deployment_configure_create" => "FleetDeploymentConfigureCreate", - "v2.fleet_deployment_configure_create_request" => "FleetDeploymentConfigureCreateRequest", + "v2.fleet_deployment_configure_v2_attributes" => "FleetDeploymentConfigureV2Attributes", + "v2.fleet_deployment_configure_v2_create" => "FleetDeploymentConfigureV2Create", + "v2.fleet_deployment_configure_v2_create_request" => "FleetDeploymentConfigureV2CreateRequest", + "v2.fleet_deployment_configure_v2_dry_run" => "FleetDeploymentConfigureV2DryRun", + "v2.fleet_deployment_configure_v2_dry_run_attributes" => "FleetDeploymentConfigureV2DryRunAttributes", + "v2.fleet_deployment_configure_v2_dry_run_response" => "FleetDeploymentConfigureV2DryRunResponse", + "v2.fleet_deployment_configure_v2_dry_run_result" => "FleetDeploymentConfigureV2DryRunResult", + "v2.fleet_deployment_configure_v2_package" => "FleetDeploymentConfigureV2Package", "v2.fleet_deployment_file_op" => "FleetDeploymentFileOp", "v2.fleet_deployment_host" => "FleetDeploymentHost", "v2.fleet_deployment_host_package" => "FleetDeploymentHostPackage", "v2.fleet_deployment_hosts_page" => "FleetDeploymentHostsPage", "v2.fleet_deployment_operation" => "FleetDeploymentOperation", "v2.fleet_deployment_package" => "FleetDeploymentPackage", - "v2.fleet_deployment_package_upgrade_attributes" => "FleetDeploymentPackageUpgradeAttributes", - "v2.fleet_deployment_package_upgrade_create" => "FleetDeploymentPackageUpgradeCreate", - "v2.fleet_deployment_package_upgrade_create_request" => "FleetDeploymentPackageUpgradeCreateRequest", + "v2.fleet_deployment_package_upgrade_v2_attributes" => "FleetDeploymentPackageUpgradeV2Attributes", + "v2.fleet_deployment_package_upgrade_v2_create" => "FleetDeploymentPackageUpgradeV2Create", + "v2.fleet_deployment_package_upgrade_v2_create_request" => "FleetDeploymentPackageUpgradeV2CreateRequest", "v2.fleet_deployment_resource_type" => "FleetDeploymentResourceType", "v2.fleet_deployment_response" => "FleetDeploymentResponse", "v2.fleet_deployment_response_meta" => "FleetDeploymentResponseMeta", - "v2.fleet_deployments_page" => "FleetDeploymentsPage", - "v2.fleet_deployments_response" => "FleetDeploymentsResponse", - "v2.fleet_deployments_response_meta" => "FleetDeploymentsResponseMeta", + "v2.fleet_deployments_v2_page" => "FleetDeploymentsV2Page", + "v2.fleet_deployments_v2_response" => "FleetDeploymentsV2Response", + "v2.fleet_deployments_v2_response_meta" => "FleetDeploymentsV2ResponseMeta", + "v2.fleet_deployment_v2" => "FleetDeploymentV2", + "v2.fleet_deployment_v2_attributes" => "FleetDeploymentV2Attributes", + "v2.fleet_deployment_v2_cancel" => "FleetDeploymentV2Cancel", + "v2.fleet_deployment_v2_cancel_attributes" => "FleetDeploymentV2CancelAttributes", + "v2.fleet_deployment_v2_cancel_response" => "FleetDeploymentV2CancelResponse", + "v2.fleet_deployment_v2_create_response" => "FleetDeploymentV2CreateResponse", + "v2.fleet_deployment_v2_detail" => "FleetDeploymentV2Detail", + "v2.fleet_deployment_v2_detail_agent" => "FleetDeploymentV2DetailAgent", + "v2.fleet_deployment_v2_detail_attributes" => "FleetDeploymentV2DetailAttributes", + "v2.fleet_deployment_v2_detail_response" => "FleetDeploymentV2DetailResponse", "v2.fleet_detected_integration" => "FleetDetectedIntegration", - "v2.fleet_integration_details" => "FleetIntegrationDetails", - "v2.fleet_integrations_by_status" => "FleetIntegrationsByStatus", + "v2.fleet_integration_details_v2" => "FleetIntegrationDetailsV2", + "v2.fleet_integrations_by_status_v2" => "FleetIntegrationsByStatusV2", + "v2.fleet_otel_collector_configuration_v2" => "FleetOtelCollectorConfigurationV2", "v2.fleet_schedule" => "FleetSchedule", "v2.fleet_schedule_attributes" => "FleetScheduleAttributes", "v2.fleet_schedule_create" => "FleetScheduleCreate", @@ -3413,8 +3433,15 @@ def overrides "v2.fleet_schedule_recurrence_rule" => "FleetScheduleRecurrenceRule", "v2.fleet_schedule_resource_type" => "FleetScheduleResourceType", "v2.fleet_schedule_response" => "FleetScheduleResponse", - "v2.fleet_schedules_response" => "FleetSchedulesResponse", "v2.fleet_schedule_status" => "FleetScheduleStatus", + "v2.fleet_schedules_v2_page" => "FleetSchedulesV2Page", + "v2.fleet_schedules_v2_response" => "FleetSchedulesV2Response", + "v2.fleet_schedules_v2_response_meta" => "FleetSchedulesV2ResponseMeta", + "v2.fleet_schedule_v2" => "FleetScheduleV2", + "v2.fleet_schedule_v2_attributes" => "FleetScheduleV2Attributes", + "v2.fleet_schedule_v2_notification_rule" => "FleetScheduleV2NotificationRule", + "v2.fleet_schedule_v2_recurrence_rule" => "FleetScheduleV2RecurrenceRule", + "v2.fleet_schedule_v2_response" => "FleetScheduleV2Response", "v2.fleet_tracer_attributes" => "FleetTracerAttributes", "v2.fleet_tracers_response" => "FleetTracersResponse", "v2.fleet_tracers_response_data" => "FleetTracersResponseData", 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 2b25997b65c8..d875cb90407d 100644 --- a/lib/datadog_api_client/v2/api/fleet_automation_api.rb +++ b/lib/datadog_api_client/v2/api/fleet_automation_api.rb @@ -25,43 +25,39 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) # Cancel a deployment. # - # @see #cancel_fleet_deployment_with_http_info - def cancel_fleet_deployment(deployment_id, opts = {}) - cancel_fleet_deployment_with_http_info(deployment_id, opts) - nil + # @see #cancel_fleet_deployment_v2_with_http_info + def cancel_fleet_deployment_v2(deployment_id, opts = {}) + data, _status_code, _headers = cancel_fleet_deployment_v2_with_http_info(deployment_id, opts) + data end # Cancel a deployment. # # Cancel an active deployment and stop all pending operations. # When you cancel a deployment: - # - All pending operations on hosts that haven't started yet are stopped - # - Operations currently in progress on hosts may complete or be interrupted, depending on their current state - # - Configuration changes or package upgrades already applied to hosts are not rolled back + # - All pending operations on hosts that haven't started yet are stopped. + # - Operations currently in progress on hosts may complete or be interrupted, depending on their current status. + # - Configuration changes or package upgrades already applied to hosts are not rolled back. # # After cancellation, you can view the final state of the deployment using the GET endpoint to see which hosts # were successfully updated before the cancellation. # + # Only deployments with a `pending` or `running` status can be canceled. Returns a 400 if the deployment is not in a cancelable status. Returns a 404 if no deployment matches the specified ID or if you do not have access to it. + # # @param deployment_id [String] The unique identifier of the deployment to cancel. # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def cancel_fleet_deployment_with_http_info(deployment_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.cancel_fleet_deployment".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.cancel_fleet_deployment") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.cancel_fleet_deployment")) - end + # @return [Array<(FleetDeploymentV2CancelResponse, Integer, Hash)>] FleetDeploymentV2CancelResponse data, response status code and response headers + def cancel_fleet_deployment_v2_with_http_info(deployment_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.cancel_fleet_deployment ...' + @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.cancel_fleet_deployment_v2 ...' end # verify the required parameter 'deployment_id' is set if @api_client.config.client_side_validation && deployment_id.nil? - fail ArgumentError, "Missing the required parameter 'deployment_id' when calling FleetAutomationAPI.cancel_fleet_deployment" + fail ArgumentError, "Missing the required parameter 'deployment_id' when calling FleetAutomationAPI.cancel_fleet_deployment_v2" end # resource path - local_var_path = '/api/unstable/fleet/deployments/{deployment_id}/cancel'.sub('{deployment_id}', CGI.escape(deployment_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/fleet/deployments/{deployment_id}/cancel'.sub('{deployment_id}', CGI.escape(deployment_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -69,7 +65,7 @@ def cancel_fleet_deployment_with_http_info(deployment_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} @@ -78,13 +74,13 @@ def cancel_fleet_deployment_with_http_info(deployment_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'FleetDeploymentV2CancelResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :cancel_fleet_deployment, + :operation => :cancel_fleet_deployment_v2, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -96,16 +92,16 @@ def cancel_fleet_deployment_with_http_info(deployment_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FleetAutomationAPI#cancel_fleet_deployment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FleetAutomationAPI#cancel_fleet_deployment_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a configuration deployment. # - # @see #create_fleet_deployment_configure_with_http_info - def create_fleet_deployment_configure(body, opts = {}) - data, _status_code, _headers = create_fleet_deployment_configure_with_http_info(body, opts) + # @see #create_fleet_deployment_configure_v2_with_http_info + def create_fleet_deployment_configure_v2(body, opts = {}) + data, _status_code, _headers = create_fleet_deployment_configure_v2_with_http_info(body, opts) data end @@ -116,33 +112,33 @@ def create_fleet_deployment_configure(body, opts = {}) # # This endpoint supports two types of configuration operations: # - `merge-patch`: Merges the provided patch data with the existing configuration file, - # creating the file if it doesn't exist - # - `delete`: Removes the specified configuration file from the target hosts + # creating the file if it doesn't exist. + # - `delete`: Removes the specified configuration file from the target hosts. + # + # You can optionally use `target_packages` to apply the configuration change only to specific package versions. # # The deployment is created and started automatically. You can specify multiple configuration - # operations that will be executed in order on each target host. Use the filter query to target + # operations to execute in order on each target host. Use the filter query to target # specific hosts using the Datadog query syntax. # - # @param body [FleetDeploymentConfigureCreateRequest] Request payload containing the deployment details. + # Set `dry_run` to `true` to validate the configuration and resolve target hosts and packages without deploying anything. A dry run returns a 200 with the validation result instead of creating and starting a deployment. + # + # Returns a 400 if `filter_query` or `config_operations` is missing, a target package is missing a name or version or cannot be resolved, the configuration fails validation, or the filter query does not match any host eligible for the deployment. + # + # @param body [FleetDeploymentConfigureV2CreateRequest] Request payload containing the deployment details. # @param opts [Hash] the optional parameters - # @return [Array<(FleetDeploymentResponse, Integer, Hash)>] FleetDeploymentResponse data, response status code and response headers - def create_fleet_deployment_configure_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_fleet_deployment_configure".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_fleet_deployment_configure") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_fleet_deployment_configure")) - end + # @return [Array<(FleetDeploymentConfigureV2DryRunResponse, Integer, Hash)>] FleetDeploymentConfigureV2DryRunResponse data, response status code and response headers + def create_fleet_deployment_configure_v2_with_http_info(body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.create_fleet_deployment_configure ...' + @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.create_fleet_deployment_configure_v2 ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling FleetAutomationAPI.create_fleet_deployment_configure" + fail ArgumentError, "Missing the required parameter 'body' when calling FleetAutomationAPI.create_fleet_deployment_configure_v2" end # resource path - local_var_path = '/api/unstable/fleet/deployments/configure' + local_var_path = '/api/v2/fleet/deployments/configure' # query parameters query_params = opts[:query_params] || {} @@ -161,13 +157,13 @@ def create_fleet_deployment_configure_with_http_info(body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'FleetDeploymentResponse' + return_type = opts[:debug_return_type] || 'FleetDeploymentConfigureV2DryRunResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :create_fleet_deployment_configure, + :operation => :create_fleet_deployment_configure_v2, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -179,16 +175,16 @@ def create_fleet_deployment_configure_with_http_info(body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FleetAutomationAPI#create_fleet_deployment_configure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FleetAutomationAPI#create_fleet_deployment_configure_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Upgrade hosts. # - # @see #create_fleet_deployment_upgrade_with_http_info - def create_fleet_deployment_upgrade(body, opts = {}) - data, _status_code, _headers = create_fleet_deployment_upgrade_with_http_info(body, opts) + # @see #create_fleet_deployment_upgrade_v2_with_http_info + def create_fleet_deployment_upgrade_v2(body, opts = {}) + data, _status_code, _headers = create_fleet_deployment_upgrade_v2_with_http_info(body, opts) data end @@ -200,31 +196,27 @@ def create_fleet_deployment_upgrade(body, opts = {}) # This endpoint allows you to upgrade the Datadog Agent to a specific version # on hosts matching the specified filter query. # - # The deployment is created and started automatically. The system will: - # 1. Identify all hosts matching the filter query - # 2. Validate that the specified version is available - # 3. Begin rolling out the package upgrade to the target hosts + # The deployment is created and started automatically. The system: + # 1. Identifies all hosts matching the filter query. + # 2. Validates that the specified version is available. + # 3. Begins rolling out the package upgrade to the target hosts. # - # @param body [FleetDeploymentPackageUpgradeCreateRequest] Request payload containing the package upgrade details. + # Returns a 400 if `filter_query` or `target_packages` is missing, a target package is missing a name or version, or the filter query does not match any host eligible for the upgrade. Returns a 409 if a conflicting upgrade is already running on one or more target hosts. + # + # @param body [FleetDeploymentPackageUpgradeV2CreateRequest] Request payload containing the package upgrade details. # @param opts [Hash] the optional parameters - # @return [Array<(FleetDeploymentResponse, Integer, Hash)>] FleetDeploymentResponse data, response status code and response headers - def create_fleet_deployment_upgrade_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_fleet_deployment_upgrade".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_fleet_deployment_upgrade") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_fleet_deployment_upgrade")) - end + # @return [Array<(FleetDeploymentV2CreateResponse, Integer, Hash)>] FleetDeploymentV2CreateResponse data, response status code and response headers + def create_fleet_deployment_upgrade_v2_with_http_info(body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.create_fleet_deployment_upgrade ...' + @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.create_fleet_deployment_upgrade_v2 ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling FleetAutomationAPI.create_fleet_deployment_upgrade" + fail ArgumentError, "Missing the required parameter 'body' when calling FleetAutomationAPI.create_fleet_deployment_upgrade_v2" end # resource path - local_var_path = '/api/unstable/fleet/deployments/upgrade' + local_var_path = '/api/v2/fleet/deployments/upgrade' # query parameters query_params = opts[:query_params] || {} @@ -243,13 +235,13 @@ def create_fleet_deployment_upgrade_with_http_info(body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'FleetDeploymentResponse' + return_type = opts[:debug_return_type] || 'FleetDeploymentV2CreateResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :create_fleet_deployment_upgrade, + :operation => :create_fleet_deployment_upgrade_v2, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -261,7 +253,7 @@ def create_fleet_deployment_upgrade_with_http_info(body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: FleetAutomationAPI#create_fleet_deployment_upgrade\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FleetAutomationAPI#create_fleet_deployment_upgrade_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -429,44 +421,42 @@ def delete_fleet_schedule_with_http_info(id, opts = {}) # 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) + # @see #get_fleet_agent_detail_v2_with_http_info + def get_fleet_agent_detail_v2(agent_key, opts = {}) + data, _status_code, _headers = get_fleet_agent_detail_v2_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. + # By default, only `agent_infos` is returned. Use the `include` query parameter to + # request additional data: `integrations` and/or `configuration_files`. + # + # @param agent_key [String] The unique identifier (Agent key) for the Datadog Agent. Must be a 32-character lowercase hexadecimal string. # @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 + # @option opts [String] :include Comma-separated list of additional fields to include in the response. Valid values are `integrations` and `configuration_files`. Omitting this parameter returns only `agent_infos`. Unrecognized values are silently ignored rather than causing an error. + # @return [Array<(FleetAgentDetailV2Response, Integer, Hash)>] FleetAgentDetailV2Response data, response status code and response headers + def get_fleet_agent_detail_v2_with_http_info(agent_key, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.get_fleet_agent_info ...' + @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.get_fleet_agent_detail_v2 ...' 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" + fail ArgumentError, "Missing the required parameter 'agent_key' when calling FleetAutomationAPI.get_fleet_agent_detail_v2" + end + pattern = Regexp.new("^[0-9a-f]{32}$") + if @api_client.config.client_side_validation && agent_key !~ pattern + fail ArgumentError, "invalid value for 'agent_key' when calling FleetAutomationAPI.get_fleet_agent_detail_v2, must conform to the pattern #{pattern}." end # resource path - local_var_path = '/api/unstable/fleet/agents/{agent_key}'.sub('{agent_key}', CGI.escape(agent_key.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/fleet/agents/{agent_key}'.sub('{agent_key}', CGI.escape(agent_key.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} @@ -480,13 +470,13 @@ def get_fleet_agent_info_with_http_info(agent_key, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'FleetAgentInfoResponse' + return_type = opts[:debug_return_type] || 'FleetAgentDetailV2Response' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :get_fleet_agent_info, + :operation => :get_fleet_agent_detail_v2, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -498,72 +488,43 @@ def get_fleet_agent_info_with_http_info(agent_key, opts = {}) 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}" + @api_client.config.logger.debug "API called: FleetAutomationAPI#get_fleet_agent_detail_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get a configuration deployment by ID. + # Get a deployment by ID. # - # @see #get_fleet_deployment_with_http_info - def get_fleet_deployment(deployment_id, opts = {}) - data, _status_code, _headers = get_fleet_deployment_with_http_info(deployment_id, opts) + # @see #get_fleet_deployment_v2_with_http_info + def get_fleet_deployment_v2(deployment_id, opts = {}) + data, _status_code, _headers = get_fleet_deployment_v2_with_http_info(deployment_id, opts) data end - # Get a configuration deployment by ID. - # - # Retrieve detailed information about a specific deployment using its unique identifier. - # This endpoint returns comprehensive information about a deployment, including: - # - Deployment metadata (ID, type, filter query) - # - Total number of target hosts - # - Current high-level status (pending, running, succeeded, failed) - # - Estimated completion time - # - Configuration operations that were or are being applied - # - Detailed host list: A paginated array of hosts included in this deployment with individual - # host status, current package versions, and any errors - # - # The host list provides visibility into the per-host execution status, allowing you to: - # - Monitor which hosts have completed successfully - # - Identify hosts that are still in progress - # - Investigate failures on specific hosts - # - View current package versions installed on each host (including initial, target, and current - # versions for each package) - # - # Pagination: Use the `limit` and `page` query parameters to paginate through hosts. The response - # includes pagination metadata in the `meta.hosts` field with information about the current page, - # total pages, and total host count. The default page size is 50 hosts, with a maximum of 100. + # Get a deployment by ID. + # + # Retrieve detailed information about a specific deployment, including its current status, + # configuration operations, and per-host execution status. + # + # Returns a 404 if no deployment matches the given ID or if you do not have access to it. # # @param deployment_id [String] The unique identifier of the deployment to retrieve. # @param opts [Hash] the optional parameters - # @option opts [Integer] :limit Maximum number of hosts to return per page. Default is 50, maximum is 100. - # @option opts [Integer] :page Page index for pagination (zero-based). Use this to retrieve subsequent pages of hosts. - # @return [Array<(FleetDeploymentResponse, Integer, Hash)>] FleetDeploymentResponse data, response status code and response headers - def get_fleet_deployment_with_http_info(deployment_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_fleet_deployment".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_fleet_deployment") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_fleet_deployment")) - end + # @return [Array<(FleetDeploymentV2DetailResponse, Integer, Hash)>] FleetDeploymentV2DetailResponse data, response status code and response headers + def get_fleet_deployment_v2_with_http_info(deployment_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.get_fleet_deployment ...' + @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.get_fleet_deployment_v2 ...' end # verify the required parameter 'deployment_id' is set if @api_client.config.client_side_validation && deployment_id.nil? - fail ArgumentError, "Missing the required parameter 'deployment_id' when calling FleetAutomationAPI.get_fleet_deployment" - end - if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 - fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FleetAutomationAPI.get_fleet_deployment, must be smaller than or equal to 100.' + fail ArgumentError, "Missing the required parameter 'deployment_id' when calling FleetAutomationAPI.get_fleet_deployment_v2" end # resource path - local_var_path = '/api/unstable/fleet/deployments/{deployment_id}'.sub('{deployment_id}', CGI.escape(deployment_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/fleet/deployments/{deployment_id}'.sub('{deployment_id}', CGI.escape(deployment_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? - query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? # header parameters header_params = opts[:header_params] || {} @@ -577,13 +538,13 @@ def get_fleet_deployment_with_http_info(deployment_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'FleetDeploymentResponse' + return_type = opts[:debug_return_type] || 'FleetDeploymentV2DetailResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :get_fleet_deployment, + :operation => :get_fleet_deployment_v2, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -595,50 +556,37 @@ def get_fleet_deployment_with_http_info(deployment_id, opts = {}) 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_deployment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FleetAutomationAPI#get_fleet_deployment_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a schedule by ID. # - # @see #get_fleet_schedule_with_http_info - def get_fleet_schedule(id, opts = {}) - data, _status_code, _headers = get_fleet_schedule_with_http_info(id, opts) + # @see #get_fleet_schedule_v2_with_http_info + def get_fleet_schedule_v2(id, opts = {}) + data, _status_code, _headers = get_fleet_schedule_v2_with_http_info(id, opts) data end # Get a schedule by ID. # - # Retrieve detailed information about a specific schedule using its unique identifier. - # - # This endpoint returns comprehensive information about a schedule, including: - # - Schedule metadata (ID, name, creation/update timestamps) - # - Filter query for selecting target hosts - # - Recurrence rule defining when deployments are triggered - # - Version strategy for package upgrades - # - Current status (active or inactive) + # Retrieve detailed information about a specific schedule by its unique identifier. # # @param id [String] The unique identifier of the schedule to retrieve. # @param opts [Hash] the optional parameters - # @return [Array<(FleetScheduleResponse, Integer, Hash)>] FleetScheduleResponse data, response status code and response headers - def get_fleet_schedule_with_http_info(id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_fleet_schedule".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_fleet_schedule") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_fleet_schedule")) - end + # @return [Array<(FleetScheduleV2Response, Integer, Hash)>] FleetScheduleV2Response data, response status code and response headers + def get_fleet_schedule_v2_with_http_info(id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.get_fleet_schedule ...' + @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.get_fleet_schedule_v2 ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling FleetAutomationAPI.get_fleet_schedule" + fail ArgumentError, "Missing the required parameter 'id' when calling FleetAutomationAPI.get_fleet_schedule_v2" end # resource path - local_var_path = '/api/unstable/fleet/schedules/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/fleet/schedules/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -655,13 +603,13 @@ def get_fleet_schedule_with_http_info(id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'FleetScheduleResponse' + return_type = opts[:debug_return_type] || 'FleetScheduleV2Response' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :get_fleet_schedule, + :operation => :get_fleet_schedule_v2, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -673,64 +621,60 @@ def get_fleet_schedule_with_http_info(id, opts = {}) 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_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FleetAutomationAPI#get_fleet_schedule_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end 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) + # @see #list_fleet_agents_v2_with_http_info + def list_fleet_agents_v2(opts = {}) + data, _status_code, _headers = list_fleet_agents_v2_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. + # Retrieve a paginated list of Datadog Agents. + # + # Returns agents with support for pagination, sorting, and filtering. + # Use `page_number` and `page_size` to navigate pages, `filter` to narrow by field values, + # and `tags` to filter by agent tags. # # @param opts [Hash] the optional parameters - # @option opts [Integer] :page_number Page number for pagination (starts at 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 + # @option opts [Integer] :page_number Page number for pagination, starting at 0. + # @option opts [Integer] :page_size Number of agents to return per page. Maximum value is 100. Defaults to 10. + # @option opts [String] :filter Filter string to narrow down agent results. + # @option opts [String] :tags Comma-separated list of tag keys to select which tags are included in each agent's `tags` attribute. Does not filter which agents are returned. + # @option opts [String] :sort_attribute Agent attribute to sort results by. Must be a supported attribute name; unsupported values return a 400 error. + # @option opts [Boolean] :sort_descending Set to `true` to sort results in descending order. Defaults to ascending. + # @return [Array<(FleetAgentsV2Response, Integer, Hash)>] FleetAgentsV2Response data, response status code and response headers + def list_fleet_agents_v2_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_agents ...' + @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_agents_v2 ...' end if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0 - fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling FleetAutomationAPI.list_fleet_agents, must be greater than or equal to 0.' + fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling FleetAutomationAPI.list_fleet_agents_v2, must be greater than or equal to 0.' 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.' + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_agents_v2, 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.' + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_agents_v2, must be greater than or equal to 1.' end # resource path - local_var_path = '/api/unstable/fleet/agents' + local_var_path = '/api/v2/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[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].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] || {} @@ -744,13 +688,13 @@ def list_fleet_agents_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'FleetAgentsResponse' + return_type = opts[:debug_return_type] || 'FleetAgentsV2Response' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :list_fleet_agents, + :operation => :list_fleet_agents_v2, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -762,7 +706,7 @@ def list_fleet_agents_with_http_info(opts = {}) 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}" + @api_client.config.logger.debug "API called: FleetAutomationAPI#list_fleet_agents_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -858,37 +802,31 @@ def list_fleet_agent_tracers_with_http_info(agent_key, opts = {}) return data, status_code, headers end - # List all available Agent versions. + # List available Datadog Agent versions. # - # @see #list_fleet_agent_versions_with_http_info - def list_fleet_agent_versions(opts = {}) - data, _status_code, _headers = list_fleet_agent_versions_with_http_info(opts) + # @see #list_fleet_agent_versions_v2_with_http_info + def list_fleet_agent_versions_v2(opts = {}) + data, _status_code, _headers = list_fleet_agent_versions_v2_with_http_info(opts) data end - # List all available Agent versions. + # List available Datadog Agent versions. # - # Retrieve a list of all available Datadog Agent versions. + # Retrieve the list of Datadog Agent versions available for deployment. # - # This endpoint returns the available Agent versions that can be deployed to your fleet. - # These versions are used when creating deployments or configuring schedules for - # automated Agent upgrades. + # Returns `200` with an empty `data` array if the Agent package exists in the catalog + # but has no available versions, and `404` only if the Agent package itself is absent + # from the catalog. # # @param opts [Hash] the optional parameters - # @return [Array<(FleetAgentVersionsResponse, Integer, Hash)>] FleetAgentVersionsResponse data, response status code and response headers - def list_fleet_agent_versions_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_fleet_agent_versions".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_fleet_agent_versions") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_fleet_agent_versions")) - end + # @return [Array<(FleetAgentVersionsV2Response, Integer, Hash)>] FleetAgentVersionsV2Response data, response status code and response headers + def list_fleet_agent_versions_v2_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_agent_versions ...' + @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_agent_versions_v2 ...' end # resource path - local_var_path = '/api/unstable/fleet/agent_versions' + local_var_path = '/api/v2/fleet/agent_versions' # query parameters query_params = opts[:query_params] || {} @@ -905,13 +843,13 @@ def list_fleet_agent_versions_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'FleetAgentVersionsResponse' + return_type = opts[:debug_return_type] || 'FleetAgentVersionsV2Response' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :list_fleet_agent_versions, + :operation => :list_fleet_agent_versions_v2, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -923,49 +861,51 @@ def list_fleet_agent_versions_with_http_info(opts = {}) 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_agent_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FleetAutomationAPI#list_fleet_agent_versions_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List all deployments. # - # @see #list_fleet_deployments_with_http_info - def list_fleet_deployments(opts = {}) - data, _status_code, _headers = list_fleet_deployments_with_http_info(opts) + # @see #list_fleet_deployments_v2_with_http_info + def list_fleet_deployments_v2(opts = {}) + data, _status_code, _headers = list_fleet_deployments_v2_with_http_info(opts) data end # List all deployments. # - # Retrieve a list of all deployments for fleet automation. - # Use the `page_size` and `page_offset` parameters to paginate results. + # Retrieve a paginated list of all deployments for fleet automation. # # @param opts [Hash] the optional parameters # @option opts [Integer] :page_size Number of deployments to return per page. Maximum value is 100. - # @option opts [Integer] :page_offset Index of the first deployment to return. Use this with `page_size` to paginate through results. - # @return [Array<(FleetDeploymentsResponse, Integer, Hash)>] FleetDeploymentsResponse data, response status code and response headers - def list_fleet_deployments_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_fleet_deployments".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_fleet_deployments") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_fleet_deployments")) - end + # @option opts [Integer] :page_number Page number for pagination, starting at 0. + # @option opts [String] :sort Field to sort results by (for example, `start_date`). Must be a supported field name; unsupported values return a 400 error. + # @option opts [Boolean] :ascending Set to `true` to sort in ascending order. This setting has no effect unless `sort` is also set. Defaults to descending order. + # @option opts [String] :filter Query used to filter deployments. Uses the Datadog query syntax. Filtering on an unsupported field returns a 400 error. For example: - `status:failed` or `status:done_with_errors`: deployments that need investigation. - `status:running`: deployments currently in flight. - `update_type:update_package` or `update_type:update_config_operations`: deployments of a given type. + # @return [Array<(FleetDeploymentsV2Response, Integer, Hash)>] FleetDeploymentsV2Response data, response status code and response headers + def list_fleet_deployments_v2_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_deployments ...' + @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_deployments_v2 ...' 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_deployments, must be smaller than or equal to 100.' + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling FleetAutomationAPI.list_fleet_deployments_v2, must be smaller than or equal to 100.' + end + if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0 + fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling FleetAutomationAPI.list_fleet_deployments_v2, must be greater than or equal to 0.' end # resource path - local_var_path = '/api/unstable/fleet/deployments' + local_var_path = '/api/v2/fleet/deployments' # query parameters query_params = opts[:query_params] || {} query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'page_offset'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + query_params[:'page_number'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'ascending'] = opts[:'ascending'] if !opts[:'ascending'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? # header parameters header_params = opts[:header_params] || {} @@ -979,13 +919,13 @@ def list_fleet_deployments_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'FleetDeploymentsResponse' + return_type = opts[:debug_return_type] || 'FleetDeploymentsV2Response' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :list_fleet_deployments, + :operation => :list_fleet_deployments_v2, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -997,42 +937,35 @@ def list_fleet_deployments_with_http_info(opts = {}) 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_deployments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FleetAutomationAPI#list_fleet_deployments_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List all schedules. # - # @see #list_fleet_schedules_with_http_info - def list_fleet_schedules(opts = {}) - data, _status_code, _headers = list_fleet_schedules_with_http_info(opts) + # @see #list_fleet_schedules_v2_with_http_info + def list_fleet_schedules_v2(opts = {}) + data, _status_code, _headers = list_fleet_schedules_v2_with_http_info(opts) data end # List all schedules. # - # Retrieve a list of all schedules for automated fleet deployments. + # Retrieve all upgrade schedules for the organization. # - # Schedules allow you to automate package upgrades by defining maintenance windows - # and recurrence rules. Each schedule automatically creates deployments based on its - # configuration. + # Schedules automate package upgrades by defining maintenance windows and recurrence rules. + # Each schedule automatically creates deployments based on its configuration. # # @param opts [Hash] the optional parameters - # @return [Array<(FleetSchedulesResponse, Integer, Hash)>] FleetSchedulesResponse data, response status code and response headers - def list_fleet_schedules_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_fleet_schedules".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_fleet_schedules") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_fleet_schedules")) - end + # @return [Array<(FleetSchedulesV2Response, Integer, Hash)>] FleetSchedulesV2Response data, response status code and response headers + def list_fleet_schedules_v2_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_schedules ...' + @api_client.config.logger.debug 'Calling API: FleetAutomationAPI.list_fleet_schedules_v2 ...' end # resource path - local_var_path = '/api/unstable/fleet/schedules' + local_var_path = '/api/v2/fleet/schedules' # query parameters query_params = opts[:query_params] || {} @@ -1049,13 +982,13 @@ def list_fleet_schedules_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'FleetSchedulesResponse' + return_type = opts[:debug_return_type] || 'FleetSchedulesV2Response' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :list_fleet_schedules, + :operation => :list_fleet_schedules_v2, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1067,7 +1000,7 @@ def list_fleet_schedules_with_http_info(opts = {}) 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_schedules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: FleetAutomationAPI#list_fleet_schedules_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end diff --git a/lib/datadog_api_client/v2/models/fleet_agent_configuration_files_v2.rb b/lib/datadog_api_client/v2/models/fleet_agent_configuration_files_v2.rb new file mode 100644 index 000000000000..c54e893c19c7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agent_configuration_files_v2.rb @@ -0,0 +1,167 @@ +=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 details for an agent, organized by configuration layer. + class FleetAgentConfigurationFilesV2 + include BaseGenericModel + + # Configuration information organized by layers. + attr_accessor :agent_configuration + + # Configuration information organized by layers. + attr_accessor :application_monitoring_configuration + + # The unique agent key identifier. + attr_accessor :datadog_agent_key + + # Configuration for OpenTelemetry collectors associated with the agent. Present only when the agent has associated OpenTelemetry collectors. + attr_accessor :otel_collectors_configuration + + # Configuration information organized by layers. + attr_accessor :security_agent_configuration + + # Configuration information organized by layers. + attr_accessor :system_probe_configuration + + # The configuration version. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'agent_configuration' => :'agent_configuration', + :'application_monitoring_configuration' => :'application_monitoring_configuration', + :'datadog_agent_key' => :'datadog_agent_key', + :'otel_collectors_configuration' => :'otel_collectors_configuration', + :'security_agent_configuration' => :'security_agent_configuration', + :'system_probe_configuration' => :'system_probe_configuration', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'agent_configuration' => :'FleetConfigurationLayer', + :'application_monitoring_configuration' => :'FleetConfigurationLayer', + :'datadog_agent_key' => :'String', + :'otel_collectors_configuration' => :'Array', + :'security_agent_configuration' => :'FleetConfigurationLayer', + :'system_probe_configuration' => :'FleetConfigurationLayer', + :'version' => :'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::FleetAgentConfigurationFilesV2` 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_configuration') + self.agent_configuration = attributes[:'agent_configuration'] + end + + if attributes.key?(:'application_monitoring_configuration') + self.application_monitoring_configuration = attributes[:'application_monitoring_configuration'] + end + + if attributes.key?(:'datadog_agent_key') + self.datadog_agent_key = attributes[:'datadog_agent_key'] + end + + if attributes.key?(:'otel_collectors_configuration') + if (value = attributes[:'otel_collectors_configuration']).is_a?(Array) + self.otel_collectors_configuration = value + end + end + + if attributes.key?(:'security_agent_configuration') + self.security_agent_configuration = attributes[:'security_agent_configuration'] + end + + if attributes.key?(:'system_probe_configuration') + self.system_probe_configuration = attributes[:'system_probe_configuration'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + 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_configuration == o.agent_configuration && + application_monitoring_configuration == o.application_monitoring_configuration && + datadog_agent_key == o.datadog_agent_key && + otel_collectors_configuration == o.otel_collectors_configuration && + security_agent_configuration == o.security_agent_configuration && + system_probe_configuration == o.system_probe_configuration && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [agent_configuration, application_monitoring_configuration, datadog_agent_key, otel_collectors_configuration, security_agent_configuration, system_probe_configuration, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_agent_detail_v2.rb b/lib/datadog_api_client/v2/models/fleet_agent_detail_v2.rb new file mode 100644 index 000000000000..d9692b05aa63 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agent_detail_v2.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 + # Detailed information about a specific Datadog Agent. + class FleetAgentDetailV2 + include BaseGenericModel + + # Attributes for the v2 agent detail response. + attr_reader :attributes + + # The unique agent key identifier. + attr_reader :id + + # The type of the agent 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' => :'FleetAgentDetailV2Attributes', + :'id' => :'String', + :'type' => :'FleetAgentV2ResourceType' + } + 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::FleetAgentDetailV2` 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_detail_v2_attributes.rb similarity index 75% rename from lib/datadog_api_client/v2/models/fleet_agent_info_attributes.rb rename to lib/datadog_api_client/v2/models/fleet_agent_detail_v2_attributes.rb index e5c8f96120de..e3fb080c2700 100644 --- a/lib/datadog_api_client/v2/models/fleet_agent_info_attributes.rb +++ b/lib/datadog_api_client/v2/models/fleet_agent_detail_v2_attributes.rb @@ -17,19 +17,16 @@ require 'time' module DatadogAPIClient::V2 - # Attributes for agent information. - class FleetAgentInfoAttributes + # Attributes for the v2 agent detail response. + class FleetAgentDetailV2Attributes include BaseGenericModel # Detailed information about a Datadog Agent. - attr_accessor :agent_infos + attr_reader :agent_infos - # Configuration information organized by layers. + # Configuration details for an agent, organized by configuration layer. attr_accessor :configuration_files - # List of detected integrations. - attr_accessor :detected_integrations - # Integrations organized by their status. attr_accessor :integrations @@ -41,7 +38,6 @@ def self.attribute_map { :'agent_infos' => :'agent_infos', :'configuration_files' => :'configuration_files', - :'detected_integrations' => :'detected_integrations', :'integrations' => :'integrations' } end @@ -50,10 +46,9 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'agent_infos' => :'FleetAgentInfoDetails', - :'configuration_files' => :'FleetConfigurationLayer', - :'detected_integrations' => :'Array', - :'integrations' => :'FleetIntegrationsByStatus' + :'agent_infos' => :'FleetAgentInfoDetailsV2', + :'configuration_files' => :'FleetAgentConfigurationFilesV2', + :'integrations' => :'FleetIntegrationsByStatusV2' } end @@ -62,7 +57,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentInfoAttributes` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentDetailV2Attributes` initialize method" end self.additional_properties = {} @@ -83,17 +78,29 @@ def initialize(attributes = {}) 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 + # 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 @agent_infos.nil? + true + end + + # Custom attribute writer method with validation + # @param agent_infos [Object] Object to be assigned + # @!visibility private + def agent_infos=(agent_infos) + if agent_infos.nil? + fail ArgumentError, 'invalid value for "agent_infos", agent_infos cannot be nil.' + end + @agent_infos = agent_infos + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private @@ -122,7 +129,6 @@ def ==(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 @@ -131,7 +137,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [agent_infos, configuration_files, detected_integrations, integrations, additional_properties].hash + [agent_infos, configuration_files, integrations, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_configure_create_request.rb b/lib/datadog_api_client/v2/models/fleet_agent_detail_v2_response.rb similarity index 91% rename from lib/datadog_api_client/v2/models/fleet_deployment_configure_create_request.rb rename to lib/datadog_api_client/v2/models/fleet_agent_detail_v2_response.rb index 1037ed3fbe93..0d8940b46412 100644 --- a/lib/datadog_api_client/v2/models/fleet_deployment_configure_create_request.rb +++ b/lib/datadog_api_client/v2/models/fleet_agent_detail_v2_response.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Request payload for creating a new configuration deployment. - class FleetDeploymentConfigureCreateRequest + # Response containing detailed information about a specific Datadog Agent. + class FleetAgentDetailV2Response include BaseGenericModel - # Data for creating a new configuration deployment. + # Detailed information about a specific Datadog Agent. attr_reader :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'FleetDeploymentConfigureCreate' + :'data' => :'FleetAgentDetailV2' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentConfigureCreateRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentDetailV2Response` initialize method" end self.additional_properties = {} 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_v2.rb similarity index 67% rename from lib/datadog_api_client/v2/models/fleet_agent_info_details.rb rename to lib/datadog_api_client/v2/models/fleet_agent_info_details_v2.rb index 6fbccab5c66f..2d5db59e9a06 100644 --- a/lib/datadog_api_client/v2/models/fleet_agent_info_details.rb +++ b/lib/datadog_api_client/v2/models/fleet_agent_info_details_v2.rb @@ -18,9 +18,12 @@ module DatadogAPIClient::V2 # Detailed information about a Datadog Agent. - class FleetAgentInfoDetails + class FleetAgentInfoDetailsV2 include BaseGenericModel + # The currently active agent in the high-availability group. + attr_accessor :active_ha_agent + # The Datadog Agent version. attr_accessor :agent_version @@ -36,9 +39,21 @@ class FleetAgentInfoDetails # Kubernetes cluster name (if applicable). attr_accessor :cluster_name + # The configuration identifier applied to the agent. + attr_accessor :config_id + # The unique agent key identifier. attr_accessor :datadog_agent_key + # The Datadog data center the agent reports to. + attr_accessor :datadog_data_center + + # The ECS Fargate cluster name, if the agent runs in an ECS Fargate environment. + attr_accessor :ecs_fargate_cluster_name + + # The ECS Fargate task ARN, if the agent runs in an ECS Fargate environment. + attr_accessor :ecs_fargate_task_arn + # Datadog products enabled on the agent. attr_accessor :enabled_products @@ -48,6 +63,12 @@ class FleetAgentInfoDetails # Timestamp when the agent was first seen. attr_accessor :first_seen_at + # Hosts participating in the agent's high-availability group. + attr_accessor :ha_agent_hosts + + # The high-availability state of the agent. + attr_accessor :ha_agent_state + # The hostname of the agent. attr_accessor :hostname @@ -75,6 +96,12 @@ class FleetAgentInfoDetails # The operating system version. attr_accessor :os_version + # OpenTelemetry collector deployment types associated with the agent. + attr_accessor :otel_collector_deployment_types + + # OpenTelemetry collector distributions associated with the agent. + attr_accessor :otel_collector_distributions + # OpenTelemetry collector version (if applicable). attr_accessor :otel_collector_version @@ -84,9 +111,15 @@ class FleetAgentInfoDetails # OpenTelemetry collectors associated with the agent (if applicable). attr_accessor :otel_collectors + # OpenTelemetry resource attributes reported by the agent. + attr_accessor :otel_resource_attributes + # Kubernetes pod name (if applicable). attr_accessor :pod_name + # The preferred active agent in the high-availability group. + attr_accessor :preferred_ha_active_agent + # The Python version used by the agent. attr_accessor :python_version @@ -102,6 +135,9 @@ class FleetAgentInfoDetails # Services running on the agent. attr_accessor :services + # Whether the agent supports remote agent upgrade. + attr_accessor :support_agent_upgrade + # Tags associated with the agent. attr_accessor :tags @@ -114,15 +150,22 @@ class FleetAgentInfoDetails # @!visibility private def self.attribute_map { + :'active_ha_agent' => :'active_ha_agent', :'agent_version' => :'agent_version', :'api_key_name' => :'api_key_name', :'api_key_uuid' => :'api_key_uuid', :'cloud_provider' => :'cloud_provider', :'cluster_name' => :'cluster_name', + :'config_id' => :'config_id', :'datadog_agent_key' => :'datadog_agent_key', + :'datadog_data_center' => :'datadog_data_center', + :'ecs_fargate_cluster_name' => :'ecs_fargate_cluster_name', + :'ecs_fargate_task_arn' => :'ecs_fargate_task_arn', :'enabled_products' => :'enabled_products', :'env' => :'env', :'first_seen_at' => :'first_seen_at', + :'ha_agent_hosts' => :'ha_agent_hosts', + :'ha_agent_state' => :'ha_agent_state', :'hostname' => :'hostname', :'hostname_aliases' => :'hostname_aliases', :'install_method_installer_version' => :'install_method_installer_version', @@ -132,15 +175,20 @@ def self.attribute_map :'last_restart_at' => :'last_restart_at', :'os' => :'os', :'os_version' => :'os_version', + :'otel_collector_deployment_types' => :'otel_collector_deployment_types', + :'otel_collector_distributions' => :'otel_collector_distributions', :'otel_collector_version' => :'otel_collector_version', :'otel_collector_versions' => :'otel_collector_versions', :'otel_collectors' => :'otel_collectors', + :'otel_resource_attributes' => :'otel_resource_attributes', :'pod_name' => :'pod_name', + :'preferred_ha_active_agent' => :'preferred_ha_active_agent', :'python_version' => :'python_version', :'region' => :'region', :'remote_agent_management' => :'remote_agent_management', :'remote_config_status' => :'remote_config_status', :'services' => :'services', + :'support_agent_upgrade' => :'support_agent_upgrade', :'tags' => :'tags', :'team' => :'team' } @@ -150,15 +198,22 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'active_ha_agent' => :'String', :'agent_version' => :'String', :'api_key_name' => :'String', :'api_key_uuid' => :'String', :'cloud_provider' => :'String', :'cluster_name' => :'String', + :'config_id' => :'String', :'datadog_agent_key' => :'String', + :'datadog_data_center' => :'String', + :'ecs_fargate_cluster_name' => :'String', + :'ecs_fargate_task_arn' => :'String', :'enabled_products' => :'Array', :'env' => :'Array', :'first_seen_at' => :'Integer', + :'ha_agent_hosts' => :'Array', + :'ha_agent_state' => :'String', :'hostname' => :'String', :'hostname_aliases' => :'Array', :'install_method_installer_version' => :'String', @@ -168,15 +223,20 @@ def self.openapi_types :'last_restart_at' => :'Integer', :'os' => :'String', :'os_version' => :'String', + :'otel_collector_deployment_types' => :'Array', + :'otel_collector_distributions' => :'Array', :'otel_collector_version' => :'String', :'otel_collector_versions' => :'Array', :'otel_collectors' => :'Array>', + :'otel_resource_attributes' => :'Array', :'pod_name' => :'String', + :'preferred_ha_active_agent' => :'String', :'python_version' => :'String', :'region' => :'Array', :'remote_agent_management' => :'String', :'remote_config_status' => :'String', :'services' => :'Array', + :'support_agent_upgrade' => :'Boolean', :'tags' => :'Array', :'team' => :'String' } @@ -187,7 +247,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentInfoDetails` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentInfoDetailsV2` initialize method" end self.additional_properties = {} @@ -200,6 +260,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'active_ha_agent') + self.active_ha_agent = attributes[:'active_ha_agent'] + end + if attributes.key?(:'agent_version') self.agent_version = attributes[:'agent_version'] end @@ -220,10 +284,26 @@ def initialize(attributes = {}) self.cluster_name = attributes[:'cluster_name'] end + if attributes.key?(:'config_id') + self.config_id = attributes[:'config_id'] + end + if attributes.key?(:'datadog_agent_key') self.datadog_agent_key = attributes[:'datadog_agent_key'] end + if attributes.key?(:'datadog_data_center') + self.datadog_data_center = attributes[:'datadog_data_center'] + end + + if attributes.key?(:'ecs_fargate_cluster_name') + self.ecs_fargate_cluster_name = attributes[:'ecs_fargate_cluster_name'] + end + + if attributes.key?(:'ecs_fargate_task_arn') + self.ecs_fargate_task_arn = attributes[:'ecs_fargate_task_arn'] + end + if attributes.key?(:'enabled_products') if (value = attributes[:'enabled_products']).is_a?(Array) self.enabled_products = value @@ -240,6 +320,16 @@ def initialize(attributes = {}) self.first_seen_at = attributes[:'first_seen_at'] end + if attributes.key?(:'ha_agent_hosts') + if (value = attributes[:'ha_agent_hosts']).is_a?(Array) + self.ha_agent_hosts = value + end + end + + if attributes.key?(:'ha_agent_state') + self.ha_agent_state = attributes[:'ha_agent_state'] + end + if attributes.key?(:'hostname') self.hostname = attributes[:'hostname'] end @@ -280,6 +370,18 @@ def initialize(attributes = {}) self.os_version = attributes[:'os_version'] end + if attributes.key?(:'otel_collector_deployment_types') + if (value = attributes[:'otel_collector_deployment_types']).is_a?(Array) + self.otel_collector_deployment_types = value + end + end + + if attributes.key?(:'otel_collector_distributions') + if (value = attributes[:'otel_collector_distributions']).is_a?(Array) + self.otel_collector_distributions = value + end + end + if attributes.key?(:'otel_collector_version') self.otel_collector_version = attributes[:'otel_collector_version'] end @@ -296,10 +398,20 @@ def initialize(attributes = {}) end end + if attributes.key?(:'otel_resource_attributes') + if (value = attributes[:'otel_resource_attributes']).is_a?(Array) + self.otel_resource_attributes = value + end + end + if attributes.key?(:'pod_name') self.pod_name = attributes[:'pod_name'] end + if attributes.key?(:'preferred_ha_active_agent') + self.preferred_ha_active_agent = attributes[:'preferred_ha_active_agent'] + end + if attributes.key?(:'python_version') self.python_version = attributes[:'python_version'] end @@ -324,6 +436,10 @@ def initialize(attributes = {}) end end + if attributes.key?(:'support_agent_upgrade') + self.support_agent_upgrade = attributes[:'support_agent_upgrade'] + end + if attributes.key?(:'tags') if (value = attributes[:'tags']).is_a?(Array) self.tags = value @@ -361,15 +477,22 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + active_ha_agent == o.active_ha_agent && 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 && + config_id == o.config_id && datadog_agent_key == o.datadog_agent_key && + datadog_data_center == o.datadog_data_center && + ecs_fargate_cluster_name == o.ecs_fargate_cluster_name && + ecs_fargate_task_arn == o.ecs_fargate_task_arn && enabled_products == o.enabled_products && env == o.env && first_seen_at == o.first_seen_at && + ha_agent_hosts == o.ha_agent_hosts && + ha_agent_state == o.ha_agent_state && hostname == o.hostname && hostname_aliases == o.hostname_aliases && install_method_installer_version == o.install_method_installer_version && @@ -379,15 +502,20 @@ def ==(o) last_restart_at == o.last_restart_at && os == o.os && os_version == o.os_version && + otel_collector_deployment_types == o.otel_collector_deployment_types && + otel_collector_distributions == o.otel_collector_distributions && otel_collector_version == o.otel_collector_version && otel_collector_versions == o.otel_collector_versions && otel_collectors == o.otel_collectors && + otel_resource_attributes == o.otel_resource_attributes && pod_name == o.pod_name && + preferred_ha_active_agent == o.preferred_ha_active_agent && 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 && + support_agent_upgrade == o.support_agent_upgrade && tags == o.tags && team == o.team && additional_properties == o.additional_properties @@ -397,7 +525,7 @@ def ==(o) # @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 + [active_ha_agent, agent_version, api_key_name, api_key_uuid, cloud_provider, cluster_name, config_id, datadog_agent_key, datadog_data_center, ecs_fargate_cluster_name, ecs_fargate_task_arn, enabled_products, env, first_seen_at, ha_agent_hosts, ha_agent_state, 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_deployment_types, otel_collector_distributions, otel_collector_version, otel_collector_versions, otel_collectors, otel_resource_attributes, pod_name, preferred_ha_active_agent, python_version, region, remote_agent_management, remote_config_status, services, support_agent_upgrade, tags, team, 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_v2.rb similarity index 92% rename from lib/datadog_api_client/v2/models/fleet_agent_info.rb rename to lib/datadog_api_client/v2/models/fleet_agent_v2.rb index beaf24d2acda..3f32f35976ca 100644 --- a/lib/datadog_api_client/v2/models/fleet_agent_info.rb +++ b/lib/datadog_api_client/v2/models/fleet_agent_v2.rb @@ -17,17 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # Represents detailed information about a specific Datadog Agent. - class FleetAgentInfo + # A Datadog Agent resource in the v2 list response. + class FleetAgentV2 include BaseGenericModel - # Attributes for agent information. + # Attributes of a Datadog Agent in the v2 list response. attr_reader :attributes # The unique agent key identifier. attr_reader :id - # The type of Agent info resource. + # The type of the agent resource. attr_reader :type attr_accessor :additional_properties @@ -46,9 +46,9 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'FleetAgentInfoAttributes', + :'attributes' => :'FleetAgentV2Attributes', :'id' => :'String', - :'type' => :'FleetAgentInfoResourceType' + :'type' => :'FleetAgentV2ResourceType' } end @@ -57,7 +57,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentInfo` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentV2` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/fleet_agent_attributes.rb b/lib/datadog_api_client/v2/models/fleet_agent_v2_attributes.rb similarity index 58% rename from lib/datadog_api_client/v2/models/fleet_agent_attributes.rb rename to lib/datadog_api_client/v2/models/fleet_agent_v2_attributes.rb index 064e9ec7c131..3f9a82ba6f2b 100644 --- a/lib/datadog_api_client/v2/models/fleet_agent_attributes.rb +++ b/lib/datadog_api_client/v2/models/fleet_agent_v2_attributes.rb @@ -17,74 +17,101 @@ require 'time' module DatadogAPIClient::V2 - # Attributes of a Datadog Agent in the list view. - class FleetAgentAttributes + # Attributes of a Datadog Agent in the v2 list response. + class FleetAgentV2Attributes include BaseGenericModel # The Datadog Agent version. attr_accessor :agent_version - # The API key name (if available and not redacted). + # The name of the API key used by the agent, if available and not redacted. attr_accessor :api_key_name - # The API key UUID. + # The UUID of the API key used by the agent. attr_accessor :api_key_uuid # The cloud provider where the agent is running. attr_accessor :cloud_provider - # Kubernetes cluster name (if applicable). + # The Kubernetes cluster name, if the agent runs in a cluster. attr_accessor :cluster_name - # The unique agent key identifier. - attr_accessor :datadog_agent_key + # The Datadog data center the agent reports to. + attr_accessor :datadog_data_center + + # The ECS Fargate cluster name, if the agent runs in an ECS Fargate environment. + attr_accessor :ecs_fargate_cluster_name + + # The ECS Fargate task ARN, if the agent runs in an ECS Fargate environment. + attr_accessor :ecs_fargate_task_arn # Datadog products enabled on the agent. attr_accessor :enabled_products # Environments the agent is reporting from. - attr_accessor :envs + attr_accessor :env - # Timestamp when the agent was first seen. + # Unix timestamp when the agent was first seen. attr_accessor :first_seen_at + # Identifiers of fleet policies applied to the agent. + attr_accessor :fleet_policies + # The hostname of the agent. attr_accessor :hostname - # IP addresses of the agent. + # Number of instrumentation errors on the agent. Absent from the response when the count is zero. + attr_accessor :instrumentation_error_counts + + # The single-step instrumentation status of the Agent. + attr_accessor :instrumentation_status + + # Names of integrations configured on the agent. + attr_accessor :integrations + + # IP addresses of the agent host. attr_accessor :ip_addresses - # Whether single-step instrumentation is enabled. + # Whether single-step instrumentation is enabled on the agent. attr_accessor :is_single_step_instrumentation_enabled - # Timestamp of the last agent restart. + # Unix timestamp of the last agent restart. attr_accessor :last_restart_at - # The operating system. + # The operating system of the host. attr_accessor :os - # OpenTelemetry collector version (if applicable). + # OpenTelemetry collector deployment types associated with the agent. + attr_accessor :otel_collector_deployment_types + + # OpenTelemetry collector distributions associated with the agent. + attr_accessor :otel_collector_distributions + + # The primary OpenTelemetry collector version, if applicable. attr_accessor :otel_collector_version - # List of OpenTelemetry collector versions (if applicable). + # All OpenTelemetry collector versions associated with the agent. attr_accessor :otel_collector_versions - # Kubernetes pod name (if applicable). + # OpenTelemetry resource attributes reported by the agent. + attr_accessor :otel_resource_attributes + + # The Kubernetes pod name, if the agent runs as a pod. attr_accessor :pod_name - # Remote agent management status. + # The remote agent management status. attr_accessor :remote_agent_management - # Remote configuration status. + # The remote configuration connection status of the agent. attr_accessor :remote_config_status # Services running on the agent. attr_accessor :services - # Tags associated with the agent. + # Tags associated with the agent. Returned as an empty array when the agent has no tags. attr_accessor :tags - # Team associated with the agent. + # The team associated with the agent. attr_accessor :team attr_accessor :additional_properties @@ -98,17 +125,26 @@ def self.attribute_map :'api_key_uuid' => :'api_key_uuid', :'cloud_provider' => :'cloud_provider', :'cluster_name' => :'cluster_name', - :'datadog_agent_key' => :'datadog_agent_key', + :'datadog_data_center' => :'datadog_data_center', + :'ecs_fargate_cluster_name' => :'ecs_fargate_cluster_name', + :'ecs_fargate_task_arn' => :'ecs_fargate_task_arn', :'enabled_products' => :'enabled_products', - :'envs' => :'envs', + :'env' => :'env', :'first_seen_at' => :'first_seen_at', + :'fleet_policies' => :'fleet_policies', :'hostname' => :'hostname', + :'instrumentation_error_counts' => :'instrumentation_error_counts', + :'instrumentation_status' => :'instrumentation_status', + :'integrations' => :'integrations', :'ip_addresses' => :'ip_addresses', :'is_single_step_instrumentation_enabled' => :'is_single_step_instrumentation_enabled', :'last_restart_at' => :'last_restart_at', :'os' => :'os', + :'otel_collector_deployment_types' => :'otel_collector_deployment_types', + :'otel_collector_distributions' => :'otel_collector_distributions', :'otel_collector_version' => :'otel_collector_version', :'otel_collector_versions' => :'otel_collector_versions', + :'otel_resource_attributes' => :'otel_resource_attributes', :'pod_name' => :'pod_name', :'remote_agent_management' => :'remote_agent_management', :'remote_config_status' => :'remote_config_status', @@ -127,17 +163,26 @@ def self.openapi_types :'api_key_uuid' => :'String', :'cloud_provider' => :'String', :'cluster_name' => :'String', - :'datadog_agent_key' => :'String', + :'datadog_data_center' => :'String', + :'ecs_fargate_cluster_name' => :'String', + :'ecs_fargate_task_arn' => :'String', :'enabled_products' => :'Array', - :'envs' => :'Array', + :'env' => :'Array', :'first_seen_at' => :'Integer', + :'fleet_policies' => :'Array', :'hostname' => :'String', + :'instrumentation_error_counts' => :'Integer', + :'instrumentation_status' => :'FleetAgentV2AttributesInstrumentationStatus', + :'integrations' => :'Array', :'ip_addresses' => :'Array', :'is_single_step_instrumentation_enabled' => :'Boolean', :'last_restart_at' => :'Integer', :'os' => :'String', + :'otel_collector_deployment_types' => :'Array', + :'otel_collector_distributions' => :'Array', :'otel_collector_version' => :'String', :'otel_collector_versions' => :'Array', + :'otel_resource_attributes' => :'Array', :'pod_name' => :'String', :'remote_agent_management' => :'String', :'remote_config_status' => :'String', @@ -152,7 +197,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentAttributes` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentV2Attributes` initialize method" end self.additional_properties = {} @@ -185,8 +230,16 @@ def initialize(attributes = {}) self.cluster_name = attributes[:'cluster_name'] end - if attributes.key?(:'datadog_agent_key') - self.datadog_agent_key = attributes[:'datadog_agent_key'] + if attributes.key?(:'datadog_data_center') + self.datadog_data_center = attributes[:'datadog_data_center'] + end + + if attributes.key?(:'ecs_fargate_cluster_name') + self.ecs_fargate_cluster_name = attributes[:'ecs_fargate_cluster_name'] + end + + if attributes.key?(:'ecs_fargate_task_arn') + self.ecs_fargate_task_arn = attributes[:'ecs_fargate_task_arn'] end if attributes.key?(:'enabled_products') @@ -195,9 +248,9 @@ def initialize(attributes = {}) end end - if attributes.key?(:'envs') - if (value = attributes[:'envs']).is_a?(Array) - self.envs = value + if attributes.key?(:'env') + if (value = attributes[:'env']).is_a?(Array) + self.env = value end end @@ -205,10 +258,30 @@ def initialize(attributes = {}) self.first_seen_at = attributes[:'first_seen_at'] end + if attributes.key?(:'fleet_policies') + if (value = attributes[:'fleet_policies']).is_a?(Array) + self.fleet_policies = value + end + end + if attributes.key?(:'hostname') self.hostname = attributes[:'hostname'] end + if attributes.key?(:'instrumentation_error_counts') + self.instrumentation_error_counts = attributes[:'instrumentation_error_counts'] + end + + if attributes.key?(:'instrumentation_status') + self.instrumentation_status = attributes[:'instrumentation_status'] + end + + if attributes.key?(:'integrations') + if (value = attributes[:'integrations']).is_a?(Array) + self.integrations = value + end + end + if attributes.key?(:'ip_addresses') if (value = attributes[:'ip_addresses']).is_a?(Array) self.ip_addresses = value @@ -227,6 +300,18 @@ def initialize(attributes = {}) self.os = attributes[:'os'] end + if attributes.key?(:'otel_collector_deployment_types') + if (value = attributes[:'otel_collector_deployment_types']).is_a?(Array) + self.otel_collector_deployment_types = value + end + end + + if attributes.key?(:'otel_collector_distributions') + if (value = attributes[:'otel_collector_distributions']).is_a?(Array) + self.otel_collector_distributions = value + end + end + if attributes.key?(:'otel_collector_version') self.otel_collector_version = attributes[:'otel_collector_version'] end @@ -237,6 +322,12 @@ def initialize(attributes = {}) end end + if attributes.key?(:'otel_resource_attributes') + if (value = attributes[:'otel_resource_attributes']).is_a?(Array) + self.otel_resource_attributes = value + end + end + if attributes.key?(:'pod_name') self.pod_name = attributes[:'pod_name'] end @@ -297,17 +388,26 @@ def ==(o) api_key_uuid == o.api_key_uuid && cloud_provider == o.cloud_provider && cluster_name == o.cluster_name && - datadog_agent_key == o.datadog_agent_key && + datadog_data_center == o.datadog_data_center && + ecs_fargate_cluster_name == o.ecs_fargate_cluster_name && + ecs_fargate_task_arn == o.ecs_fargate_task_arn && enabled_products == o.enabled_products && - envs == o.envs && + env == o.env && first_seen_at == o.first_seen_at && + fleet_policies == o.fleet_policies && hostname == o.hostname && + instrumentation_error_counts == o.instrumentation_error_counts && + instrumentation_status == o.instrumentation_status && + integrations == o.integrations && 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_deployment_types == o.otel_collector_deployment_types && + otel_collector_distributions == o.otel_collector_distributions && otel_collector_version == o.otel_collector_version && otel_collector_versions == o.otel_collector_versions && + otel_resource_attributes == o.otel_resource_attributes && pod_name == o.pod_name && remote_agent_management == o.remote_agent_management && remote_config_status == o.remote_config_status && @@ -321,7 +421,7 @@ def ==(o) # @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 + [agent_version, api_key_name, api_key_uuid, cloud_provider, cluster_name, datadog_data_center, ecs_fargate_cluster_name, ecs_fargate_task_arn, enabled_products, env, first_seen_at, fleet_policies, hostname, instrumentation_error_counts, instrumentation_status, integrations, ip_addresses, is_single_step_instrumentation_enabled, last_restart_at, os, otel_collector_deployment_types, otel_collector_distributions, otel_collector_version, otel_collector_versions, otel_resource_attributes, 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_v2_attributes_instrumentation_status.rb b/lib/datadog_api_client/v2/models/fleet_agent_v2_attributes_instrumentation_status.rb new file mode 100644 index 000000000000..c5f1f1954a5d --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agent_v2_attributes_instrumentation_status.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The single-step instrumentation status of the Agent. + class FleetAgentV2AttributesInstrumentationStatus + include BaseEnumModel + + SUCCESS = "success".freeze + FAILURE = "failure".freeze + 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_v2_resource_type.rb similarity index 82% rename from lib/datadog_api_client/v2/models/fleet_agent_info_resource_type.rb rename to lib/datadog_api_client/v2/models/fleet_agent_v2_resource_type.rb index 8c5c8add01a1..7eb2fc0e0719 100644 --- a/lib/datadog_api_client/v2/models/fleet_agent_info_resource_type.rb +++ b/lib/datadog_api_client/v2/models/fleet_agent_v2_resource_type.rb @@ -17,10 +17,10 @@ require 'time' module DatadogAPIClient::V2 - # The type of Agent info resource. - class FleetAgentInfoResourceType + # The type of the agent resource. + class FleetAgentV2ResourceType include BaseEnumModel - DATADOG_AGENT_KEY = "datadog_agent_key".freeze + AGENT = "agent".freeze end end diff --git a/lib/datadog_api_client/v2/models/fleet_agent_version.rb b/lib/datadog_api_client/v2/models/fleet_agent_version_v2.rb similarity index 83% rename from lib/datadog_api_client/v2/models/fleet_agent_version.rb rename to lib/datadog_api_client/v2/models/fleet_agent_version_v2.rb index f7bd5ed55df2..e37304f4487b 100644 --- a/lib/datadog_api_client/v2/models/fleet_agent_version.rb +++ b/lib/datadog_api_client/v2/models/fleet_agent_version_v2.rb @@ -17,17 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # Represents an available Datadog Agent version. - class FleetAgentVersion + # An available Datadog Agent version resource. + class FleetAgentVersionV2 include BaseGenericModel # Attributes of an available Datadog Agent version. - attr_accessor :attributes + attr_reader :attributes - # Unique identifier for the Agent version (same as version). + # The agent version string used as the unique identifier. attr_reader :id - # The type of Agent version resource. + # The type of the agent version resource. attr_reader :type attr_accessor :additional_properties @@ -46,9 +46,9 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'FleetAgentVersionAttributes', + :'attributes' => :'FleetAgentVersionV2Attributes', :'id' => :'String', - :'type' => :'FleetAgentVersionResourceType' + :'type' => :'FleetAgentVersionV2ResourceType' } end @@ -57,7 +57,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentVersion` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentVersionV2` initialize method" end self.additional_properties = {} @@ -87,11 +87,22 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? + return false if @attributes.nil? return false if @id.nil? return false if @type.nil? 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 diff --git a/lib/datadog_api_client/v2/models/fleet_agent_version_attributes.rb b/lib/datadog_api_client/v2/models/fleet_agent_version_v2_attributes.rb similarity index 94% rename from lib/datadog_api_client/v2/models/fleet_agent_version_attributes.rb rename to lib/datadog_api_client/v2/models/fleet_agent_version_v2_attributes.rb index 23e814f34414..1fd7fe2fd4e2 100644 --- a/lib/datadog_api_client/v2/models/fleet_agent_version_attributes.rb +++ b/lib/datadog_api_client/v2/models/fleet_agent_version_v2_attributes.rb @@ -18,10 +18,10 @@ module DatadogAPIClient::V2 # Attributes of an available Datadog Agent version. - class FleetAgentVersionAttributes + class FleetAgentVersionV2Attributes include BaseGenericModel - # The Agent version string. + # The agent version string. attr_accessor :version attr_accessor :additional_properties @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentVersionAttributes` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentVersionV2Attributes` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/fleet_agent_version_resource_type.rb b/lib/datadog_api_client/v2/models/fleet_agent_version_v2_resource_type.rb similarity index 88% rename from lib/datadog_api_client/v2/models/fleet_agent_version_resource_type.rb rename to lib/datadog_api_client/v2/models/fleet_agent_version_v2_resource_type.rb index fdf34b5b22e6..cf00adaff74b 100644 --- a/lib/datadog_api_client/v2/models/fleet_agent_version_resource_type.rb +++ b/lib/datadog_api_client/v2/models/fleet_agent_version_v2_resource_type.rb @@ -17,8 +17,8 @@ require 'time' module DatadogAPIClient::V2 - # The type of Agent version resource. - class FleetAgentVersionResourceType + # The type of the agent version resource. + class FleetAgentVersionV2ResourceType include BaseEnumModel AGENT_VERSION = "agent_version".freeze diff --git a/lib/datadog_api_client/v2/models/fleet_agents_response_data_attributes.rb b/lib/datadog_api_client/v2/models/fleet_agent_versions_v2_page.rb similarity index 81% rename from lib/datadog_api_client/v2/models/fleet_agents_response_data_attributes.rb rename to lib/datadog_api_client/v2/models/fleet_agent_versions_v2_page.rb index 75a0d6936feb..e887762b009c 100644 --- a/lib/datadog_api_client/v2/models/fleet_agents_response_data_attributes.rb +++ b/lib/datadog_api_client/v2/models/fleet_agent_versions_v2_page.rb @@ -17,12 +17,12 @@ require 'time' module DatadogAPIClient::V2 - # Attributes of the fleet agents response containing the list of agents. - class FleetAgentsResponseDataAttributes + # Pagination details for the v2 list of agent versions. + class FleetAgentVersionsV2Page include BaseGenericModel - # Array of agents matching the query criteria. - attr_accessor :agents + # Total number of available agent versions. + attr_accessor :total_count attr_accessor :additional_properties @@ -30,7 +30,7 @@ class FleetAgentsResponseDataAttributes # @!visibility private def self.attribute_map { - :'agents' => :'agents' + :'total_count' => :'total_count' } end @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'agents' => :'Array' + :'total_count' => :'Integer' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentsResponseDataAttributes` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentVersionsV2Page` initialize method" end self.additional_properties = {} @@ -60,10 +60,8 @@ def initialize(attributes = {}) end } - if attributes.key?(:'agents') - if (value = attributes[:'agents']).is_a?(Array) - self.agents = value - end + if attributes.key?(:'total_count') + self.total_count = attributes[:'total_count'] end end @@ -93,7 +91,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - agents == o.agents && + total_count == o.total_count && additional_properties == o.additional_properties end @@ -101,7 +99,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [agents, additional_properties].hash + [total_count, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/fleet_agent_versions_v2_response.rb b/lib/datadog_api_client/v2/models/fleet_agent_versions_v2_response.rb new file mode 100644 index 000000000000..67be56f4c00a --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agent_versions_v2_response.rb @@ -0,0 +1,135 @@ +=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 list of available Datadog Agent versions. + class FleetAgentVersionsV2Response + include BaseGenericModel + + # Array of available agent versions. + attr_reader :data + + # Metadata for the v2 list of agent versions. + 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' => :'Array', + :'meta' => :'FleetAgentVersionsV2ResponseMeta' + } + 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::FleetAgentVersionsV2Response` 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') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + 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_agent_versions_v2_response_meta.rb b/lib/datadog_api_client/v2/models/fleet_agent_versions_v2_response_meta.rb new file mode 100644 index 000000000000..d87884a8bd97 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agent_versions_v2_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 v2 list of agent versions. + class FleetAgentVersionsV2ResponseMeta + include BaseGenericModel + + # Pagination details for the v2 list of agent versions. + attr_accessor :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'FleetAgentVersionsV2Page' + } + 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::FleetAgentVersionsV2ResponseMeta` 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?(:'page') + self.page = attributes[:'page'] + 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 && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, 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_v2_page.rb similarity index 82% rename from lib/datadog_api_client/v2/models/fleet_agents_response_meta.rb rename to lib/datadog_api_client/v2/models/fleet_agents_v2_page.rb index 6c851508d894..5007dfe22d15 100644 --- a/lib/datadog_api_client/v2/models/fleet_agents_response_meta.rb +++ b/lib/datadog_api_client/v2/models/fleet_agents_v2_page.rb @@ -17,11 +17,14 @@ require 'time' module DatadogAPIClient::V2 - # Metadata for the list of agents response. - class FleetAgentsResponseMeta + # Pagination details for the v2 list of agents. + class FleetAgentsV2Page include BaseGenericModel - # Total number of agents matching the filter criteria across all pages. + # Total number of agents in the fleet, regardless of any filter. + attr_accessor :total_count + + # Total number of agents matching the current filter criteria. attr_accessor :total_filtered_count attr_accessor :additional_properties @@ -30,6 +33,7 @@ class FleetAgentsResponseMeta # @!visibility private def self.attribute_map { + :'total_count' => :'total_count', :'total_filtered_count' => :'total_filtered_count' } end @@ -38,6 +42,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'total_count' => :'Integer', :'total_filtered_count' => :'Integer' } end @@ -47,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentsResponseMeta` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentsV2Page` initialize method" end self.additional_properties = {} @@ -60,6 +65,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'total_count') + self.total_count = attributes[:'total_count'] + end + if attributes.key?(:'total_filtered_count') self.total_filtered_count = attributes[:'total_filtered_count'] end @@ -91,6 +100,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + total_count == o.total_count && total_filtered_count == o.total_filtered_count && additional_properties == o.additional_properties end @@ -99,7 +109,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [total_filtered_count, additional_properties].hash + [total_count, total_filtered_count, 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_v2_response.rb similarity index 89% rename from lib/datadog_api_client/v2/models/fleet_agents_response.rb rename to lib/datadog_api_client/v2/models/fleet_agents_v2_response.rb index c50eeaff805b..80e3aae375ac 100644 --- a/lib/datadog_api_client/v2/models/fleet_agents_response.rb +++ b/lib/datadog_api_client/v2/models/fleet_agents_v2_response.rb @@ -18,13 +18,13 @@ module DatadogAPIClient::V2 # Response containing a paginated list of Datadog Agents. - class FleetAgentsResponse + class FleetAgentsV2Response include BaseGenericModel - # The response data containing status and agents array. + # Array of agents matching the query criteria. attr_reader :data - # Metadata for the list of agents response. + # Metadata for the v2 list of agents, including pagination information. attr_accessor :meta attr_accessor :additional_properties @@ -42,8 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'FleetAgentsResponseData', - :'meta' => :'FleetAgentsResponseMeta' + :'data' => :'Array', + :'meta' => :'FleetAgentsV2ResponseMeta' } end @@ -52,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentsResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentsV2Response` initialize method" end self.additional_properties = {} @@ -66,7 +66,9 @@ def initialize(attributes = {}) } if attributes.key?(:'data') - self.data = attributes[:'data'] + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end end if attributes.key?(:'meta') diff --git a/lib/datadog_api_client/v2/models/fleet_agents_v2_response_meta.rb b/lib/datadog_api_client/v2/models/fleet_agents_v2_response_meta.rb new file mode 100644 index 000000000000..010c6fd5d070 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_agents_v2_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 v2 list of agents, including pagination information. + class FleetAgentsV2ResponseMeta + include BaseGenericModel + + # Pagination details for the v2 list of agents. + attr_accessor :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'FleetAgentsV2Page' + } + 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::FleetAgentsV2ResponseMeta` 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?(:'page') + self.page = attributes[:'page'] + 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 && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, 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_v2.rb similarity index 78% rename from lib/datadog_api_client/v2/models/fleet_configuration_file.rb rename to lib/datadog_api_client/v2/models/fleet_configuration_file_v2.rb index fbc8a99116c2..384060c39a89 100644 --- a/lib/datadog_api_client/v2/models/fleet_configuration_file.rb +++ b/lib/datadog_api_client/v2/models/fleet_configuration_file_v2.rb @@ -18,9 +18,12 @@ module DatadogAPIClient::V2 # A configuration file for an integration. - class FleetConfigurationFile + class FleetConfigurationFileV2 include BaseGenericModel + # Hash of the configuration file as seen by the agent. + attr_accessor :agent_hash + # The raw content of the configuration file. attr_accessor :file_content @@ -30,15 +33,20 @@ class FleetConfigurationFile # Name of the configuration file. attr_accessor :filename + # Hash of the configuration file as applied by fleet management. + attr_accessor :fleet_hash + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. # @!visibility private def self.attribute_map { + :'agent_hash' => :'agent_hash', :'file_content' => :'file_content', :'file_path' => :'file_path', - :'filename' => :'filename' + :'filename' => :'filename', + :'fleet_hash' => :'fleet_hash' } end @@ -46,9 +54,11 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'agent_hash' => :'String', :'file_content' => :'String', :'file_path' => :'String', - :'filename' => :'String' + :'filename' => :'String', + :'fleet_hash' => :'String' } end @@ -57,7 +67,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetConfigurationFile` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetConfigurationFileV2` initialize method" end self.additional_properties = {} @@ -70,6 +80,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'agent_hash') + self.agent_hash = attributes[:'agent_hash'] + end + if attributes.key?(:'file_content') self.file_content = attributes[:'file_content'] end @@ -81,6 +95,10 @@ def initialize(attributes = {}) if attributes.key?(:'filename') self.filename = attributes[:'filename'] end + + if attributes.key?(:'fleet_hash') + self.fleet_hash = attributes[:'fleet_hash'] + end end # Returns the object in the form of hash, with additionalProperties support. @@ -109,9 +127,11 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + agent_hash == o.agent_hash && file_content == o.file_content && file_path == o.file_path && filename == o.filename && + fleet_hash == o.fleet_hash && additional_properties == o.additional_properties end @@ -119,7 +139,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [file_content, file_path, filename, additional_properties].hash + [agent_hash, file_content, file_path, filename, fleet_hash, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_configure_attributes.rb b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_attributes.rb similarity index 69% rename from lib/datadog_api_client/v2/models/fleet_deployment_configure_attributes.rb rename to lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_attributes.rb index 63e34bd721ba..48b97cd3a620 100644 --- a/lib/datadog_api_client/v2/models/fleet_deployment_configure_attributes.rb +++ b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_attributes.rb @@ -17,15 +17,24 @@ require 'time' module DatadogAPIClient::V2 - # Attributes for creating a new configuration deployment. - class FleetDeploymentConfigureAttributes + # Attributes for creating a new v2 configuration deployment. + class FleetDeploymentConfigureV2Attributes include BaseGenericModel # Ordered list of configuration file operations to perform on the target hosts. attr_reader :config_operations + # Set to `true` to validate the configuration and resolve target hosts and packages + # without deploying anything. Returns a 200 with the validation result instead of + # creating and starting a real deployment. + attr_accessor :dry_run + # Query used to filter and select target hosts for the deployment. Uses the Datadog query syntax. - attr_accessor :filter_query + attr_reader :filter_query + + # List of packages and their target versions to additionally deploy alongside + # the configuration change. + attr_accessor :target_packages attr_accessor :additional_properties @@ -34,7 +43,9 @@ class FleetDeploymentConfigureAttributes def self.attribute_map { :'config_operations' => :'config_operations', - :'filter_query' => :'filter_query' + :'dry_run' => :'dry_run', + :'filter_query' => :'filter_query', + :'target_packages' => :'target_packages' } end @@ -43,7 +54,9 @@ def self.attribute_map def self.openapi_types { :'config_operations' => :'Array', - :'filter_query' => :'String' + :'dry_run' => :'Boolean', + :'filter_query' => :'String', + :'target_packages' => :'Array' } end @@ -52,7 +65,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentConfigureAttributes` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentConfigureV2Attributes` initialize method" end self.additional_properties = {} @@ -71,9 +84,19 @@ def initialize(attributes = {}) end end + if attributes.key?(:'dry_run') + self.dry_run = attributes[:'dry_run'] + end + if attributes.key?(:'filter_query') self.filter_query = attributes[:'filter_query'] end + + if attributes.key?(:'target_packages') + if (value = attributes[:'target_packages']).is_a?(Array) + self.target_packages = value + end + end end # Check to see if the all the properties in the model are valid @@ -81,6 +104,7 @@ def initialize(attributes = {}) # @!visibility private def valid? return false if @config_operations.nil? + return false if @filter_query.nil? true end @@ -94,6 +118,16 @@ def config_operations=(config_operations) @config_operations = config_operations end + # Custom attribute writer method with validation + # @param filter_query [Object] Object to be assigned + # @!visibility private + def filter_query=(filter_query) + if filter_query.nil? + fail ArgumentError, 'invalid value for "filter_query", filter_query cannot be nil.' + end + @filter_query = filter_query + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private @@ -121,7 +155,9 @@ def ==(o) return true if self.equal?(o) self.class == o.class && config_operations == o.config_operations && + dry_run == o.dry_run && filter_query == o.filter_query && + target_packages == o.target_packages && additional_properties == o.additional_properties end @@ -129,7 +165,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [config_operations, filter_query, additional_properties].hash + [config_operations, dry_run, filter_query, target_packages, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_configure_create.rb b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_create.rb similarity index 92% rename from lib/datadog_api_client/v2/models/fleet_deployment_configure_create.rb rename to lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_create.rb index 42c8585db33a..e15d20d1f955 100644 --- a/lib/datadog_api_client/v2/models/fleet_deployment_configure_create.rb +++ b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_create.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Data for creating a new configuration deployment. - class FleetDeploymentConfigureCreate + # Data for creating a new v2 configuration deployment. + class FleetDeploymentConfigureV2Create include BaseGenericModel - # Attributes for creating a new configuration deployment. + # Attributes for creating a new v2 configuration deployment. attr_reader :attributes # The type of deployment resource. @@ -42,7 +42,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'FleetDeploymentConfigureAttributes', + :'attributes' => :'FleetDeploymentConfigureV2Attributes', :'type' => :'FleetDeploymentResourceType' } end @@ -52,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentConfigureCreate` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentConfigureV2Create` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/fleet_agent_versions_response.rb b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_create_request.rb similarity index 89% rename from lib/datadog_api_client/v2/models/fleet_agent_versions_response.rb rename to lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_create_request.rb index 6080758af457..933dcbe40b00 100644 --- a/lib/datadog_api_client/v2/models/fleet_agent_versions_response.rb +++ b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_create_request.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Response containing a list of available Agent versions. - class FleetAgentVersionsResponse + # Request payload for creating a new v2 configuration deployment. + class FleetDeploymentConfigureV2CreateRequest include BaseGenericModel - # Array of available Agent versions. + # Data for creating a new v2 configuration deployment. attr_reader :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'Array' + :'data' => :'FleetDeploymentConfigureV2Create' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentVersionsResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentConfigureV2CreateRequest` initialize method" end self.additional_properties = {} @@ -61,9 +61,7 @@ def initialize(attributes = {}) } if attributes.key?(:'data') - if (value = attributes[:'data']).is_a?(Array) - self.data = value - end + self.data = attributes[:'data'] end end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_dry_run.rb b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_dry_run.rb new file mode 100644 index 000000000000..89a8fae56406 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_dry_run.rb @@ -0,0 +1,166 @@ +=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 result of a configuration deployment dry run. + class FleetDeploymentConfigureV2DryRun + include BaseGenericModel + + # Attributes of a configuration deployment dry-run response. + attr_reader :attributes + + # Always `"dry-run"` for a dry-run response. Does not identify a real deployment + # and cannot be used to fetch a deployment by ID. + attr_reader :id + + # The type of deployment 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' => :'FleetDeploymentConfigureV2DryRunAttributes', + :'id' => :'String', + :'type' => :'FleetDeploymentResourceType' + } + 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::FleetDeploymentConfigureV2DryRun` 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_deployment_configure_v2_dry_run_attributes.rb b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_dry_run_attributes.rb new file mode 100644 index 000000000000..b49a44ce535a --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_dry_run_attributes.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 + # Attributes of a configuration deployment dry-run response. + class FleetDeploymentConfigureV2DryRunAttributes + include BaseGenericModel + + # Validation result of a configuration deployment dry run. + attr_accessor :dry_run + + # Query used to filter and select target hosts for the deployment. + attr_accessor :query + + # Total number of hosts targeted by the dry run. + attr_accessor :total_hosts + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dry_run' => :'dry_run', + :'query' => :'query', + :'total_hosts' => :'total_hosts' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dry_run' => :'FleetDeploymentConfigureV2DryRunResult', + :'query' => :'String', + :'total_hosts' => :'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::FleetDeploymentConfigureV2DryRunAttributes` 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?(:'dry_run') + self.dry_run = attributes[:'dry_run'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'total_hosts') + self.total_hosts = attributes[:'total_hosts'] + 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 && + dry_run == o.dry_run && + query == o.query && + total_hosts == o.total_hosts && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dry_run, query, total_hosts, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_dry_run_response.rb b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_dry_run_response.rb new file mode 100644 index 000000000000..f682ad40620a --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_dry_run_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 the result of a configuration deployment dry run. + class FleetDeploymentConfigureV2DryRunResponse + include BaseGenericModel + + # The result of a configuration deployment dry run. + 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' => :'FleetDeploymentConfigureV2DryRun' + } + 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::FleetDeploymentConfigureV2DryRunResponse` 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_deployment_configure_v2_dry_run_result.rb b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_dry_run_result.rb new file mode 100644 index 000000000000..687844344281 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_dry_run_result.rb @@ -0,0 +1,126 @@ +=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 + # Validation result of a configuration deployment dry run. + class FleetDeploymentConfigureV2DryRunResult + include BaseGenericModel + + # Whether the configuration passed schema validation. + attr_accessor :config_validated + + # Breakdown of ineligible host counts by reason. Only includes reasons with a + # non-zero count. Absent from the response when no targeted host is ineligible. + attr_accessor :non_upgradable_by_reason + + # Number of targeted hosts that are not eligible to receive this configuration. + attr_accessor :non_upgradable_hosts + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'config_validated' => :'config_validated', + :'non_upgradable_by_reason' => :'non_upgradable_by_reason', + :'non_upgradable_hosts' => :'non_upgradable_hosts' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'config_validated' => :'Boolean', + :'non_upgradable_by_reason' => :'Hash', + :'non_upgradable_hosts' => :'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::FleetDeploymentConfigureV2DryRunResult` 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?(:'config_validated') + self.config_validated = attributes[:'config_validated'] + end + + if attributes.key?(:'non_upgradable_by_reason') + self.non_upgradable_by_reason = attributes[:'non_upgradable_by_reason'] + end + + if attributes.key?(:'non_upgradable_hosts') + self.non_upgradable_hosts = attributes[:'non_upgradable_hosts'] + 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 && + config_validated == o.config_validated && + non_upgradable_by_reason == o.non_upgradable_by_reason && + non_upgradable_hosts == o.non_upgradable_hosts && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [config_validated, non_upgradable_by_reason, non_upgradable_hosts, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_package.rb b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_package.rb new file mode 100644 index 000000000000..c60903b9f0b7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_configure_v2_package.rb @@ -0,0 +1,154 @@ +=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 package and its target version to additionally deploy alongside a configuration change. + class FleetDeploymentConfigureV2Package + include BaseGenericModel + + # APM auto-instrumentation mode to enable for this package, if applicable. + attr_accessor :apm_instrumentation + + # The name of the package to deploy. + attr_reader :name + + # The target version of the package to deploy. + attr_reader :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'apm_instrumentation' => :'apm_instrumentation', + :'name' => :'name', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'apm_instrumentation' => :'String', + :'name' => :'String', + :'version' => :'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::FleetDeploymentConfigureV2Package` 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?(:'apm_instrumentation') + self.apm_instrumentation = attributes[:'apm_instrumentation'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + 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 @name.nil? + return false if @version.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param version [Object] Object to be assigned + # @!visibility private + def version=(version) + if version.nil? + fail ArgumentError, 'invalid value for "version", version cannot be nil.' + end + @version = version + 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 && + apm_instrumentation == o.apm_instrumentation && + name == o.name && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [apm_instrumentation, name, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_attributes.rb b/lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_v2_attributes.rb similarity index 87% rename from lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_attributes.rb rename to lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_v2_attributes.rb index 1f23d70d2283..7404ff6e3c1a 100644 --- a/lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_attributes.rb +++ b/lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_v2_attributes.rb @@ -17,12 +17,12 @@ require 'time' module DatadogAPIClient::V2 - # Attributes for creating a new package upgrade deployment. - class FleetDeploymentPackageUpgradeAttributes + # Attributes for creating a new v2 package upgrade deployment. + class FleetDeploymentPackageUpgradeV2Attributes include BaseGenericModel # Query used to filter and select target hosts for the deployment. Uses the Datadog query syntax. - attr_accessor :filter_query + attr_reader :filter_query # List of packages and their target versions to deploy to the selected hosts. attr_reader :target_packages @@ -52,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentPackageUpgradeAttributes` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentPackageUpgradeV2Attributes` initialize method" end self.additional_properties = {} @@ -80,10 +80,21 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? + return false if @filter_query.nil? return false if @target_packages.nil? true end + # Custom attribute writer method with validation + # @param filter_query [Object] Object to be assigned + # @!visibility private + def filter_query=(filter_query) + if filter_query.nil? + fail ArgumentError, 'invalid value for "filter_query", filter_query cannot be nil.' + end + @filter_query = filter_query + end + # Custom attribute writer method with validation # @param target_packages [Object] Object to be assigned # @!visibility private diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_create.rb b/lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_v2_create.rb similarity index 93% rename from lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_create.rb rename to lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_v2_create.rb index 313caa32d619..e85e505021e5 100644 --- a/lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_create.rb +++ b/lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_v2_create.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Data for creating a new package upgrade deployment. - class FleetDeploymentPackageUpgradeCreate + # Data for creating a new v2 package upgrade deployment. + class FleetDeploymentPackageUpgradeV2Create include BaseGenericModel - # Attributes for creating a new package upgrade deployment. + # Attributes for creating a new v2 package upgrade deployment. attr_reader :attributes # The type of deployment resource. @@ -42,7 +42,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'FleetDeploymentPackageUpgradeAttributes', + :'attributes' => :'FleetDeploymentPackageUpgradeV2Attributes', :'type' => :'FleetDeploymentResourceType' } end @@ -52,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentPackageUpgradeCreate` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentPackageUpgradeV2Create` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_create_request.rb b/lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_v2_create_request.rb similarity index 92% rename from lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_create_request.rb rename to lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_v2_create_request.rb index e341ea9513bd..4d5fa9a34ebe 100644 --- a/lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_create_request.rb +++ b/lib/datadog_api_client/v2/models/fleet_deployment_package_upgrade_v2_create_request.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Request payload for creating a new package upgrade deployment. - class FleetDeploymentPackageUpgradeCreateRequest + # Request payload for creating a new v2 package upgrade deployment. + class FleetDeploymentPackageUpgradeV2CreateRequest include BaseGenericModel - # Data for creating a new package upgrade deployment. + # Data for creating a new v2 package upgrade deployment. attr_reader :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'FleetDeploymentPackageUpgradeCreate' + :'data' => :'FleetDeploymentPackageUpgradeV2Create' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentPackageUpgradeCreateRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentPackageUpgradeV2CreateRequest` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_v2.rb b/lib/datadog_api_client/v2/models/fleet_deployment_v2.rb new file mode 100644 index 000000000000..4b004c200087 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_v2.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 + # A deployment in the v2 API response. + class FleetDeploymentV2 + include BaseGenericModel + + # Attributes of a deployment in the v2 API response. + attr_reader :attributes + + # Unique identifier for the deployment. + attr_reader :id + + # The type of deployment 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' => :'FleetDeploymentV2Attributes', + :'id' => :'String', + :'type' => :'FleetDeploymentResourceType' + } + 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::FleetDeploymentV2` 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_deployment_v2_attributes.rb b/lib/datadog_api_client/v2/models/fleet_deployment_v2_attributes.rb new file mode 100644 index 000000000000..aff2bd17aa54 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_v2_attributes.rb @@ -0,0 +1,243 @@ +=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 deployment in the v2 API response. + class FleetDeploymentV2Attributes + include BaseGenericModel + + # Handle of the user who triggered the deployment. + attr_accessor :author + + # Ordered list of configuration file operations applied by this deployment. + # Absent for package deployments, which have no configuration file operations. + attr_accessor :config_operations + + # Duration of the deployment in seconds, computed as `finished_at - started_at`. + # Zero if the deployment has not finished. + attr_accessor :duration_seconds + + # Top-level error message for the deployment. Populated only when the deployment has failed. + attr_accessor :error_summary + + # Estimated completion time of the deployment as a Unix timestamp. Zero if not available. + attr_accessor :estimated_finished_at + + # Time the deployment finished as a Unix timestamp. Zero if not yet finished. + attr_accessor :finished_at + + # Whether this deployment was triggered by a schedule (`schedule_id` is non-empty). + attr_accessor :is_scheduled + + # Query used to filter and select target hosts for the deployment. + attr_accessor :query + + # Identifier of the schedule that triggered this deployment. Empty if triggered manually. + attr_accessor :schedule_id + + # Time the deployment started as a Unix timestamp. Zero if not yet started. + attr_accessor :started_at + + # Current high-level status of the deployment (for example, "pending", "running", + # "completed", "failed"). + attr_accessor :status + + # Package versions targeted by this deployment. + attr_accessor :target_versions + + # Total number of hosts targeted by this deployment. + attr_accessor :total_hosts + + # Type of update operation performed by this deployment + # (for example, "update_config_operations", "update_package"). + attr_accessor :update_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'author' => :'author', + :'config_operations' => :'config_operations', + :'duration_seconds' => :'duration_seconds', + :'error_summary' => :'error_summary', + :'estimated_finished_at' => :'estimated_finished_at', + :'finished_at' => :'finished_at', + :'is_scheduled' => :'is_scheduled', + :'query' => :'query', + :'schedule_id' => :'schedule_id', + :'started_at' => :'started_at', + :'status' => :'status', + :'target_versions' => :'target_versions', + :'total_hosts' => :'total_hosts', + :'update_type' => :'update_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author' => :'String', + :'config_operations' => :'Array', + :'duration_seconds' => :'Integer', + :'error_summary' => :'String', + :'estimated_finished_at' => :'Integer', + :'finished_at' => :'Integer', + :'is_scheduled' => :'Boolean', + :'query' => :'String', + :'schedule_id' => :'String', + :'started_at' => :'Integer', + :'status' => :'String', + :'target_versions' => :'Array', + :'total_hosts' => :'Integer', + :'update_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::FleetDeploymentV2Attributes` 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?(:'author') + self.author = attributes[:'author'] + end + + if attributes.key?(:'config_operations') + if (value = attributes[:'config_operations']).is_a?(Array) + self.config_operations = value + end + end + + if attributes.key?(:'duration_seconds') + self.duration_seconds = attributes[:'duration_seconds'] + end + + if attributes.key?(:'error_summary') + self.error_summary = attributes[:'error_summary'] + end + + if attributes.key?(:'estimated_finished_at') + self.estimated_finished_at = attributes[:'estimated_finished_at'] + end + + if attributes.key?(:'finished_at') + self.finished_at = attributes[:'finished_at'] + end + + if attributes.key?(:'is_scheduled') + self.is_scheduled = attributes[:'is_scheduled'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'schedule_id') + self.schedule_id = attributes[:'schedule_id'] + end + + if attributes.key?(:'started_at') + self.started_at = attributes[:'started_at'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'target_versions') + if (value = attributes[:'target_versions']).is_a?(Array) + self.target_versions = value + end + end + + if attributes.key?(:'total_hosts') + self.total_hosts = attributes[:'total_hosts'] + end + + if attributes.key?(:'update_type') + self.update_type = attributes[:'update_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 && + author == o.author && + config_operations == o.config_operations && + duration_seconds == o.duration_seconds && + error_summary == o.error_summary && + estimated_finished_at == o.estimated_finished_at && + finished_at == o.finished_at && + is_scheduled == o.is_scheduled && + query == o.query && + schedule_id == o.schedule_id && + started_at == o.started_at && + status == o.status && + target_versions == o.target_versions && + total_hosts == o.total_hosts && + update_type == o.update_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author, config_operations, duration_seconds, error_summary, estimated_finished_at, finished_at, is_scheduled, query, schedule_id, started_at, status, target_versions, total_hosts, update_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_v2_cancel.rb b/lib/datadog_api_client/v2/models/fleet_deployment_v2_cancel.rb new file mode 100644 index 000000000000..16ae65aecea9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_v2_cancel.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 + # A deployment cancellation response. + class FleetDeploymentV2Cancel + include BaseGenericModel + + # Attributes of a deployment cancellation response. + attr_reader :attributes + + # Unique identifier for the deployment. + attr_reader :id + + # The type of deployment 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' => :'FleetDeploymentV2CancelAttributes', + :'id' => :'String', + :'type' => :'FleetDeploymentResourceType' + } + 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::FleetDeploymentV2Cancel` 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_deployment_v2_cancel_attributes.rb b/lib/datadog_api_client/v2/models/fleet_deployment_v2_cancel_attributes.rb new file mode 100644 index 000000000000..bd4c0f5484be --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_v2_cancel_attributes.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 + # Attributes of a deployment cancellation response. + class FleetDeploymentV2CancelAttributes + include BaseGenericModel + + # Human-readable message describing the outcome of the cancellation request. + attr_accessor :message + + # Status of the deployment after the cancellation request. + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'message' => :'message', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'message' => :'String', + :'status' => :'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::FleetDeploymentV2CancelAttributes` 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?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + 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 && + message == o.message && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [message, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_v2_cancel_response.rb b/lib/datadog_api_client/v2/models/fleet_deployment_v2_cancel_response.rb new file mode 100644 index 000000000000..2ff18645396a --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_v2_cancel_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 the result of a deployment cancellation request. + class FleetDeploymentV2CancelResponse + include BaseGenericModel + + # A deployment cancellation response. + 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' => :'FleetDeploymentV2Cancel' + } + 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::FleetDeploymentV2CancelResponse` 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_agent_info_response.rb b/lib/datadog_api_client/v2/models/fleet_deployment_v2_create_response.rb similarity index 91% rename from lib/datadog_api_client/v2/models/fleet_agent_info_response.rb rename to lib/datadog_api_client/v2/models/fleet_deployment_v2_create_response.rb index b4b28f278a84..c7aa19020461 100644 --- a/lib/datadog_api_client/v2/models/fleet_agent_info_response.rb +++ b/lib/datadog_api_client/v2/models/fleet_deployment_v2_create_response.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Response containing detailed information about a specific agent. - class FleetAgentInfoResponse + # Response containing the newly created deployment. + class FleetDeploymentV2CreateResponse include BaseGenericModel - # Represents detailed information about a specific Datadog Agent. + # A deployment in the v2 API response. attr_reader :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'FleetAgentInfo' + :'data' => :'FleetDeploymentV2' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentInfoResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentV2CreateResponse` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/fleet_agents_response_data.rb b/lib/datadog_api_client/v2/models/fleet_deployment_v2_detail.rb similarity index 91% rename from lib/datadog_api_client/v2/models/fleet_agents_response_data.rb rename to lib/datadog_api_client/v2/models/fleet_deployment_v2_detail.rb index 6f52b8e41749..a65c294ce6eb 100644 --- a/lib/datadog_api_client/v2/models/fleet_agents_response_data.rb +++ b/lib/datadog_api_client/v2/models/fleet_deployment_v2_detail.rb @@ -17,17 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # The response data containing status and agents array. - class FleetAgentsResponseData + # Detailed information about a deployment. + class FleetDeploymentV2Detail include BaseGenericModel - # Attributes of the fleet agents response containing the list of agents. + # Attributes of a deployment detail response. attr_reader :attributes - # Status identifier. + # Unique identifier for the deployment. attr_reader :id - # Resource type. + # The type of deployment resource. attr_reader :type attr_accessor :additional_properties @@ -46,9 +46,9 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'FleetAgentsResponseDataAttributes', + :'attributes' => :'FleetDeploymentV2DetailAttributes', :'id' => :'String', - :'type' => :'String' + :'type' => :'FleetDeploymentResourceType' } end @@ -57,7 +57,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetAgentsResponseData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentV2Detail` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_v2_detail_agent.rb b/lib/datadog_api_client/v2/models/fleet_deployment_v2_detail_agent.rb new file mode 100644 index 000000000000..93499f6dc674 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_v2_detail_agent.rb @@ -0,0 +1,157 @@ +=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 + # Per-host status entry for a deployment. + class FleetDeploymentV2DetailAgent + include BaseGenericModel + + # Error message if the deployment failed on this host. + attr_accessor :error + + # Hostname of the agent. + attr_accessor :hostname + + # Name of the step currently executing on this host. + attr_accessor :running_step + + # Deployment status for this host (for example, "pending", "running", "succeeded", "failed"). + attr_accessor :status + + # Additional details about the current deployment status on this host. + attr_accessor :status_details + + # Package version details for this host. + attr_accessor :versions + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'error' => :'error', + :'hostname' => :'hostname', + :'running_step' => :'running_step', + :'status' => :'status', + :'status_details' => :'status_details', + :'versions' => :'versions' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'error' => :'String', + :'hostname' => :'String', + :'running_step' => :'String', + :'status' => :'String', + :'status_details' => :'String', + :'versions' => :'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::FleetDeploymentV2DetailAgent` 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?(:'error') + self.error = attributes[:'error'] + end + + if attributes.key?(:'hostname') + self.hostname = attributes[:'hostname'] + end + + if attributes.key?(:'running_step') + self.running_step = attributes[:'running_step'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'status_details') + self.status_details = attributes[:'status_details'] + end + + if attributes.key?(:'versions') + if (value = attributes[:'versions']).is_a?(Array) + self.versions = 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 && + error == o.error && + hostname == o.hostname && + running_step == o.running_step && + status == o.status && + status_details == o.status_details && + versions == o.versions && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [error, hostname, running_step, status, status_details, versions, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_v2_detail_attributes.rb b/lib/datadog_api_client/v2/models/fleet_deployment_v2_detail_attributes.rb new file mode 100644 index 000000000000..03a930d7eb47 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_v2_detail_attributes.rb @@ -0,0 +1,347 @@ +=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 deployment detail response. + class FleetDeploymentV2DetailAttributes + include BaseGenericModel + + # Handle of the user who triggered the deployment. + attr_accessor :author + + # Number of hosts on which the deployment was canceled. + attr_reader :canceled_hosts + + # Ordered list of configuration file operations applied by this deployment. + # Absent for package deployments, which have no configuration file operations. + attr_accessor :config_operations + + # Duration of the deployment in seconds, computed as `finished_at - started_at`. + # Zero if the deployment has not finished. + attr_accessor :duration_seconds + + # Top-level error message for the deployment. Populated only when the deployment has failed. + attr_accessor :error_summary + + # Estimated completion time of the deployment as a Unix timestamp. Zero if not available. + attr_accessor :estimated_finished_at + + # Number of hosts on which the deployment failed. + attr_reader :failed_hosts + + # Current high-level status of the deployment (for example, "pending", "running", + # "completed", "failed"). + attr_accessor :high_level_status + + # Per-host status list for this deployment. + attr_accessor :hosts + + # Whether this deployment was triggered by a schedule (`schedule_id` is non-empty). + attr_accessor :is_scheduled + + # Query used to filter and select target hosts for the deployment. + attr_accessor :query + + # Number of hosts on which the deployment is currently running. + attr_reader :running_hosts + + # Identifier of the schedule that triggered this deployment. Empty if triggered manually. + attr_accessor :schedule_id + + # Number of hosts that were skipped during the deployment. + attr_reader :skipped_hosts + + # Number of hosts on which the deployment succeeded. + attr_reader :succeeded_hosts + + # Distinct package versions targeted by this deployment, in first-seen order. + attr_accessor :target_versions + + # Total number of hosts targeted by this deployment. + attr_accessor :total_hosts + + # Type of update operation performed by this deployment + # (for example, "update_config_operations", "update_package"). + attr_accessor :update_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'author' => :'author', + :'canceled_hosts' => :'canceled_hosts', + :'config_operations' => :'config_operations', + :'duration_seconds' => :'duration_seconds', + :'error_summary' => :'error_summary', + :'estimated_finished_at' => :'estimated_finished_at', + :'failed_hosts' => :'failed_hosts', + :'high_level_status' => :'high_level_status', + :'hosts' => :'hosts', + :'is_scheduled' => :'is_scheduled', + :'query' => :'query', + :'running_hosts' => :'running_hosts', + :'schedule_id' => :'schedule_id', + :'skipped_hosts' => :'skipped_hosts', + :'succeeded_hosts' => :'succeeded_hosts', + :'target_versions' => :'target_versions', + :'total_hosts' => :'total_hosts', + :'update_type' => :'update_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author' => :'String', + :'canceled_hosts' => :'Integer', + :'config_operations' => :'Array', + :'duration_seconds' => :'Integer', + :'error_summary' => :'String', + :'estimated_finished_at' => :'Integer', + :'failed_hosts' => :'Integer', + :'high_level_status' => :'String', + :'hosts' => :'Array', + :'is_scheduled' => :'Boolean', + :'query' => :'String', + :'running_hosts' => :'Integer', + :'schedule_id' => :'String', + :'skipped_hosts' => :'Integer', + :'succeeded_hosts' => :'Integer', + :'target_versions' => :'Array', + :'total_hosts' => :'Integer', + :'update_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::FleetDeploymentV2DetailAttributes` 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?(:'author') + self.author = attributes[:'author'] + end + + if attributes.key?(:'canceled_hosts') + self.canceled_hosts = attributes[:'canceled_hosts'] + end + + if attributes.key?(:'config_operations') + if (value = attributes[:'config_operations']).is_a?(Array) + self.config_operations = value + end + end + + if attributes.key?(:'duration_seconds') + self.duration_seconds = attributes[:'duration_seconds'] + end + + if attributes.key?(:'error_summary') + self.error_summary = attributes[:'error_summary'] + end + + if attributes.key?(:'estimated_finished_at') + self.estimated_finished_at = attributes[:'estimated_finished_at'] + end + + if attributes.key?(:'failed_hosts') + self.failed_hosts = attributes[:'failed_hosts'] + end + + if attributes.key?(:'high_level_status') + self.high_level_status = attributes[:'high_level_status'] + end + + if attributes.key?(:'hosts') + if (value = attributes[:'hosts']).is_a?(Array) + self.hosts = value + end + end + + if attributes.key?(:'is_scheduled') + self.is_scheduled = attributes[:'is_scheduled'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'running_hosts') + self.running_hosts = attributes[:'running_hosts'] + end + + if attributes.key?(:'schedule_id') + self.schedule_id = attributes[:'schedule_id'] + end + + if attributes.key?(:'skipped_hosts') + self.skipped_hosts = attributes[:'skipped_hosts'] + end + + if attributes.key?(:'succeeded_hosts') + self.succeeded_hosts = attributes[:'succeeded_hosts'] + end + + if attributes.key?(:'target_versions') + if (value = attributes[:'target_versions']).is_a?(Array) + self.target_versions = value + end + end + + if attributes.key?(:'total_hosts') + self.total_hosts = attributes[:'total_hosts'] + end + + if attributes.key?(:'update_type') + self.update_type = attributes[:'update_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 !@canceled_hosts.nil? && @canceled_hosts < 0 + return false if !@failed_hosts.nil? && @failed_hosts < 0 + return false if !@running_hosts.nil? && @running_hosts < 0 + return false if !@skipped_hosts.nil? && @skipped_hosts < 0 + return false if !@succeeded_hosts.nil? && @succeeded_hosts < 0 + true + end + + # Custom attribute writer method with validation + # @param canceled_hosts [Object] Object to be assigned + # @!visibility private + def canceled_hosts=(canceled_hosts) + if !canceled_hosts.nil? && canceled_hosts < 0 + fail ArgumentError, 'invalid value for "canceled_hosts", must be greater than or equal to 0.' + end + @canceled_hosts = canceled_hosts + end + + # Custom attribute writer method with validation + # @param failed_hosts [Object] Object to be assigned + # @!visibility private + def failed_hosts=(failed_hosts) + if !failed_hosts.nil? && failed_hosts < 0 + fail ArgumentError, 'invalid value for "failed_hosts", must be greater than or equal to 0.' + end + @failed_hosts = failed_hosts + end + + # Custom attribute writer method with validation + # @param running_hosts [Object] Object to be assigned + # @!visibility private + def running_hosts=(running_hosts) + if !running_hosts.nil? && running_hosts < 0 + fail ArgumentError, 'invalid value for "running_hosts", must be greater than or equal to 0.' + end + @running_hosts = running_hosts + end + + # Custom attribute writer method with validation + # @param skipped_hosts [Object] Object to be assigned + # @!visibility private + def skipped_hosts=(skipped_hosts) + if !skipped_hosts.nil? && skipped_hosts < 0 + fail ArgumentError, 'invalid value for "skipped_hosts", must be greater than or equal to 0.' + end + @skipped_hosts = skipped_hosts + end + + # Custom attribute writer method with validation + # @param succeeded_hosts [Object] Object to be assigned + # @!visibility private + def succeeded_hosts=(succeeded_hosts) + if !succeeded_hosts.nil? && succeeded_hosts < 0 + fail ArgumentError, 'invalid value for "succeeded_hosts", must be greater than or equal to 0.' + end + @succeeded_hosts = succeeded_hosts + 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 && + author == o.author && + canceled_hosts == o.canceled_hosts && + config_operations == o.config_operations && + duration_seconds == o.duration_seconds && + error_summary == o.error_summary && + estimated_finished_at == o.estimated_finished_at && + failed_hosts == o.failed_hosts && + high_level_status == o.high_level_status && + hosts == o.hosts && + is_scheduled == o.is_scheduled && + query == o.query && + running_hosts == o.running_hosts && + schedule_id == o.schedule_id && + skipped_hosts == o.skipped_hosts && + succeeded_hosts == o.succeeded_hosts && + target_versions == o.target_versions && + total_hosts == o.total_hosts && + update_type == o.update_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author, canceled_hosts, config_operations, duration_seconds, error_summary, estimated_finished_at, failed_hosts, high_level_status, hosts, is_scheduled, query, running_hosts, schedule_id, skipped_hosts, succeeded_hosts, target_versions, total_hosts, update_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_deployment_v2_detail_response.rb b/lib/datadog_api_client/v2/models/fleet_deployment_v2_detail_response.rb new file mode 100644 index 000000000000..07dff6a6b2d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployment_v2_detail_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 single deployment. + class FleetDeploymentV2DetailResponse + include BaseGenericModel + + # Detailed information about a deployment. + 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' => :'FleetDeploymentV2Detail' + } + 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::FleetDeploymentV2DetailResponse` 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_deployments_v2_page.rb b/lib/datadog_api_client/v2/models/fleet_deployments_v2_page.rb new file mode 100644 index 000000000000..b803ec000b9f --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployments_v2_page.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 + # Pagination details for the v2 list of deployments. + class FleetDeploymentsV2Page + include BaseGenericModel + + # Total number of deployments available across all pages. + attr_accessor :total_count + + # Total number of deployments matching the current filter query. + 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_count' => :'total_count', + :'total_filtered_count' => :'total_filtered_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_count' => :'Integer', + :'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::FleetDeploymentsV2Page` 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_count') + self.total_count = attributes[:'total_count'] + 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_count == o.total_count && + 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_count, total_filtered_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_deployments_response.rb b/lib/datadog_api_client/v2/models/fleet_deployments_v2_response.rb similarity index 92% rename from lib/datadog_api_client/v2/models/fleet_deployments_response.rb rename to lib/datadog_api_client/v2/models/fleet_deployments_v2_response.rb index 2cb624f6bee4..09ed0d5bf4c8 100644 --- a/lib/datadog_api_client/v2/models/fleet_deployments_response.rb +++ b/lib/datadog_api_client/v2/models/fleet_deployments_v2_response.rb @@ -18,13 +18,13 @@ module DatadogAPIClient::V2 # Response containing a paginated list of deployments. - class FleetDeploymentsResponse + class FleetDeploymentsV2Response include BaseGenericModel # Array of deployments matching the query criteria. attr_reader :data - # Metadata for the list of deployments, including pagination information. + # Metadata for the v2 list of deployments, including pagination information. attr_accessor :meta attr_accessor :additional_properties @@ -42,8 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'Array', - :'meta' => :'FleetDeploymentsResponseMeta' + :'data' => :'Array', + :'meta' => :'FleetDeploymentsV2ResponseMeta' } end @@ -52,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentsResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentsV2Response` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/fleet_deployments_v2_response_meta.rb b/lib/datadog_api_client/v2/models/fleet_deployments_v2_response_meta.rb new file mode 100644 index 000000000000..e052a66265f3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_deployments_v2_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 v2 list of deployments, including pagination information. + class FleetDeploymentsV2ResponseMeta + include BaseGenericModel + + # Pagination details for the v2 list of deployments. + attr_accessor :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'FleetDeploymentsV2Page' + } + 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::FleetDeploymentsV2ResponseMeta` 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?(:'page') + self.page = attributes[:'page'] + 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 && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, 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_v2.rb similarity index 82% rename from lib/datadog_api_client/v2/models/fleet_integration_details.rb rename to lib/datadog_api_client/v2/models/fleet_integration_details_v2.rb index 13884da15044..4869516691f9 100644 --- a/lib/datadog_api_client/v2/models/fleet_integration_details.rb +++ b/lib/datadog_api_client/v2/models/fleet_integration_details_v2.rb @@ -18,10 +18,10 @@ module DatadogAPIClient::V2 # Detailed information about a single integration. - class FleetIntegrationDetails + class FleetIntegrationDetailsV2 include BaseGenericModel - # Type of data collected (metrics, logs). + # Type of data collected, such as metrics or logs. attr_accessor :data_type # Error messages if the integration has issues. @@ -36,12 +36,21 @@ class FleetIntegrationDetails # Whether this is a custom integration. attr_accessor :is_custom_check + # Whether this is a default integration instance. + attr_accessor :is_default + + # Whether this integration configuration is an init config. + attr_accessor :is_init + # Log collection configuration (YAML format). attr_accessor :log_config # Name of the integration instance. attr_accessor :name + # Number of pods running this integration. Absent from the response when the count is zero. + attr_accessor :pod_count + # Index in the configuration file. attr_accessor :source_index @@ -62,8 +71,11 @@ def self.attribute_map :'init_config' => :'init_config', :'instance_config' => :'instance_config', :'is_custom_check' => :'is_custom_check', + :'is_default' => :'is_default', + :'is_init' => :'is_init', :'log_config' => :'log_config', :'name' => :'name', + :'pod_count' => :'pod_count', :'source_index' => :'source_index', :'source_path' => :'source_path', :'type' => :'type' @@ -79,8 +91,11 @@ def self.openapi_types :'init_config' => :'String', :'instance_config' => :'String', :'is_custom_check' => :'Boolean', + :'is_default' => :'Boolean', + :'is_init' => :'Boolean', :'log_config' => :'String', :'name' => :'String', + :'pod_count' => :'Integer', :'source_index' => :'Integer', :'source_path' => :'String', :'type' => :'String' @@ -92,7 +107,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetIntegrationDetails` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetIntegrationDetailsV2` initialize method" end self.additional_properties = {} @@ -127,6 +142,14 @@ def initialize(attributes = {}) self.is_custom_check = attributes[:'is_custom_check'] end + if attributes.key?(:'is_default') + self.is_default = attributes[:'is_default'] + end + + if attributes.key?(:'is_init') + self.is_init = attributes[:'is_init'] + end + if attributes.key?(:'log_config') self.log_config = attributes[:'log_config'] end @@ -135,6 +158,10 @@ def initialize(attributes = {}) self.name = attributes[:'name'] end + if attributes.key?(:'pod_count') + self.pod_count = attributes[:'pod_count'] + end + if attributes.key?(:'source_index') self.source_index = attributes[:'source_index'] end @@ -179,8 +206,11 @@ def ==(o) init_config == o.init_config && instance_config == o.instance_config && is_custom_check == o.is_custom_check && + is_default == o.is_default && + is_init == o.is_init && log_config == o.log_config && name == o.name && + pod_count == o.pod_count && source_index == o.source_index && source_path == o.source_path && type == o.type && @@ -191,7 +221,7 @@ def ==(o) # @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 + [data_type, error_messages, init_config, instance_config, is_custom_check, is_default, is_init, log_config, name, pod_count, 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_v2.rb similarity index 83% rename from lib/datadog_api_client/v2/models/fleet_integrations_by_status.rb rename to lib/datadog_api_client/v2/models/fleet_integrations_by_status_v2.rb index 058fc46423e2..a6fe0a653403 100644 --- a/lib/datadog_api_client/v2/models/fleet_integrations_by_status.rb +++ b/lib/datadog_api_client/v2/models/fleet_integrations_by_status_v2.rb @@ -18,9 +18,12 @@ module DatadogAPIClient::V2 # Integrations organized by their status. - class FleetIntegrationsByStatus + class FleetIntegrationsByStatusV2 include BaseGenericModel + # The Kubernetes cluster name, if the agent runs in a cluster. + attr_accessor :cluster_name + # Configuration files for integrations. attr_accessor :configuration_files @@ -30,6 +33,9 @@ class FleetIntegrationsByStatus # Integrations with errors. attr_accessor :error_integrations + # The Kubernetes cluster key, if the agent runs in a cluster. + attr_accessor :k8s_cluster_key + # Detected but not configured integrations. attr_accessor :missing_integrations @@ -45,9 +51,11 @@ class FleetIntegrationsByStatus # @!visibility private def self.attribute_map { + :'cluster_name' => :'cluster_name', :'configuration_files' => :'configuration_files', :'datadog_agent_key' => :'datadog_agent_key', :'error_integrations' => :'error_integrations', + :'k8s_cluster_key' => :'k8s_cluster_key', :'missing_integrations' => :'missing_integrations', :'warning_integrations' => :'warning_integrations', :'working_integrations' => :'working_integrations' @@ -58,12 +66,14 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'configuration_files' => :'Array', + :'cluster_name' => :'String', + :'configuration_files' => :'Array', :'datadog_agent_key' => :'String', - :'error_integrations' => :'Array', + :'error_integrations' => :'Array', + :'k8s_cluster_key' => :'String', :'missing_integrations' => :'Array', - :'warning_integrations' => :'Array', - :'working_integrations' => :'Array' + :'warning_integrations' => :'Array', + :'working_integrations' => :'Array' } end @@ -72,7 +82,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetIntegrationsByStatus` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetIntegrationsByStatusV2` initialize method" end self.additional_properties = {} @@ -85,6 +95,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'cluster_name') + self.cluster_name = attributes[:'cluster_name'] + end + if attributes.key?(:'configuration_files') if (value = attributes[:'configuration_files']).is_a?(Array) self.configuration_files = value @@ -101,6 +115,10 @@ def initialize(attributes = {}) end end + if attributes.key?(:'k8s_cluster_key') + self.k8s_cluster_key = attributes[:'k8s_cluster_key'] + end + if attributes.key?(:'missing_integrations') if (value = attributes[:'missing_integrations']).is_a?(Array) self.missing_integrations = value @@ -146,9 +164,11 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + cluster_name == o.cluster_name && configuration_files == o.configuration_files && datadog_agent_key == o.datadog_agent_key && error_integrations == o.error_integrations && + k8s_cluster_key == o.k8s_cluster_key && missing_integrations == o.missing_integrations && warning_integrations == o.warning_integrations && working_integrations == o.working_integrations && @@ -159,7 +179,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [configuration_files, datadog_agent_key, error_integrations, missing_integrations, warning_integrations, working_integrations, additional_properties].hash + [cluster_name, configuration_files, datadog_agent_key, error_integrations, k8s_cluster_key, missing_integrations, warning_integrations, working_integrations, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/fleet_otel_collector_configuration_v2.rb b/lib/datadog_api_client/v2/models/fleet_otel_collector_configuration_v2.rb new file mode 100644 index 000000000000..7481d7dfe256 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_otel_collector_configuration_v2.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 + # Configuration for a single OpenTelemetry collector associated with the agent. + class FleetOtelCollectorConfigurationV2 + include BaseGenericModel + + # The unique identifier of the OpenTelemetry collector. + attr_accessor :collector_id + + # The final compiled configuration of the OpenTelemetry collector. + attr_accessor :compiled_configuration + + # The distribution of the OpenTelemetry collector. + attr_accessor :distribution + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'collector_id' => :'collector_id', + :'compiled_configuration' => :'compiled_configuration', + :'distribution' => :'distribution' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'collector_id' => :'String', + :'compiled_configuration' => :'String', + :'distribution' => :'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::FleetOtelCollectorConfigurationV2` 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?(:'collector_id') + self.collector_id = attributes[:'collector_id'] + end + + if attributes.key?(:'compiled_configuration') + self.compiled_configuration = attributes[:'compiled_configuration'] + end + + if attributes.key?(:'distribution') + self.distribution = attributes[:'distribution'] + 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 && + collector_id == o.collector_id && + compiled_configuration == o.compiled_configuration && + distribution == o.distribution && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [collector_id, compiled_configuration, distribution, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_schedule_v2.rb b/lib/datadog_api_client/v2/models/fleet_schedule_v2.rb new file mode 100644 index 000000000000..b8edc6418f02 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_schedule_v2.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 + # A fleet upgrade schedule resource in the v2 API response. + class FleetScheduleV2 + include BaseGenericModel + + # Attributes of a fleet schedule in the v2 API response. + attr_reader :attributes + + # Unique identifier for the schedule. + attr_reader :id + + # The type of schedule 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' => :'FleetScheduleV2Attributes', + :'id' => :'String', + :'type' => :'FleetScheduleResourceType' + } + 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::FleetScheduleV2` 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_schedule_v2_attributes.rb b/lib/datadog_api_client/v2/models/fleet_schedule_v2_attributes.rb new file mode 100644 index 000000000000..7e65b7eaa3ff --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_schedule_v2_attributes.rb @@ -0,0 +1,247 @@ +=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 fleet schedule in the v2 API response. + class FleetScheduleV2Attributes + include BaseGenericModel + + # RFC3339 timestamp when the schedule was created. + attr_accessor :created_at + + # User handle of the person who created the schedule. + attr_accessor :created_by + + # Whether this is the default schedule for the organization. + attr_accessor :is_default + + # Human-readable name for the schedule. + attr_accessor :name + + # RFC3339 timestamp of the next scheduled maintenance window start time. + # Absent when the next run time cannot be computed. + attr_accessor :next_run + + # Notification configuration attached to a schedule. + # + # Included when available. If the notification rule cannot be retrieved, this field is + # omitted and the schedule is still returned. If the notification rule is retrieved but its + # handles cannot be resolved, it is still included with an empty `handles` array. + attr_accessor :notification_rule + + # Query used to filter and select target hosts for scheduled deployments. + attr_accessor :query + + # Defines the recurrence pattern for the schedule. + attr_accessor :rule + + # The status of the schedule. + # - `active`: The schedule is active and will create deployments according to its recurrence rule. + # - `inactive`: The schedule is inactive and will not create any deployments. + attr_accessor :status + + # RFC3339 timestamp when the schedule was last updated. + attr_accessor :updated_at + + # User handle of the person who last updated the schedule. + attr_accessor :updated_by + + # Number of major versions behind the latest to target for upgrades. + # - 0: Always upgrade to the latest version. + # - 1: Upgrade to latest minus 1 major version. + # - 2: Upgrade to latest minus 2 major versions. + attr_reader :version_to_latest + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'is_default' => :'is_default', + :'name' => :'name', + :'next_run' => :'next_run', + :'notification_rule' => :'notification_rule', + :'query' => :'query', + :'rule' => :'rule', + :'status' => :'status', + :'updated_at' => :'updated_at', + :'updated_by' => :'updated_by', + :'version_to_latest' => :'version_to_latest' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'String', + :'created_by' => :'String', + :'is_default' => :'Boolean', + :'name' => :'String', + :'next_run' => :'String', + :'notification_rule' => :'FleetScheduleV2NotificationRule', + :'query' => :'String', + :'rule' => :'FleetScheduleV2RecurrenceRule', + :'status' => :'FleetScheduleStatus', + :'updated_at' => :'String', + :'updated_by' => :'String', + :'version_to_latest' => :'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::FleetScheduleV2Attributes` 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?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'is_default') + self.is_default = attributes[:'is_default'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'next_run') + self.next_run = attributes[:'next_run'] + end + + if attributes.key?(:'notification_rule') + self.notification_rule = attributes[:'notification_rule'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'updated_by') + self.updated_by = attributes[:'updated_by'] + end + + if attributes.key?(:'version_to_latest') + self.version_to_latest = attributes[:'version_to_latest'] + 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 !@version_to_latest.nil? && @version_to_latest > 2 + return false if !@version_to_latest.nil? && @version_to_latest < 0 + true + end + + # Custom attribute writer method with validation + # @param version_to_latest [Object] Object to be assigned + # @!visibility private + def version_to_latest=(version_to_latest) + if !version_to_latest.nil? && version_to_latest > 2 + fail ArgumentError, 'invalid value for "version_to_latest", must be smaller than or equal to 2.' + end + if !version_to_latest.nil? && version_to_latest < 0 + fail ArgumentError, 'invalid value for "version_to_latest", must be greater than or equal to 0.' + end + @version_to_latest = version_to_latest + 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 && + created_at == o.created_at && + created_by == o.created_by && + is_default == o.is_default && + name == o.name && + next_run == o.next_run && + notification_rule == o.notification_rule && + query == o.query && + rule == o.rule && + status == o.status && + updated_at == o.updated_at && + updated_by == o.updated_by && + version_to_latest == o.version_to_latest && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, created_by, is_default, name, next_run, notification_rule, query, rule, status, updated_at, updated_by, version_to_latest, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_schedule_v2_notification_rule.rb b/lib/datadog_api_client/v2/models/fleet_schedule_v2_notification_rule.rb new file mode 100644 index 000000000000..101c8745c19b --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_schedule_v2_notification_rule.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 + # Notification configuration attached to a schedule. + # + # Included when available. If the notification rule cannot be retrieved, this field is + # omitted and the schedule is still returned. If the notification rule is retrieved but its + # handles cannot be resolved, it is still included with an empty `handles` array. + class FleetScheduleV2NotificationRule + include BaseGenericModel + + # Notification handles (for example, Slack channels or PagerDuty integrations). + attr_accessor :handles + + # Tags associated with the notification rule. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'handles' => :'handles', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'handles' => :'Array', + :'tags' => :'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::FleetScheduleV2NotificationRule` 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?(:'handles') + if (value = attributes[:'handles']).is_a?(Array) + self.handles = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = 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 && + handles == o.handles && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [handles, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_schedule_v2_recurrence_rule.rb b/lib/datadog_api_client/v2/models/fleet_schedule_v2_recurrence_rule.rb new file mode 100644 index 000000000000..0ea545975456 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_schedule_v2_recurrence_rule.rb @@ -0,0 +1,150 @@ +=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 + # Defines the recurrence pattern for the schedule. + class FleetScheduleV2RecurrenceRule + include BaseGenericModel + + # Days of the week when the schedule triggers. Valid values are + # "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun". + attr_accessor :days_of_week + + # Interval between schedule runs in weeks. 1 means the schedule runs every week + # on the specified days. Higher values repeat every N weeks. + attr_accessor :interval + + # Duration of the maintenance window in minutes. + attr_accessor :maintenance_window_duration + + # Start time of the maintenance window in 24-hour clock format (HH:MM). + # Deployments are triggered at this time on the specified days. + attr_accessor :start_maintenance_window + + # Timezone in IANA Time Zone Database format. + attr_accessor :timezone + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'days_of_week' => :'days_of_week', + :'interval' => :'interval', + :'maintenance_window_duration' => :'maintenance_window_duration', + :'start_maintenance_window' => :'start_maintenance_window', + :'timezone' => :'timezone' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'days_of_week' => :'Array', + :'interval' => :'Integer', + :'maintenance_window_duration' => :'Integer', + :'start_maintenance_window' => :'String', + :'timezone' => :'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::FleetScheduleV2RecurrenceRule` 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?(:'days_of_week') + if (value = attributes[:'days_of_week']).is_a?(Array) + self.days_of_week = value + end + end + + if attributes.key?(:'interval') + self.interval = attributes[:'interval'] + end + + if attributes.key?(:'maintenance_window_duration') + self.maintenance_window_duration = attributes[:'maintenance_window_duration'] + end + + if attributes.key?(:'start_maintenance_window') + self.start_maintenance_window = attributes[:'start_maintenance_window'] + end + + if attributes.key?(:'timezone') + self.timezone = attributes[:'timezone'] + 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 && + days_of_week == o.days_of_week && + interval == o.interval && + maintenance_window_duration == o.maintenance_window_duration && + start_maintenance_window == o.start_maintenance_window && + timezone == o.timezone && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [days_of_week, interval, maintenance_window_duration, start_maintenance_window, timezone, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/fleet_schedules_response.rb b/lib/datadog_api_client/v2/models/fleet_schedule_v2_response.rb similarity index 90% rename from lib/datadog_api_client/v2/models/fleet_schedules_response.rb rename to lib/datadog_api_client/v2/models/fleet_schedule_v2_response.rb index e24c9cda83cf..86836057df4b 100644 --- a/lib/datadog_api_client/v2/models/fleet_schedules_response.rb +++ b/lib/datadog_api_client/v2/models/fleet_schedule_v2_response.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Response containing a list of schedules. - class FleetSchedulesResponse + # Response containing a single fleet schedule. + class FleetScheduleV2Response include BaseGenericModel - # Array of schedules. + # A fleet upgrade schedule resource in the v2 API response. attr_reader :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'Array' + :'data' => :'FleetScheduleV2' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetSchedulesResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetScheduleV2Response` initialize method" end self.additional_properties = {} @@ -61,9 +61,7 @@ def initialize(attributes = {}) } if attributes.key?(:'data') - if (value = attributes[:'data']).is_a?(Array) - self.data = value - end + self.data = attributes[:'data'] end end diff --git a/lib/datadog_api_client/v2/models/fleet_deployments_page.rb b/lib/datadog_api_client/v2/models/fleet_schedules_v2_page.rb similarity index 93% rename from lib/datadog_api_client/v2/models/fleet_deployments_page.rb rename to lib/datadog_api_client/v2/models/fleet_schedules_v2_page.rb index a3609924724f..4a5b819a9e6e 100644 --- a/lib/datadog_api_client/v2/models/fleet_deployments_page.rb +++ b/lib/datadog_api_client/v2/models/fleet_schedules_v2_page.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Pagination details for the list of deployments. - class FleetDeploymentsPage + # Pagination details for the v2 list of schedules. + class FleetSchedulesV2Page include BaseGenericModel - # Total number of deployments available across all pages. + # Total number of schedules returned. attr_accessor :total_count attr_accessor :additional_properties @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentsPage` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetSchedulesV2Page` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/fleet_schedules_v2_response.rb b/lib/datadog_api_client/v2/models/fleet_schedules_v2_response.rb new file mode 100644 index 000000000000..618df282a004 --- /dev/null +++ b/lib/datadog_api_client/v2/models/fleet_schedules_v2_response.rb @@ -0,0 +1,135 @@ +=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 list of fleet schedules. + class FleetSchedulesV2Response + include BaseGenericModel + + # Array of schedules for the organization. + attr_reader :data + + # Metadata for the v2 list of schedules 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' => :'Array', + :'meta' => :'FleetSchedulesV2ResponseMeta' + } + 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::FleetSchedulesV2Response` 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') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + 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_deployments_response_meta.rb b/lib/datadog_api_client/v2/models/fleet_schedules_v2_response_meta.rb similarity index 91% rename from lib/datadog_api_client/v2/models/fleet_deployments_response_meta.rb rename to lib/datadog_api_client/v2/models/fleet_schedules_v2_response_meta.rb index c1751676a0de..53325a414155 100644 --- a/lib/datadog_api_client/v2/models/fleet_deployments_response_meta.rb +++ b/lib/datadog_api_client/v2/models/fleet_schedules_v2_response_meta.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Metadata for the list of deployments, including pagination information. - class FleetDeploymentsResponseMeta + # Metadata for the v2 list of schedules response. + class FleetSchedulesV2ResponseMeta include BaseGenericModel - # Pagination details for the list of deployments. + # Pagination details for the v2 list of schedules. attr_accessor :page attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'page' => :'FleetDeploymentsPage' + :'page' => :'FleetSchedulesV2Page' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetDeploymentsResponseMeta` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FleetSchedulesV2ResponseMeta` initialize method" end self.additional_properties = {}