diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 051a69bc0246..fa4685af5cfe 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -1904,6 +1904,67 @@ components: type: string x-enum-varnames: - DATA_PROJECTION + DatasetListQuery: + description: Query that lists the rows of a published dataset (a DDSQL query) without aggregation. + properties: + data_source: + $ref: "#/components/schemas/DatasetListQueryDataSourceType" + dataset_id: + description: ID of the published dataset to query. + example: "abc-123-def" + type: string + dataset_provider: + $ref: "#/components/schemas/PublishedDatasetProvider" + filter: + description: Filter applied to the dataset's rows, using events-style search syntax. + example: "service:web-store" + type: string + limit: + description: Maximum number of rows to return from the dataset query. + format: int64 + type: integer + sort: + $ref: "#/components/schemas/DatasetListQuerySort" + required: + - data_source + - dataset_provider + - dataset_id + type: object + DatasetListQueryDataSourceType: + description: Identifies this as a published-dataset list query. + enum: + - dataset + example: dataset + type: string + x-enum-varnames: + - DATASET + DatasetListQuerySort: + description: Sort configuration for a `DatasetListQuery`. + properties: + fields: + description: List of fields to sort the rows by, applied in order. + example: + - name: cpu_usage + order: desc + items: + $ref: "#/components/schemas/DatasetListQuerySortField" + type: array + required: + - fields + type: object + DatasetListQuerySortField: + description: A single sort directive for a `DatasetListQuery`. + properties: + name: + description: Name of the field to sort on. + example: duration + type: string + order: + $ref: "#/components/schemas/QuerySortOrder" + required: + - name + - order + type: object DeleteSharedDashboardResponse: description: Response containing token of deleted shared dashboard. properties: @@ -4492,7 +4553,9 @@ components: type: integer type: object HostMapRequest: - description: Updated host map. + deprecated: true + description: >- + Deprecated - Legacy metric-based host map request. Use the infrastructure-backed (`request_type: infrastructure_hostmap`) or DDSQL (`request_type: data_projection`) format instead. properties: apm_query: $ref: "#/components/schemas/LogQueryDefinition" @@ -4542,32 +4605,46 @@ components: description: The description of the widget. type: string group: - description: List of tag prefixes to group by. + deprecated: true + description: >- + Deprecated - Only used by the legacy metric-based format. Use `group_by` (infrastructure) or a `group` dimension (DDSQL) inside `requests` instead. items: description: Tag prefixes. type: string type: array no_group_hosts: - description: Whether to show the hosts that don’t fit in a group. + deprecated: true + description: >- + Deprecated - Only used by the legacy metric-based format. Use `no_group_hosts` inside `requests` instead. type: boolean no_metric_hosts: - description: Whether to show the hosts with no metrics. + deprecated: true + description: >- + Deprecated - Only used by the legacy metric-based format. Use `no_metric_hosts` inside `requests` instead. type: boolean node_type: $ref: "#/components/schemas/WidgetNodeType" + deprecated: true + description: >- + Deprecated - Only used by the legacy metric-based format. Use `node_type` inside `requests` instead. notes: description: Notes on the title. type: string requests: $ref: "#/components/schemas/HostMapWidgetDefinitionRequests" scope: - description: List of tags used to filter the map. + deprecated: true + description: >- + Deprecated - Only used by the legacy metric-based format. Use `filter` inside `requests` instead. items: description: Tags. type: string type: array style: $ref: "#/components/schemas/HostMapWidgetDefinitionStyle" + deprecated: true + description: >- + Deprecated - Only used by the legacy metric-based format. Use `style` inside `requests` instead. title: description: Title of the widget. type: string @@ -4582,20 +4659,33 @@ components: - type - requests type: object + HostMapWidgetDefinitionRequestType: + description: >- + Identifies which host map request format the sibling fields on `HostMapWidgetDefinitionRequests` describe: an infrastructure-backed request or a DDSQL published-dataset request. + enum: + - infrastructure_hostmap + - data_projection + example: infrastructure_hostmap + type: string + x-enum-varnames: + - INFRASTRUCTURE_HOSTMAP + - DATA_PROJECTION HostMapWidgetDefinitionRequests: description: >- - Query definition for the host map widget. Supports two mutually exclusive formats distinguished by the presence of `request_type`: the legacy metric-based format (`fill`/`size`) and the infrastructure-backed format (`request_type`, `node_type`, `enrichments`). + Query definition for the host map widget. Supports three mutually exclusive formats distinguished by `request_type`: the deprecated legacy metric-based format (`fill`/`size`, no `request_type`), the infrastructure-backed format (`request_type: infrastructure_hostmap`), and the DDSQL published-dataset format (`request_type: data_projection`). example: {} properties: child: $ref: "#/components/schemas/HostMapWidgetInfrastructureRequest" + description: Optional child entities for hierarchical visualization (for example, host → container). Only used by the infrastructure-backed format. conditional_formats: description: List of conditional formatting rules applied to fill values. items: $ref: "#/components/schemas/WidgetConditionalFormat" type: array enrichments: - description: Metric or event queries joined to the entity set. Each formula specifies a visual dimension. + description: >- + Metric or event queries joined to the entity set. Each formula specifies a visual dimension. Only used by the infrastructure-backed format. example: - formulas: - dimension: fill @@ -4610,17 +4700,25 @@ components: type: array fill: $ref: "#/components/schemas/HostMapRequest" + deprecated: true + description: >- + Deprecated - Legacy metric-based format. Use the infrastructure-backed (`request_type: infrastructure_hostmap`) or DDSQL (`request_type: data_projection`) format instead. filter: - description: Filter string for the entity set in tag format (for example, `env:prod`). + description: >- + Filter string for the entity set in tag format (for example, `env:prod`). Only used by the infrastructure-backed format. example: "env:prod" type: string group_by: description: |- Defines how entities are grouped into tiles. The ordering of entries implies - the grouping hierarchy. + the grouping hierarchy. Only used by the infrastructure-backed format. items: $ref: "#/components/schemas/HostMapWidgetGroupBy" type: array + limit: + description: Maximum number of rows to return from the dataset query. Only used by the DDSQL format. + format: int64 + type: integer no_group_hosts: description: Whether to hide entities that have no group assignment. type: boolean @@ -4629,15 +4727,28 @@ components: type: boolean node_type: $ref: "#/components/schemas/HostMapWidgetNodeType" + description: Entity type to visualize. Only used by the infrastructure-backed format. + projection: + $ref: "#/components/schemas/HostMapWidgetProjection" + description: >- + Maps dataset columns to map dimensions (entity, optional parent for grouping, fill, size). Only used by the DDSQL format. + query: + $ref: "#/components/schemas/DatasetListQuery" + description: Published-dataset query. Only used by the DDSQL format. request_type: - $ref: "#/components/schemas/HostMapWidgetInfrastructureRequestRequestType" + $ref: "#/components/schemas/HostMapWidgetDefinitionRequestType" size: $ref: "#/components/schemas/HostMapRequest" + deprecated: true + description: >- + Deprecated - Legacy metric-based format. Use the infrastructure-backed (`request_type: infrastructure_hostmap`) or DDSQL (`request_type: data_projection`) format instead. style: $ref: "#/components/schemas/HostMapWidgetInfrastructureStyle" type: object HostMapWidgetDefinitionStyle: - description: The style to apply to the widget. + deprecated: true + description: >- + Deprecated - The style to apply to the legacy metric-based host map widget. Use `HostMapWidgetInfrastructureStyle` instead. properties: fill_max: description: Max value to use to color the map. @@ -4662,17 +4773,20 @@ components: x-enum-varnames: - HOSTMAP HostMapWidgetDimension: - description: Visual dimension driven by a formula in the infrastructure host map widget. + description: >- + Visual dimension for the host map widget. Used both by infrastructure-backed formulas and by DDSQL projection columns; `group` is only meaningful for DDSQL projection columns, where repeated entries define the grouping hierarchy. enum: - node - fill - size + - group example: node type: string x-enum-varnames: - NODE - FILL - SIZE + - GROUP HostMapWidgetFormula: description: |- Formula for the infrastructure host map widget that specifies both the expression @@ -4857,6 +4971,54 @@ components: - CONTAINER - POD - CLUSTER + HostMapWidgetProjection: + description: >- + Projection for the DDSQL host map request. Maps dataset columns to map dimensions: `node` identifies the entity, repeated `group` entries define the grouping hierarchy (outermost first), and `fill`/`size` drive the tile color and size. + properties: + dimensions: + description: List of column-to-dimension mappings for the projection. + example: + - column: entity_id + dimension: node + - column: parent_id + dimension: group + - column: cpu_usage + dimension: fill + items: + $ref: "#/components/schemas/HostMapWidgetProjectionDimensionMapping" + type: array + type: + $ref: "#/components/schemas/HostMapWidgetProjectionType" + required: + - type + - dimensions + type: object + HostMapWidgetProjectionDimensionMapping: + description: Maps a dataset column to a host map visual dimension. + properties: + alias: + description: Alias used to label the column instead of its name. + type: string + column: + description: Source column name from the dataset. + example: entity_id + type: string + dimension: + $ref: "#/components/schemas/HostMapWidgetDimension" + number_format: + $ref: "#/components/schemas/WidgetNumberFormat" + required: + - column + - dimension + type: object + HostMapWidgetProjectionType: + description: Type of the host map projection. + enum: + - hostmap + example: hostmap + type: string + x-enum-varnames: + - HOSTMAP HostMapWidgetScalarRequest: description: |- Scalar formula request for the infrastructure host map widget. Each formula specifies @@ -12635,12 +12797,22 @@ components: - type - requests type: object + PublishedDatasetProvider: + description: >- + Product page that published the dataset queried by a `DatasetListQuery`. `ddsql_query` is the only provider currently supported for host map widgets. + enum: + - ddsql_query + example: ddsql_query + type: string + x-enum-varnames: + - DDSQL_QUERY QuerySortOrder: default: desc description: Direction of sort. enum: - asc - desc + example: asc type: string x-enum-varnames: - ASC diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-hostmap-DDSQL-widget.frozen b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-hostmap-DDSQL-widget.frozen new file mode 100644 index 000000000000..932b74391ef5 --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-hostmap-DDSQL-widget.frozen @@ -0,0 +1 @@ +2026-07-08T15:57:41.949Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-hostmap-DDSQL-widget.yml b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-hostmap-DDSQL-widget.yml new file mode 100644 index 000000000000..272414a591cc --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-hostmap-DDSQL-widget.yml @@ -0,0 +1,43 @@ +http_interactions: +- recorded_at: Wed, 08 Jul 2026 15:57:41 GMT + request: + body: + encoding: UTF-8 + string: '{"description":null,"layout_type":"free","notify_list":[],"template_variables":[],"title":"Test-Create_a_new_dashboard_with_hostmap_DDSQL_widget-1783526261","widgets":[{"definition":{"requests":{"limit":1000,"projection":{"dimensions":[{"column":"entity_id","dimension":"node"},{"column":"parent_id","dimension":"group"},{"column":"cpu_usage","dimension":"fill"}],"type":"hostmap"},"query":{"data_source":"dataset","dataset_id":"abc-123-def","dataset_provider":"ddsql_query"},"request_type":"data_projection","style":{"palette":"green_to_orange","palette_flip":false}},"title":"","title_align":"left","title_size":"16","type":"hostmap"},"layout":{"height":22,"width":47,"x":0,"y":0}}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard + response: + body: + encoding: UTF-8 + string: '{"id":"ei8-bm4-cy2","title":"Test-Create_a_new_dashboard_with_hostmap_DDSQL_widget-1783526261","description":null,"author_handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","author_name":"CI + Account","layout_type":"free","url":"/dashboard/ei8-bm4-cy2/test-createanewdashboardwithhostmapddsqlwidget-1783526261","template_variables":[],"widgets":[{"definition":{"requests":{"limit":1000,"projection":{"dimensions":[{"column":"entity_id","dimension":"node"},{"column":"parent_id","dimension":"group"},{"column":"cpu_usage","dimension":"fill"}],"type":"hostmap"},"query":{"data_source":"dataset","dataset_id":"abc-123-def","dataset_provider":"ddsql_query"},"request_type":"data_projection","style":{"palette":"green_to_orange","palette_flip":false}},"title":"","title_align":"left","title_size":"16","type":"hostmap"},"layout":{"height":22,"width":47,"x":0,"y":0},"id":2962556261296626}],"notify_list":[],"created_at":"2026-07-08T15:57:42.209375+00:00","modified_at":"2026-07-08T15:57:42.209375+00:00","restricted_roles":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 08 Jul 2026 15:57:41 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/ei8-bm4-cy2 + response: + body: + encoding: UTF-8 + string: '{"deleted_dashboard_id":"ei8-bm4-cy2"}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v1/dashboards/CreateDashboard_2780500284.rb b/examples/v1/dashboards/CreateDashboard_2780500284.rb new file mode 100644 index 000000000000..55a2f17e3860 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_2780500284.rb @@ -0,0 +1,59 @@ +# Create a new dashboard with hostmap DDSQL widget + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::DashboardsAPI.new + +body = DatadogAPIClient::V1::Dashboard.new({ + title: "Example-Dashboard", + description: nil, + widgets: [ + DatadogAPIClient::V1::Widget.new({ + layout: DatadogAPIClient::V1::WidgetLayout.new({ + x: 0, + y: 0, + width: 47, + height: 22, + }), + definition: DatadogAPIClient::V1::HostMapWidgetDefinition.new({ + title: "", + title_size: "16", + title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT, + type: DatadogAPIClient::V1::HostMapWidgetDefinitionType::HOSTMAP, + requests: DatadogAPIClient::V1::HostMapWidgetDefinitionRequests.new({ + request_type: DatadogAPIClient::V1::HostMapWidgetDefinitionRequestType::DATA_PROJECTION, + limit: 1000, + query: DatadogAPIClient::V1::DatasetListQuery.new({ + data_source: DatadogAPIClient::V1::DatasetListQueryDataSourceType::DATASET, + dataset_provider: DatadogAPIClient::V1::PublishedDatasetProvider::DDSQL_QUERY, + dataset_id: "abc-123-def", + }), + projection: DatadogAPIClient::V1::HostMapWidgetProjection.new({ + type: DatadogAPIClient::V1::HostMapWidgetProjectionType::HOSTMAP, + dimensions: [ + DatadogAPIClient::V1::HostMapWidgetProjectionDimensionMapping.new({ + column: "entity_id", + dimension: DatadogAPIClient::V1::HostMapWidgetDimension::NODE, + }), + DatadogAPIClient::V1::HostMapWidgetProjectionDimensionMapping.new({ + column: "parent_id", + dimension: DatadogAPIClient::V1::HostMapWidgetDimension::GROUP, + }), + DatadogAPIClient::V1::HostMapWidgetProjectionDimensionMapping.new({ + column: "cpu_usage", + dimension: DatadogAPIClient::V1::HostMapWidgetDimension::FILL, + }), + ], + }), + style: DatadogAPIClient::V1::HostMapWidgetInfrastructureStyle.new({ + palette: "green_to_orange", + palette_flip: false, + }), + }), + }), + }), + ], + template_variables: [], + layout_type: DatadogAPIClient::V1::DashboardLayoutType::FREE, + notify_list: [], +}) +p api_instance.create_dashboard(body) diff --git a/examples/v1/dashboards/CreateDashboard_2882802132.rb b/examples/v1/dashboards/CreateDashboard_2882802132.rb index ab06ce5fae5d..8ba50ff3d3f6 100644 --- a/examples/v1/dashboards/CreateDashboard_2882802132.rb +++ b/examples/v1/dashboards/CreateDashboard_2882802132.rb @@ -20,7 +20,7 @@ title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT, type: DatadogAPIClient::V1::HostMapWidgetDefinitionType::HOSTMAP, requests: DatadogAPIClient::V1::HostMapWidgetDefinitionRequests.new({ - request_type: DatadogAPIClient::V1::HostMapWidgetInfrastructureRequestRequestType::INFRASTRUCTURE_HOSTMAP, + request_type: DatadogAPIClient::V1::HostMapWidgetDefinitionRequestType::INFRASTRUCTURE_HOSTMAP, node_type: DatadogAPIClient::V1::HostMapWidgetNodeType::HOST, filter: "env:prod", group_by: [ diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index 42df30e0a6f3..28e57ec5e2a7 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -581,6 +581,15 @@ Feature: Dashboards And the response "widgets[0].definition.xaxis.num_buckets" is equal to 75 And the response "widgets[0].definition.markers" is equal to [{"display_type": "percentile", "value": "50"}, {"display_type": "percentile", "value": "99"}] + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with hostmap DDSQL widget + Given new "CreateDashboard" request + And body from file "dashboards_json_payload/hostmap_ddsql_widget.json" + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "hostmap" + And the response "widgets[0].definition.requests" is equal to {"request_type": "data_projection", "limit": 1000, "query": {"data_source": "dataset", "dataset_provider": "ddsql_query", "dataset_id": "abc-123-def"}, "projection": {"type": "hostmap", "dimensions": [{"column": "entity_id", "dimension": "node"}, {"column": "parent_id", "dimension": "group"}, {"column": "cpu_usage", "dimension": "fill"}]}, "style": {"palette": "green_to_orange", "palette_flip": false}} + @team:DataDog/dashboards-backend Scenario: Create a new dashboard with hostmap infra widget Given new "CreateDashboard" request diff --git a/features/v1/dashboards_json_payload/hostmap_ddsql_widget.json b/features/v1/dashboards_json_payload/hostmap_ddsql_widget.json new file mode 100644 index 000000000000..51cc5936b85a --- /dev/null +++ b/features/v1/dashboards_json_payload/hostmap_ddsql_widget.json @@ -0,0 +1,57 @@ +{ + "title":"{{ unique }}", + "description":null, + "widgets":[ + { + "layout":{ + "x":0, + "y":0, + "width":47, + "height":22 + }, + "definition":{ + "title":"", + "title_size":"16", + "title_align":"left", + "type":"hostmap", + "requests":{ + "request_type":"data_projection", + "limit":1000, + "query":{ + "data_source":"dataset", + "dataset_provider":"ddsql_query", + "dataset_id":"abc-123-def" + }, + "projection":{ + "type":"hostmap", + "dimensions":[ + { + "column":"entity_id", + "dimension":"node" + }, + { + "column":"parent_id", + "dimension":"group" + }, + { + "column":"cpu_usage", + "dimension":"fill" + } + ] + }, + "style":{ + "palette":"green_to_orange", + "palette_flip":false + } + } + } + } + ], + "template_variables":[ + + ], + "layout_type":"free", + "notify_list":[ + + ] +} diff --git a/features/v1/monitors.feature b/features/v1/monitors.feature index eabe7b2afe77..2a34a879f759 100644 --- a/features/v1/monitors.feature +++ b/features/v1/monitors.feature @@ -219,7 +219,7 @@ Feature: Monitors Scenario: Edit a monitor returns "Bad Request" response Given new "UpdateMonitor" request And request contains "monitor_id" parameter from "REPLACE.ME" - And body with value {"assets": [{"category": "runbook", "name": "Monitor Runbook", "resource_key": "12345", "resource_type": "notebook", "url": "/notebooks/12345"}], "draft_status": "published", "options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_query": "formula(\"2 * query1\").rollup(\"avg\").last(\"6mo\")", "critical_recovery": null, "critical_recovery_query": "formula(\"1.5 * query1\").rollup(\"avg\").last(\"3mo\")", "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration", "name": "compute_result", "source": "filter_query"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}, "source": "filter_query"}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"} + And body with value {"assets": [{"category": "runbook", "name": "Monitor Runbook", "resource_key": "12345", "resource_type": "notebook", "url": "/notebooks/12345"}], "draft_status": "published", "options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_query": "formula(\"2 * query1\").rollup(\"avg\").last(\"6mo\")", "critical_recovery": null, "critical_recovery_query": "formula(\"1.5 * query1\").rollup(\"avg\").last(\"3mo\")", "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration", "name": "compute_result", "source": "filter_query"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "asc"}, "source": "filter_query"}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"} When the request is sent Then the response status is 400 Bad Request diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index cdff09d5da7f..a6243822026a 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -108,6 +108,10 @@ def overrides "v1.dashboard_type" => "DashboardType", "v1.data_projection_query" => "DataProjectionQuery", "v1.data_projection_request_type" => "DataProjectionRequestType", + "v1.dataset_list_query" => "DatasetListQuery", + "v1.dataset_list_query_data_source_type" => "DatasetListQueryDataSourceType", + "v1.dataset_list_query_sort" => "DatasetListQuerySort", + "v1.dataset_list_query_sort_field" => "DatasetListQuerySortField", "v1.deleted_monitor" => "DeletedMonitor", "v1.delete_shared_dashboard_response" => "DeleteSharedDashboardResponse", "v1.distribution_point_item" => "DistributionPointItem", @@ -213,6 +217,7 @@ def overrides "v1.host_map_request" => "HostMapRequest", "v1.host_map_widget_definition" => "HostMapWidgetDefinition", "v1.host_map_widget_definition_requests" => "HostMapWidgetDefinitionRequests", + "v1.host_map_widget_definition_request_type" => "HostMapWidgetDefinitionRequestType", "v1.host_map_widget_definition_style" => "HostMapWidgetDefinitionStyle", "v1.host_map_widget_definition_type" => "HostMapWidgetDefinitionType", "v1.host_map_widget_dimension" => "HostMapWidgetDimension", @@ -223,6 +228,9 @@ def overrides "v1.host_map_widget_infrastructure_request_request_type" => "HostMapWidgetInfrastructureRequestRequestType", "v1.host_map_widget_infrastructure_style" => "HostMapWidgetInfrastructureStyle", "v1.host_map_widget_node_type" => "HostMapWidgetNodeType", + "v1.host_map_widget_projection" => "HostMapWidgetProjection", + "v1.host_map_widget_projection_dimension_mapping" => "HostMapWidgetProjectionDimensionMapping", + "v1.host_map_widget_projection_type" => "HostMapWidgetProjectionType", "v1.host_map_widget_scalar_request" => "HostMapWidgetScalarRequest", "v1.host_map_widget_scalar_request_response_format" => "HostMapWidgetScalarRequestResponseFormat", "v1.host_meta" => "HostMeta", @@ -555,6 +563,7 @@ def overrides "v1.product_analytics_funnel_request" => "ProductAnalyticsFunnelRequest", "v1.product_analytics_funnel_request_type" => "ProductAnalyticsFunnelRequestType", "v1.product_analytics_funnel_widget_definition" => "ProductAnalyticsFunnelWidgetDefinition", + "v1.published_dataset_provider" => "PublishedDatasetProvider", "v1.query_sort_order" => "QuerySortOrder", "v1.query_value_widget_comparison" => "QueryValueWidgetComparison", "v1.query_value_widget_comparison_directionality" => "QueryValueWidgetComparisonDirectionality", diff --git a/lib/datadog_api_client/v1/models/dataset_list_query.rb b/lib/datadog_api_client/v1/models/dataset_list_query.rb new file mode 100644 index 000000000000..013cc804bf99 --- /dev/null +++ b/lib/datadog_api_client/v1/models/dataset_list_query.rb @@ -0,0 +1,195 @@ +=begin +#Datadog API V1 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::V1 + # Query that lists the rows of a published dataset (a DDSQL query) without aggregation. + class DatasetListQuery + include BaseGenericModel + + # Identifies this as a published-dataset list query. + attr_reader :data_source + + # ID of the published dataset to query. + attr_reader :dataset_id + + # Product page that published the dataset queried by a `DatasetListQuery`. `ddsql_query` is the only provider currently supported for host map widgets. + attr_reader :dataset_provider + + # Filter applied to the dataset's rows, using events-style search syntax. + attr_accessor :filter + + # Maximum number of rows to return from the dataset query. + attr_accessor :limit + + # Sort configuration for a `DatasetListQuery`. + attr_accessor :sort + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_source' => :'data_source', + :'dataset_id' => :'dataset_id', + :'dataset_provider' => :'dataset_provider', + :'filter' => :'filter', + :'limit' => :'limit', + :'sort' => :'sort' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_source' => :'DatasetListQueryDataSourceType', + :'dataset_id' => :'String', + :'dataset_provider' => :'PublishedDatasetProvider', + :'filter' => :'String', + :'limit' => :'Integer', + :'sort' => :'DatasetListQuerySort' + } + 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::V1::DatasetListQuery` 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_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'dataset_id') + self.dataset_id = attributes[:'dataset_id'] + end + + if attributes.key?(:'dataset_provider') + self.dataset_provider = attributes[:'dataset_provider'] + end + + if attributes.key?(:'filter') + self.filter = attributes[:'filter'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'sort') + self.sort = attributes[:'sort'] + 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_source.nil? + return false if @dataset_id.nil? + return false if @dataset_provider.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param dataset_id [Object] Object to be assigned + # @!visibility private + def dataset_id=(dataset_id) + if dataset_id.nil? + fail ArgumentError, 'invalid value for "dataset_id", dataset_id cannot be nil.' + end + @dataset_id = dataset_id + end + + # Custom attribute writer method with validation + # @param dataset_provider [Object] Object to be assigned + # @!visibility private + def dataset_provider=(dataset_provider) + if dataset_provider.nil? + fail ArgumentError, 'invalid value for "dataset_provider", dataset_provider cannot be nil.' + end + @dataset_provider = dataset_provider + 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_source == o.data_source && + dataset_id == o.dataset_id && + dataset_provider == o.dataset_provider && + filter == o.filter && + limit == o.limit && + sort == o.sort && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_source, dataset_id, dataset_provider, filter, limit, sort, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/dataset_list_query_data_source_type.rb b/lib/datadog_api_client/v1/models/dataset_list_query_data_source_type.rb new file mode 100644 index 000000000000..2523e05eee03 --- /dev/null +++ b/lib/datadog_api_client/v1/models/dataset_list_query_data_source_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 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::V1 + # Identifies this as a published-dataset list query. + class DatasetListQueryDataSourceType + include BaseEnumModel + + DATASET = "dataset".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/dataset_list_query_sort.rb b/lib/datadog_api_client/v1/models/dataset_list_query_sort.rb new file mode 100644 index 000000000000..912173e15c45 --- /dev/null +++ b/lib/datadog_api_client/v1/models/dataset_list_query_sort.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V1 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::V1 + # Sort configuration for a `DatasetListQuery`. + class DatasetListQuerySort + include BaseGenericModel + + # List of fields to sort the rows by, applied in order. + attr_reader :fields + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fields' => :'fields' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fields' => :'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::V1::DatasetListQuerySort` 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?(:'fields') + if (value = attributes[:'fields']).is_a?(Array) + self.fields = value + end + 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 @fields.nil? + true + end + + # Custom attribute writer method with validation + # @param fields [Object] Object to be assigned + # @!visibility private + def fields=(fields) + if fields.nil? + fail ArgumentError, 'invalid value for "fields", fields cannot be nil.' + end + @fields = fields + 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 && + fields == o.fields && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fields, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/dataset_list_query_sort_field.rb b/lib/datadog_api_client/v1/models/dataset_list_query_sort_field.rb new file mode 100644 index 000000000000..65890a7d932e --- /dev/null +++ b/lib/datadog_api_client/v1/models/dataset_list_query_sort_field.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V1 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::V1 + # A single sort directive for a `DatasetListQuery`. + class DatasetListQuerySortField + include BaseGenericModel + + # Name of the field to sort on. + attr_reader :name + + # Direction of sort. + attr_reader :order + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'order' => :'order' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'order' => :'QuerySortOrder' + } + 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::V1::DatasetListQuerySortField` 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?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'order') + self.order = attributes[:'order'] + 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 @order.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 order [Object] Object to be assigned + # @!visibility private + def order=(order) + if order.nil? + fail ArgumentError, 'invalid value for "order", order cannot be nil.' + end + @order = order + 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 && + name == o.name && + order == o.order && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, order, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/host_map_request.rb b/lib/datadog_api_client/v1/models/host_map_request.rb index c6fa9a8acf23..8c7ba2f5acc0 100644 --- a/lib/datadog_api_client/v1/models/host_map_request.rb +++ b/lib/datadog_api_client/v1/models/host_map_request.rb @@ -17,7 +17,9 @@ require 'time' module DatadogAPIClient::V1 - # Updated host map. + # Deprecated - Legacy metric-based host map request. Use the infrastructure-backed (`request_type: infrastructure_hostmap`) or DDSQL (`request_type: data_projection`) format instead. + # + # @deprecated This model is deprecated. class HostMapRequest include BaseGenericModel @@ -86,6 +88,7 @@ def self.openapi_types # @param attributes [Hash] Model attributes in the form of hash # @!visibility private def initialize(attributes = {}) + warn "[DEPRECATION] `HostMapRequest` is deprecated." if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::HostMapRequest` initialize method" end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_definition.rb b/lib/datadog_api_client/v1/models/host_map_widget_definition.rb index fef4bb756104..5a92b3784e64 100644 --- a/lib/datadog_api_client/v1/models/host_map_widget_definition.rb +++ b/lib/datadog_api_client/v1/models/host_map_widget_definition.rb @@ -27,13 +27,13 @@ class HostMapWidgetDefinition # The description of the widget. attr_accessor :description - # List of tag prefixes to group by. + # Deprecated - Only used by the legacy metric-based format. Use `group_by` (infrastructure) or a `group` dimension (DDSQL) inside `requests` instead. attr_accessor :group - # Whether to show the hosts that don’t fit in a group. + # Deprecated - Only used by the legacy metric-based format. Use `no_group_hosts` inside `requests` instead. attr_accessor :no_group_hosts - # Whether to show the hosts with no metrics. + # Deprecated - Only used by the legacy metric-based format. Use `no_metric_hosts` inside `requests` instead. attr_accessor :no_metric_hosts # Which type of node to use in the map. @@ -42,13 +42,13 @@ class HostMapWidgetDefinition # Notes on the title. attr_accessor :notes - # Query definition for the host map widget. Supports two mutually exclusive formats distinguished by the presence of `request_type`: the legacy metric-based format (`fill`/`size`) and the infrastructure-backed format (`request_type`, `node_type`, `enrichments`). + # Query definition for the host map widget. Supports three mutually exclusive formats distinguished by `request_type`: the deprecated legacy metric-based format (`fill`/`size`, no `request_type`), the infrastructure-backed format (`request_type: infrastructure_hostmap`), and the DDSQL published-dataset format (`request_type: data_projection`). attr_reader :requests - # List of tags used to filter the map. + # Deprecated - Only used by the legacy metric-based format. Use `filter` inside `requests` instead. attr_accessor :scope - # The style to apply to the widget. + # Deprecated - The style to apply to the legacy metric-based host map widget. Use `HostMapWidgetInfrastructureStyle` instead. attr_accessor :style # Title of the widget. diff --git a/lib/datadog_api_client/v1/models/host_map_widget_definition_request_type.rb b/lib/datadog_api_client/v1/models/host_map_widget_definition_request_type.rb new file mode 100644 index 000000000000..ffffa4805239 --- /dev/null +++ b/lib/datadog_api_client/v1/models/host_map_widget_definition_request_type.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V1 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::V1 + # Identifies which host map request format the sibling fields on `HostMapWidgetDefinitionRequests` describe: an infrastructure-backed request or a DDSQL published-dataset request. + class HostMapWidgetDefinitionRequestType + include BaseEnumModel + + INFRASTRUCTURE_HOSTMAP = "infrastructure_hostmap".freeze + DATA_PROJECTION = "data_projection".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_definition_requests.rb b/lib/datadog_api_client/v1/models/host_map_widget_definition_requests.rb index 5ee4d043f4c3..7ee9f43eac04 100644 --- a/lib/datadog_api_client/v1/models/host_map_widget_definition_requests.rb +++ b/lib/datadog_api_client/v1/models/host_map_widget_definition_requests.rb @@ -17,7 +17,7 @@ require 'time' module DatadogAPIClient::V1 - # Query definition for the host map widget. Supports two mutually exclusive formats distinguished by the presence of `request_type`: the legacy metric-based format (`fill`/`size`) and the infrastructure-backed format (`request_type`, `node_type`, `enrichments`). + # Query definition for the host map widget. Supports three mutually exclusive formats distinguished by `request_type`: the deprecated legacy metric-based format (`fill`/`size`, no `request_type`), the infrastructure-backed format (`request_type: infrastructure_hostmap`), and the DDSQL published-dataset format (`request_type: data_projection`). class HostMapWidgetDefinitionRequests include BaseGenericModel @@ -29,19 +29,22 @@ class HostMapWidgetDefinitionRequests # List of conditional formatting rules applied to fill values. attr_accessor :conditional_formats - # Metric or event queries joined to the entity set. Each formula specifies a visual dimension. + # Metric or event queries joined to the entity set. Each formula specifies a visual dimension. Only used by the infrastructure-backed format. attr_accessor :enrichments - # Updated host map. + # Deprecated - Legacy metric-based host map request. Use the infrastructure-backed (`request_type: infrastructure_hostmap`) or DDSQL (`request_type: data_projection`) format instead. attr_accessor :fill - # Filter string for the entity set in tag format (for example, `env:prod`). + # Filter string for the entity set in tag format (for example, `env:prod`). Only used by the infrastructure-backed format. attr_accessor :filter # Defines how entities are grouped into tiles. The ordering of entries implies - # the grouping hierarchy. + # the grouping hierarchy. Only used by the infrastructure-backed format. attr_accessor :group_by + # Maximum number of rows to return from the dataset query. Only used by the DDSQL format. + attr_accessor :limit + # Whether to hide entities that have no group assignment. attr_accessor :no_group_hosts @@ -51,10 +54,16 @@ class HostMapWidgetDefinitionRequests # Which type of infrastructure entity to visualize in the host map. attr_accessor :node_type - # Identifies this as an infrastructure-backed host map request. + # Projection for the DDSQL host map request. Maps dataset columns to map dimensions: `node` identifies the entity, repeated `group` entries define the grouping hierarchy (outermost first), and `fill`/`size` drive the tile color and size. + attr_accessor :projection + + # Query that lists the rows of a published dataset (a DDSQL query) without aggregation. + attr_accessor :query + + # Identifies which host map request format the sibling fields on `HostMapWidgetDefinitionRequests` describe: an infrastructure-backed request or a DDSQL published-dataset request. attr_accessor :request_type - # Updated host map. + # Deprecated - Legacy metric-based host map request. Use the infrastructure-backed (`request_type: infrastructure_hostmap`) or DDSQL (`request_type: data_projection`) format instead. attr_accessor :size # Style configuration for the infrastructure host map. @@ -72,9 +81,12 @@ def self.attribute_map :'fill' => :'fill', :'filter' => :'filter', :'group_by' => :'group_by', + :'limit' => :'limit', :'no_group_hosts' => :'no_group_hosts', :'no_metric_hosts' => :'no_metric_hosts', :'node_type' => :'node_type', + :'projection' => :'projection', + :'query' => :'query', :'request_type' => :'request_type', :'size' => :'size', :'style' => :'style' @@ -91,10 +103,13 @@ def self.openapi_types :'fill' => :'HostMapRequest', :'filter' => :'String', :'group_by' => :'Array', + :'limit' => :'Integer', :'no_group_hosts' => :'Boolean', :'no_metric_hosts' => :'Boolean', :'node_type' => :'HostMapWidgetNodeType', - :'request_type' => :'HostMapWidgetInfrastructureRequestRequestType', + :'projection' => :'HostMapWidgetProjection', + :'query' => :'DatasetListQuery', + :'request_type' => :'HostMapWidgetDefinitionRequestType', :'size' => :'HostMapRequest', :'style' => :'HostMapWidgetInfrastructureStyle' } @@ -148,6 +163,10 @@ def initialize(attributes = {}) end end + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + if attributes.key?(:'no_group_hosts') self.no_group_hosts = attributes[:'no_group_hosts'] end @@ -160,6 +179,14 @@ def initialize(attributes = {}) self.node_type = attributes[:'node_type'] end + if attributes.key?(:'projection') + self.projection = attributes[:'projection'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + if attributes.key?(:'request_type') self.request_type = attributes[:'request_type'] end @@ -205,9 +232,12 @@ def ==(o) fill == o.fill && filter == o.filter && group_by == o.group_by && + limit == o.limit && no_group_hosts == o.no_group_hosts && no_metric_hosts == o.no_metric_hosts && node_type == o.node_type && + projection == o.projection && + query == o.query && request_type == o.request_type && size == o.size && style == o.style && @@ -218,7 +248,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [child, conditional_formats, enrichments, fill, filter, group_by, no_group_hosts, no_metric_hosts, node_type, request_type, size, style, additional_properties].hash + [child, conditional_formats, enrichments, fill, filter, group_by, limit, no_group_hosts, no_metric_hosts, node_type, projection, query, request_type, size, style, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_definition_style.rb b/lib/datadog_api_client/v1/models/host_map_widget_definition_style.rb index 7f25502e201d..89f992378cd7 100644 --- a/lib/datadog_api_client/v1/models/host_map_widget_definition_style.rb +++ b/lib/datadog_api_client/v1/models/host_map_widget_definition_style.rb @@ -17,7 +17,9 @@ require 'time' module DatadogAPIClient::V1 - # The style to apply to the widget. + # Deprecated - The style to apply to the legacy metric-based host map widget. Use `HostMapWidgetInfrastructureStyle` instead. + # + # @deprecated This model is deprecated. class HostMapWidgetDefinitionStyle include BaseGenericModel @@ -61,6 +63,7 @@ def self.openapi_types # @param attributes [Hash] Model attributes in the form of hash # @!visibility private def initialize(attributes = {}) + warn "[DEPRECATION] `HostMapWidgetDefinitionStyle` is deprecated." if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::HostMapWidgetDefinitionStyle` initialize method" end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_dimension.rb b/lib/datadog_api_client/v1/models/host_map_widget_dimension.rb index 19b125a5684e..e63a2a6250c1 100644 --- a/lib/datadog_api_client/v1/models/host_map_widget_dimension.rb +++ b/lib/datadog_api_client/v1/models/host_map_widget_dimension.rb @@ -17,12 +17,13 @@ require 'time' module DatadogAPIClient::V1 - # Visual dimension driven by a formula in the infrastructure host map widget. + # Visual dimension for the host map widget. Used both by infrastructure-backed formulas and by DDSQL projection columns; `group` is only meaningful for DDSQL projection columns, where repeated entries define the grouping hierarchy. class HostMapWidgetDimension include BaseEnumModel NODE = "node".freeze FILL = "fill".freeze SIZE = "size".freeze + GROUP = "group".freeze end end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_formula.rb b/lib/datadog_api_client/v1/models/host_map_widget_formula.rb index bfff55f8cc18..7225c49dd5b9 100644 --- a/lib/datadog_api_client/v1/models/host_map_widget_formula.rb +++ b/lib/datadog_api_client/v1/models/host_map_widget_formula.rb @@ -25,7 +25,7 @@ class HostMapWidgetFormula # Expression alias. attr_accessor :_alias - # Visual dimension driven by a formula in the infrastructure host map widget. + # Visual dimension for the host map widget. Used both by infrastructure-backed formulas and by DDSQL projection columns; `group` is only meaningful for DDSQL projection columns, where repeated entries define the grouping hierarchy. attr_reader :dimension # String expression built from queries, formulas, and functions. diff --git a/lib/datadog_api_client/v1/models/host_map_widget_projection.rb b/lib/datadog_api_client/v1/models/host_map_widget_projection.rb new file mode 100644 index 000000000000..084116c74a1e --- /dev/null +++ b/lib/datadog_api_client/v1/models/host_map_widget_projection.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V1 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::V1 + # Projection for the DDSQL host map request. Maps dataset columns to map dimensions: `node` identifies the entity, repeated `group` entries define the grouping hierarchy (outermost first), and `fill`/`size` drive the tile color and size. + class HostMapWidgetProjection + include BaseGenericModel + + # List of column-to-dimension mappings for the projection. + attr_reader :dimensions + + # Type of the host map projection. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dimensions' => :'dimensions', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dimensions' => :'Array', + :'type' => :'HostMapWidgetProjectionType' + } + 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::V1::HostMapWidgetProjection` 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?(:'dimensions') + if (value = attributes[:'dimensions']).is_a?(Array) + self.dimensions = value + end + 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 @dimensions.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param dimensions [Object] Object to be assigned + # @!visibility private + def dimensions=(dimensions) + if dimensions.nil? + fail ArgumentError, 'invalid value for "dimensions", dimensions cannot be nil.' + end + @dimensions = dimensions + 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 && + dimensions == o.dimensions && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dimensions, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_projection_dimension_mapping.rb b/lib/datadog_api_client/v1/models/host_map_widget_projection_dimension_mapping.rb new file mode 100644 index 000000000000..6ccc640962ab --- /dev/null +++ b/lib/datadog_api_client/v1/models/host_map_widget_projection_dimension_mapping.rb @@ -0,0 +1,164 @@ +=begin +#Datadog API V1 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::V1 + # Maps a dataset column to a host map visual dimension. + class HostMapWidgetProjectionDimensionMapping + include BaseGenericModel + + # Alias used to label the column instead of its name. + attr_accessor :_alias + + # Source column name from the dataset. + attr_reader :column + + # Visual dimension for the host map widget. Used both by infrastructure-backed formulas and by DDSQL projection columns; `group` is only meaningful for DDSQL projection columns, where repeated entries define the grouping hierarchy. + attr_reader :dimension + + # Number format options for the widget. + attr_accessor :number_format + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_alias' => :'alias', + :'column' => :'column', + :'dimension' => :'dimension', + :'number_format' => :'number_format' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_alias' => :'String', + :'column' => :'String', + :'dimension' => :'HostMapWidgetDimension', + :'number_format' => :'WidgetNumberFormat' + } + 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::V1::HostMapWidgetProjectionDimensionMapping` 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?(:'_alias') + self._alias = attributes[:'_alias'] + end + + if attributes.key?(:'column') + self.column = attributes[:'column'] + end + + if attributes.key?(:'dimension') + self.dimension = attributes[:'dimension'] + end + + if attributes.key?(:'number_format') + self.number_format = attributes[:'number_format'] + 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 @column.nil? + return false if @dimension.nil? + true + end + + # Custom attribute writer method with validation + # @param column [Object] Object to be assigned + # @!visibility private + def column=(column) + if column.nil? + fail ArgumentError, 'invalid value for "column", column cannot be nil.' + end + @column = column + end + + # Custom attribute writer method with validation + # @param dimension [Object] Object to be assigned + # @!visibility private + def dimension=(dimension) + if dimension.nil? + fail ArgumentError, 'invalid value for "dimension", dimension cannot be nil.' + end + @dimension = dimension + 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 && + _alias == o._alias && + column == o.column && + dimension == o.dimension && + number_format == o.number_format && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_alias, column, dimension, number_format, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/host_map_widget_projection_type.rb b/lib/datadog_api_client/v1/models/host_map_widget_projection_type.rb new file mode 100644 index 000000000000..11525417865f --- /dev/null +++ b/lib/datadog_api_client/v1/models/host_map_widget_projection_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 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::V1 + # Type of the host map projection. + class HostMapWidgetProjectionType + include BaseEnumModel + + HOSTMAP = "hostmap".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/published_dataset_provider.rb b/lib/datadog_api_client/v1/models/published_dataset_provider.rb new file mode 100644 index 000000000000..ced6694f36eb --- /dev/null +++ b/lib/datadog_api_client/v1/models/published_dataset_provider.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 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::V1 + # Product page that published the dataset queried by a `DatasetListQuery`. `ddsql_query` is the only provider currently supported for host map widgets. + class PublishedDatasetProvider + include BaseEnumModel + + DDSQL_QUERY = "ddsql_query".freeze + end +end