diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 17fc41e6b2aa..3f09c0483c43 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -22509,11 +22509,274 @@ components: scaling: $ref: "#/components/schemas/ToplistWidgetScaling" type: object + TopologyMapInlineColumnKindScalar: + default: scalar + description: Column of numbers. + enum: + - scalar + example: scalar + type: string + x-enum-varnames: + - SCALAR + TopologyMapInlineColumnKindString: + default: string + description: Column of strings. + enum: + - string + example: string + type: string + x-enum-varnames: + - STRING + TopologyMapInlineData: + additionalProperties: false + description: >- + Static nodes and edges, stored in columns. Within a table, every column must have the same number of values and a unique `id`. + properties: + edges: + $ref: "#/components/schemas/TopologyMapInlineEdgesData" + nodes: + $ref: "#/components/schemas/TopologyMapInlineNodesData" + type: object + TopologyMapInlineEdgeColumn: + additionalProperties: false + description: Column of edge endpoint node IDs. + properties: + id: + $ref: "#/components/schemas/TopologyMapInlineEdgeColumnId" + kind: + $ref: "#/components/schemas/TopologyMapInlineColumnKindString" + values: + description: Node IDs. + example: ["service:web"] + items: + description: Node ID. + type: string + type: array + required: + - kind + - id + - values + type: object + TopologyMapInlineEdgeColumnId: + description: Edge endpoint the column holds. + enum: + - source + - target + example: source + type: string + x-enum-varnames: + - SOURCE + - TARGET + TopologyMapInlineEdgesData: + additionalProperties: false + description: Table of edges, one row per edge. + properties: + columns: + description: Columns of the edges table. Must include one `source` column and one `target` column. + items: + $ref: "#/components/schemas/TopologyMapInlineEdgeColumn" + type: array + required: + - columns + type: object + TopologyMapInlineNodeColumn: + description: Column of the nodes table. + oneOf: + - $ref: "#/components/schemas/TopologyMapInlineNodeIdColumn" + - $ref: "#/components/schemas/TopologyMapInlineNodeStringColumn" + - $ref: "#/components/schemas/TopologyMapInlineNodeValueColumn" + TopologyMapInlineNodeIdColumn: + additionalProperties: false + description: Column of node IDs. + properties: + id: + $ref: "#/components/schemas/TopologyMapInlineNodeIdColumnId" + kind: + $ref: "#/components/schemas/TopologyMapInlineColumnKindString" + values: + description: Node IDs. + example: ["service:web", "service:db"] + items: + description: Node ID. + type: string + type: array + required: + - kind + - id + - values + type: object + TopologyMapInlineNodeIdColumnId: + default: id + description: ID of the node ID column. + enum: + - id + example: id + type: string + x-enum-varnames: + - ID + TopologyMapInlineNodeStringColumn: + additionalProperties: false + description: Column of node text. + properties: + id: + $ref: "#/components/schemas/TopologyMapInlineNodeStringColumnId" + kind: + $ref: "#/components/schemas/TopologyMapInlineColumnKindString" + values: + description: >- + Text for each node. A null `title` shows the node's ID; a null `subtitle` shows no subtitle. + example: ["api-team", null] + items: + description: Text for one node. + nullable: true + type: string + type: array + required: + - kind + - id + - values + type: object + TopologyMapInlineNodeStringColumnId: + description: >- + Node field the column fills. `title` is bold text at the top of the node; `subtitle` is smaller text below it. + enum: + - title + - subtitle + example: title + type: string + x-enum-varnames: + - TITLE + - SUBTITLE + TopologyMapInlineNodeValueColumn: + additionalProperties: false + description: >- + Column of numeric node values. Nodes display non-null values in order of column `id`. + properties: + id: + description: Position of the value in the node, as `values[N]`. The smallest N appears first. + example: "values[0]" + pattern: '^values\[(0|[1-9][0-9]*)\]$' + type: string + kind: + $ref: "#/components/schemas/TopologyMapInlineColumnKindScalar" + meta: + $ref: "#/components/schemas/TopologyMapInlineNodeValueColumnMeta" + values: + description: Value for each node. Null values are not displayed. + example: [1.5, null] + items: + description: Value for one node. + format: double + nullable: true + type: number + type: array + required: + - kind + - id + - values + type: object + TopologyMapInlineNodeValueColumnMeta: + additionalProperties: false + description: Display options for a value column. + properties: + unit: + $ref: "#/components/schemas/NumberFormatUnit" + type: object + TopologyMapInlineNodesData: + additionalProperties: false + description: Table of nodes, one row per node. + properties: + columns: + description: >- + Columns of the nodes table. Must include an `id` column, unless the list is empty (no nodes). + items: + $ref: "#/components/schemas/TopologyMapInlineNodeColumn" + type: array + required: + - columns + type: object + TopologyMapLayout: + additionalProperties: false + description: >- + Algorithm that positions nodes and edges. The `hierarchical` layout places nodes in ranks so edges flow in one direction. + properties: + direction: + $ref: "#/components/schemas/TopologyMapLayoutDirection" + type: + $ref: "#/components/schemas/TopologyMapLayoutType" + required: + - type + - direction + type: object + TopologyMapLayoutDirection: + description: >- + Direction of ranks. For example, `top-to-bottom` places first-rank nodes at the top and last-rank nodes at the bottom. + enum: + - top-to-bottom + - bottom-to-top + - left-to-right + - right-to-left + example: top-to-bottom + type: string + x-enum-varnames: + - TOP_TO_BOTTOM + - BOTTOM_TO_TOP + - LEFT_TO_RIGHT + - RIGHT_TO_LEFT + TopologyMapLayoutType: + default: hierarchical + description: Type of layout algorithm. + enum: + - hierarchical + example: hierarchical + type: string + x-enum-varnames: + - HIERARCHICAL TopologyMapWidgetDefinition: description: This widget displays a topology of nodes and edges for different data sources. It replaces the service map widget. oneOf: - $ref: "#/components/schemas/TopologyMapWidgetDefinitionDataStreams" - $ref: "#/components/schemas/TopologyMapWidgetDefinitionServiceMap" + - $ref: "#/components/schemas/TopologyMapWidgetDefinitionCustom" + TopologyMapWidgetDefinitionCustom: + additionalProperties: false + description: >- + Custom topology map widget. Renders nodes and edges from inline `data` and from scalar `requests`. There is one node for each node ID found in `data.nodes`, `data.edges`, and `requests`. When `data` and several requests set the same field on the same node (such as `title` or `values[0]`), the last non-null value wins. + properties: + custom_links: + description: List of custom links. + items: + $ref: "#/components/schemas/WidgetCustomLink" + type: array + data: + $ref: "#/components/schemas/TopologyMapInlineData" + description: + description: The description of the widget. + type: string + layout: + $ref: "#/components/schemas/TopologyMapLayout" + requests: + description: List of scalar requests that supply node data. Can be empty. + items: + $ref: "#/components/schemas/TopologyRequestCustom" + type: array + time: + $ref: "#/components/schemas/WidgetTime" + title: + description: Title of your widget. + type: string + title_align: + $ref: "#/components/schemas/WidgetTextAlign" + title_size: + description: Size of the title. + type: string + type: + $ref: "#/components/schemas/TopologyMapWidgetDefinitionType" + required: + - type + - requests + - layout + type: object TopologyMapWidgetDefinitionDataStreams: additionalProperties: false description: Topology map widget backed by the data streams data source. @@ -22661,6 +22924,87 @@ components: type: string x-enum-varnames: - SERVICE_MAP + TopologyRequestCustom: + additionalProperties: false + description: Scalar request whose result rows become nodes. + properties: + formulas: + description: List of formulas that operate on queries. + items: + $ref: "#/components/schemas/WidgetFormula" + type: array + projection: + $ref: "#/components/schemas/TopologyRequestCustomProjection" + queries: + description: List of queries that can be returned directly or used in formulas. + example: + - data_source: "metrics" + name: "my_query" + query: "avg:system.cpu.user{*}" + items: + $ref: "#/components/schemas/FormulaAndFunctionQueryDefinition" + type: array + response_format: + $ref: "#/components/schemas/TopologyRequestCustomResponseFormat" + sort: + $ref: "#/components/schemas/WidgetSortBy" + required: + - response_format + - queries + - projection + type: object + TopologyRequestCustomProjection: + additionalProperties: false + description: >- + Mapping from result columns to node fields. Each result row feeds one node. + properties: + dimensions: + description: List of mappings from a result column to a node field. Each `dimension` must be unique. + items: + $ref: "#/components/schemas/TopologyRequestCustomProjectionDimension" + type: array + type: + $ref: "#/components/schemas/TopologyRequestCustomProjectionType" + required: + - type + - dimensions + type: object + TopologyRequestCustomProjectionDimension: + additionalProperties: false + description: Mapping from one result column to one node field. + properties: + column: + description: Column name from the result. Must be a group-by tag key or a formula. + example: service + type: string + dimension: + description: >- + Node field that receives the column's value: `id`, `title`, `subtitle`, or `values[N]` for the value at position N. When `id` is not set, each node's ID is derived from the group-by tags (for example, `env:prod,service:web`). When `title` is not set, the title is the node's ID. When several rows set the same non-`id` field on a node, the last non-null value wins. + example: "values[0]" + pattern: '^(id|title|subtitle|values\[(0|[1-9][0-9]*)\])$' + type: string + required: + - column + - dimension + type: object + TopologyRequestCustomProjectionType: + default: custom_topology_map_node + description: Projection type. Each result row is a node. + enum: + - custom_topology_map_node + example: custom_topology_map_node + type: string + x-enum-varnames: + - CUSTOM_TOPOLOGY_MAP_NODE + TopologyRequestCustomResponseFormat: + default: scalar + description: Response format of a custom topology map request. + enum: + - scalar + example: scalar + type: string + x-enum-varnames: + - SCALAR TopologyRequestDataStreams: description: Request that returns nodes and edges from the data streams data source. properties: diff --git a/examples/v1/dashboards/CreateDashboard_620827773.rb b/examples/v1/dashboards/CreateDashboard_620827773.rb new file mode 100644 index 000000000000..28f3c79f87c1 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_620827773.rb @@ -0,0 +1,117 @@ +# Create a new dashboard with topology_map custom widget + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] +end +api_instance = DatadogAPIClient::V1::DashboardsAPI.new + +body = DatadogAPIClient::V1::Dashboard.new({ + title: "Example-Dashboard", + description: "", + widgets: [ + DatadogAPIClient::V1::Widget.new({ + layout: DatadogAPIClient::V1::WidgetLayout.new({ + x: 0, + y: 0, + width: 47, + height: 15, + }), + definition: DatadogAPIClient::V1::TopologyMapWidgetDefinitionCustom.new({ + title: "", + title_size: "16", + title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT, + type: DatadogAPIClient::V1::TopologyMapWidgetDefinitionType::TOPOLOGY_MAP, + layout: DatadogAPIClient::V1::TopologyMapLayout.new({ + type: DatadogAPIClient::V1::TopologyMapLayoutType::HIERARCHICAL, + direction: DatadogAPIClient::V1::TopologyMapLayoutDirection::LEFT_TO_RIGHT, + }), + data: DatadogAPIClient::V1::TopologyMapInlineData.new({ + nodes: DatadogAPIClient::V1::TopologyMapInlineNodesData.new({ + columns: [ + DatadogAPIClient::V1::TopologyMapInlineNodeIdColumn.new({ + kind: DatadogAPIClient::V1::TopologyMapInlineColumnKindString::STRING, + id: DatadogAPIClient::V1::TopologyMapInlineNodeIdColumnId::ID, + values: [ + "service:web", + "service:db", + ], + }), + DatadogAPIClient::V1::TopologyMapInlineNodeStringColumn.new({ + kind: DatadogAPIClient::V1::TopologyMapInlineColumnKindString::STRING, + id: DatadogAPIClient::V1::TopologyMapInlineNodeStringColumnId::SUBTITLE, + values: [ + "api-team", + nil, + ], + }), + DatadogAPIClient::V1::TopologyMapInlineNodeValueColumn.new({ + kind: DatadogAPIClient::V1::TopologyMapInlineColumnKindScalar::SCALAR, + id: "values[1]", + values: [ + 1.5, + nil, + ], + meta: DatadogAPIClient::V1::TopologyMapInlineNodeValueColumnMeta.new({ + unit: DatadogAPIClient::V1::NumberFormatUnitCanonical.new({ + type: DatadogAPIClient::V1::NumberFormatUnitScaleType::CANONICAL_UNIT, + unit_name: "second", + }), + }), + }), + ], + }), + edges: DatadogAPIClient::V1::TopologyMapInlineEdgesData.new({ + columns: [ + DatadogAPIClient::V1::TopologyMapInlineEdgeColumn.new({ + kind: DatadogAPIClient::V1::TopologyMapInlineColumnKindString::STRING, + id: DatadogAPIClient::V1::TopologyMapInlineEdgeColumnId::SOURCE, + values: [ + "service:web", + ], + }), + DatadogAPIClient::V1::TopologyMapInlineEdgeColumn.new({ + kind: DatadogAPIClient::V1::TopologyMapInlineColumnKindString::STRING, + id: DatadogAPIClient::V1::TopologyMapInlineEdgeColumnId::TARGET, + values: [ + "service:db", + ], + }), + ], + }), + }), + requests: [ + DatadogAPIClient::V1::TopologyRequestCustom.new({ + response_format: DatadogAPIClient::V1::TopologyRequestCustomResponseFormat::SCALAR, + queries: [ + DatadogAPIClient::V1::FormulaAndFunctionMetricQueryDefinition.new({ + data_source: DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource::METRICS, + name: "a", + query: "avg:system.cpu.user{*} by {service}", + aggregator: DatadogAPIClient::V1::FormulaAndFunctionMetricAggregation::AVG, + }), + ], + formulas: [ + DatadogAPIClient::V1::WidgetFormula.new({ + formula: "a", + }), + ], + projection: DatadogAPIClient::V1::TopologyRequestCustomProjection.new({ + type: DatadogAPIClient::V1::TopologyRequestCustomProjectionType::CUSTOM_TOPOLOGY_MAP_NODE, + dimensions: [ + DatadogAPIClient::V1::TopologyRequestCustomProjectionDimension.new({ + column: "a", + dimension: "values[0]", + }), + ], + }), + }), + ], + }), + }), + ], + template_variables: [], + layout_type: DatadogAPIClient::V1::DashboardLayoutType::FREE, + notify_list: [], +}) +p api_instance.create_dashboard(body) diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index 10d1ecf15be4..311dff9a97a7 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -1218,6 +1218,22 @@ Feature: Dashboards And the response "widgets[0].definition.requests[0].sort.order_by[0].type" is equal to "formula" And the response "widgets[0].definition.requests[0].sort.order_by[0].index" is equal to 0 + @team:ddoghq/dashboards-backend + Scenario: Create a new dashboard with topology_map custom widget + Given new "CreateDashboard" request + And body from file "dashboards_json_payload/topology_map_widget_custom.json" + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "topology_map" + And the response "widgets[0].definition.layout.type" is equal to "hierarchical" + And the response "widgets[0].definition.layout.direction" is equal to "left-to-right" + And the response "widgets[0].definition.data.nodes.columns[0].id" is equal to "id" + And the response "widgets[0].definition.data.nodes.columns[2].meta.unit.unit_name" is equal to "second" + And the response "widgets[0].definition.data.edges.columns[1].values" is equal to ["service:db"] + And the response "widgets[0].definition.requests[0].response_format" is equal to "scalar" + And the response "widgets[0].definition.requests[0].projection.type" is equal to "custom_topology_map_node" + And the response "widgets[0].definition.requests[0].projection.dimensions[0].dimension" is equal to "values[0]" + @team:ddoghq/dashboards-backend Scenario: Create a new dashboard with topology_map data_streams widget Given new "CreateDashboard" request diff --git a/features/v1/dashboards_json_payload/topology_map_widget_custom.json b/features/v1/dashboards_json_payload/topology_map_widget_custom.json new file mode 100644 index 000000000000..b6aa927a1337 --- /dev/null +++ b/features/v1/dashboards_json_payload/topology_map_widget_custom.json @@ -0,0 +1,95 @@ +{ + "title": "{{ unique }}", + "description": "", + "widgets": [ + { + "layout": { + "x": 0, + "y": 0, + "width": 47, + "height": 15 + }, + "definition": { + "title": "", + "title_size": "16", + "title_align": "left", + "type": "topology_map", + "layout": { + "type": "hierarchical", + "direction": "left-to-right" + }, + "data": { + "nodes": { + "columns": [ + { + "kind": "string", + "id": "id", + "values": ["service:web", "service:db"] + }, + { + "kind": "string", + "id": "subtitle", + "values": ["api-team", null] + }, + { + "kind": "scalar", + "id": "values[1]", + "values": [1.5, null], + "meta": { + "unit": { + "type": "canonical_unit", + "unit_name": "second" + } + } + } + ] + }, + "edges": { + "columns": [ + { + "kind": "string", + "id": "source", + "values": ["service:web"] + }, + { + "kind": "string", + "id": "target", + "values": ["service:db"] + } + ] + } + }, + "requests": [ + { + "response_format": "scalar", + "queries": [ + { + "data_source": "metrics", + "name": "a", + "query": "avg:system.cpu.user{*} by {service}", + "aggregator": "avg" + } + ], + "formulas": [ + { + "formula": "a" + } + ], + "projection": { + "type": "custom_topology_map_node", + "dimensions": [ + { + "column": "a", + "dimension": "values[0]" + } + ] + } + } + ] + } + } + ], + "template_variables": [], + "layout_type": "free", + "notify_list": [] +} diff --git a/generated-test/test-runner-data/manifest.json b/generated-test/test-runner-data/manifest.json index c050f4092502..60c0e3aa6eb4 100644 --- a/generated-test/test-runner-data/manifest.json +++ b/generated-test/test-runner-data/manifest.json @@ -840,6 +840,13 @@ "scenario": "Create a new dashboard with toplist widget", "version": "v1" }, + { + "feature": "Dashboards", + "feature_file": "../../features/v1/dashboards.feature", + "file": "v1/dashboards/create-a-new-dashboard-with-topology-map-custom-widget.json", + "scenario": "Create a new dashboard with topology_map custom widget", + "version": "v1" + }, { "feature": "Dashboards", "feature_file": "../../features/v1/dashboards.feature", diff --git a/generated-test/test-runner-data/v1/dashboards/create-a-new-dashboard-with-topology-map-custom-widget.json b/generated-test/test-runner-data/v1/dashboards/create-a-new-dashboard-with-topology-map-custom-widget.json new file mode 100644 index 000000000000..f275ce759c0e --- /dev/null +++ b/generated-test/test-runner-data/v1/dashboards/create-a-new-dashboard-with-topology-map-custom-widget.json @@ -0,0 +1,133 @@ +{ + "api": "Dashboards", + "expected_status": 200, + "feature": "Dashboards", + "id": "v1/Dashboards/Create a new dashboard with topology_map custom widget", + "operation_id": "CreateDashboard", + "request": { + "body": { + "schema": { + "format": null, + "ref": "Dashboard", + "type": "object" + }, + "source": "dashboards_json_payload/topology_map_widget_custom.json", + "value": { + "description": "", + "layout_type": "free", + "notify_list": [], + "template_variables": [], + "title": "{{ unique }}", + "widgets": [ + { + "definition": { + "data": { + "edges": { + "columns": [ + { + "id": "source", + "kind": "string", + "values": [ + "service:web" + ] + }, + { + "id": "target", + "kind": "string", + "values": [ + "service:db" + ] + } + ] + }, + "nodes": { + "columns": [ + { + "id": "id", + "kind": "string", + "values": [ + "service:web", + "service:db" + ] + }, + { + "id": "subtitle", + "kind": "string", + "values": [ + "api-team", + null + ] + }, + { + "id": "values[1]", + "kind": "scalar", + "meta": { + "unit": { + "type": "canonical_unit", + "unit_name": "second" + } + }, + "values": [ + 1.5, + null + ] + } + ] + } + }, + "layout": { + "direction": "left-to-right", + "type": "hierarchical" + }, + "requests": [ + { + "formulas": [ + { + "formula": "a" + } + ], + "projection": { + "dimensions": [ + { + "column": "a", + "dimension": "values[0]" + } + ], + "type": "custom_topology_map_node" + }, + "queries": [ + { + "aggregator": "avg", + "data_source": "metrics", + "name": "a", + "query": "avg:system.cpu.user{*} by {service}" + } + ], + "response_format": "scalar" + } + ], + "title": "", + "title_align": "left", + "title_size": "16", + "type": "topology_map" + }, + "layout": { + "height": 15, + "width": 47, + "x": 0, + "y": 0 + } + } + ] + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [], + "path": "/api/v1/dashboard" + }, + "scenario": "Create a new dashboard with topology_map custom widget", + "schema_version": 1, + "version": "v1" +} diff --git a/generated-test/test-server-data/v1/dashboards.json b/generated-test/test-server-data/v1/dashboards.json index 7f8ed4b0cf73..c11782ed7a1b 100644 --- a/generated-test/test-server-data/v1/dashboards.json +++ b/generated-test/test-server-data/v1/dashboards.json @@ -10352,6 +10352,167 @@ "scenario": "Create a new dashboard with toplist widget", "version": "v1" }, + { + "feature": "Dashboards", + "frozen_at": "2026-10-27T13:31:23.791Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "description": "", + "layout_type": "free", + "notify_list": [], + "template_variables": [], + "title": "Test-Create_a_new_dashboard_with_topology_map_custom_widget-1793107883", + "widgets": [ + { + "definition": { + "data": { + "edges": { + "columns": [ + { + "id": "source", + "kind": "string", + "values": [ + "service:web" + ] + }, + { + "id": "target", + "kind": "string", + "values": [ + "service:db" + ] + } + ] + }, + "nodes": { + "columns": [ + { + "id": "id", + "kind": "string", + "values": [ + "service:web", + "service:db" + ] + }, + { + "id": "subtitle", + "kind": "string", + "values": [ + "api-team", + null + ] + }, + { + "id": "values[1]", + "kind": "scalar", + "meta": { + "unit": { + "type": "canonical_unit", + "unit_name": "second" + } + }, + "values": [ + 1.5, + null + ] + } + ] + } + }, + "layout": { + "direction": "left-to-right", + "type": "hierarchical" + }, + "requests": [ + { + "formulas": [ + { + "formula": "a" + } + ], + "projection": { + "dimensions": [ + { + "column": "a", + "dimension": "values[0]" + } + ], + "type": "custom_topology_map_node" + }, + "queries": [ + { + "aggregator": "avg", + "data_source": "metrics", + "name": "a", + "query": "avg:system.cpu.user{*} by {service}" + } + ], + "response_format": "scalar" + } + ], + "title": "", + "title_align": "left", + "title_size": "16", + "type": "topology_map" + }, + "layout": { + "height": 15, + "width": 47, + "x": 0, + "y": 0 + } + } + ] + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v1/dashboard", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"id\":\"xnh-jbg-tsu\",\"title\":\"Test-Create_a_new_dashboard_with_topology_map_custom_widget-1793107883\",\"description\":\"\",\"author_handle\":\"adam.hooper@datadoghq.com\",\"author_name\":\"Adam Hooper\",\"layout_type\":\"free\",\"url\":\"/dashboard/xnh-jbg-tsu/test-createanewdashboardwithtopologymapcustomwidget-1793107883\",\"template_variables\":[],\"widgets\":[{\"definition\":{\"data\":{\"edges\":{\"columns\":[{\"id\":\"source\",\"kind\":\"string\",\"values\":[\"service:web\"]},{\"id\":\"target\",\"kind\":\"string\",\"values\":[\"service:db\"]}]},\"nodes\":{\"columns\":[{\"id\":\"id\",\"kind\":\"string\",\"values\":[\"service:web\",\"service:db\"]},{\"id\":\"subtitle\",\"kind\":\"string\",\"values\":[\"api-team\",null]},{\"id\":\"values[1]\",\"kind\":\"scalar\",\"meta\":{\"unit\":{\"type\":\"canonical_unit\",\"unit_name\":\"second\"}},\"values\":[1.5,null]}]}},\"layout\":{\"direction\":\"left-to-right\",\"type\":\"hierarchical\"},\"requests\":[{\"formulas\":[{\"formula\":\"a\"}],\"projection\":{\"dimensions\":[{\"column\":\"a\",\"dimension\":\"values[0]\"}],\"type\":\"custom_topology_map_node\"},\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"a\",\"query\":\"avg:system.cpu.user{*} by {service}\"}],\"response_format\":\"scalar\"}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"topology_map\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0},\"id\":4010058712923256}],\"notify_list\":[],\"created_at\":\"2026-10-27T13:31:23.986826+00:00\",\"modified_at\":\"2026-10-27T13:31:23.986826+00:00\",\"experience_type\":\"default\",\"archived_at\":null,\"restricted_roles\":[]}" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v1/dashboard/xnh-jbg-tsu", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"deleted_dashboard_id\":\"xnh-jbg-tsu\"}" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Create a new dashboard with topology_map custom widget", + "version": "v1" + }, { "feature": "Dashboards", "frozen_at": "2026-03-20T18:16:51.929Z", diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index b475d0ed8b5b..e7f841d1ba49 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1026,7 +1026,25 @@ def overrides "v1.toplist_widget_stacked" => "ToplistWidgetStacked", "v1.toplist_widget_stacked_type" => "ToplistWidgetStackedType", "v1.toplist_widget_style" => "ToplistWidgetStyle", + "v1.topology_map_inline_column_kind_scalar" => "TopologyMapInlineColumnKindScalar", + "v1.topology_map_inline_column_kind_string" => "TopologyMapInlineColumnKindString", + "v1.topology_map_inline_data" => "TopologyMapInlineData", + "v1.topology_map_inline_edge_column" => "TopologyMapInlineEdgeColumn", + "v1.topology_map_inline_edge_column_id" => "TopologyMapInlineEdgeColumnId", + "v1.topology_map_inline_edges_data" => "TopologyMapInlineEdgesData", + "v1.topology_map_inline_node_column" => "TopologyMapInlineNodeColumn", + "v1.topology_map_inline_node_id_column" => "TopologyMapInlineNodeIdColumn", + "v1.topology_map_inline_node_id_column_id" => "TopologyMapInlineNodeIdColumnId", + "v1.topology_map_inline_nodes_data" => "TopologyMapInlineNodesData", + "v1.topology_map_inline_node_string_column" => "TopologyMapInlineNodeStringColumn", + "v1.topology_map_inline_node_string_column_id" => "TopologyMapInlineNodeStringColumnId", + "v1.topology_map_inline_node_value_column" => "TopologyMapInlineNodeValueColumn", + "v1.topology_map_inline_node_value_column_meta" => "TopologyMapInlineNodeValueColumnMeta", + "v1.topology_map_layout" => "TopologyMapLayout", + "v1.topology_map_layout_direction" => "TopologyMapLayoutDirection", + "v1.topology_map_layout_type" => "TopologyMapLayoutType", "v1.topology_map_widget_definition" => "TopologyMapWidgetDefinition", + "v1.topology_map_widget_definition_custom" => "TopologyMapWidgetDefinitionCustom", "v1.topology_map_widget_definition_data_streams" => "TopologyMapWidgetDefinitionDataStreams", "v1.topology_map_widget_definition_service_map" => "TopologyMapWidgetDefinitionServiceMap", "v1.topology_map_widget_definition_type" => "TopologyMapWidgetDefinitionType", @@ -1034,6 +1052,11 @@ def overrides "v1.topology_query_data_streams_data_source" => "TopologyQueryDataStreamsDataSource", "v1.topology_query_service_map" => "TopologyQueryServiceMap", "v1.topology_query_service_map_data_source" => "TopologyQueryServiceMapDataSource", + "v1.topology_request_custom" => "TopologyRequestCustom", + "v1.topology_request_custom_projection" => "TopologyRequestCustomProjection", + "v1.topology_request_custom_projection_dimension" => "TopologyRequestCustomProjectionDimension", + "v1.topology_request_custom_projection_type" => "TopologyRequestCustomProjectionType", + "v1.topology_request_custom_response_format" => "TopologyRequestCustomResponseFormat", "v1.topology_request_data_streams" => "TopologyRequestDataStreams", "v1.topology_request_service_map" => "TopologyRequestServiceMap", "v1.topology_request_type" => "TopologyRequestType", diff --git a/lib/datadog_api_client/v1/model_base.rb b/lib/datadog_api_client/v1/model_base.rb index 203568f08509..47dac17dd5ae 100644 --- a/lib/datadog_api_client/v1/model_base.rb +++ b/lib/datadog_api_client/v1/model_base.rb @@ -185,7 +185,7 @@ def to_hash # @!visibility private def _to_hash(value) if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } + value.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } diff --git a/lib/datadog_api_client/v1/models/topology_map_inline_column_kind_scalar.rb b/lib/datadog_api_client/v1/models/topology_map_inline_column_kind_scalar.rb new file mode 100644 index 000000000000..9d1b3704c1c2 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_inline_column_kind_scalar.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 + # Column of numbers. + class TopologyMapInlineColumnKindScalar + include BaseEnumModel + + SCALAR = "scalar".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_inline_column_kind_string.rb b/lib/datadog_api_client/v1/models/topology_map_inline_column_kind_string.rb new file mode 100644 index 000000000000..b8278c49d8b2 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_inline_column_kind_string.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 + # Column of strings. + class TopologyMapInlineColumnKindString + include BaseEnumModel + + STRING = "string".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_inline_data.rb b/lib/datadog_api_client/v1/models/topology_map_inline_data.rb new file mode 100644 index 000000000000..2ddb6f5cb159 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_inline_data.rb @@ -0,0 +1,90 @@ +=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 + # Static nodes and edges, stored in columns. Within a table, every column must have the same number of values and a unique `id`. + class TopologyMapInlineData + include BaseGenericModel + + # Table of edges, one row per edge. + attr_accessor :edges + + # Table of nodes, one row per node. + attr_accessor :nodes + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'edges' => :'edges', + :'nodes' => :'nodes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'edges' => :'TopologyMapInlineEdgesData', + :'nodes' => :'TopologyMapInlineNodesData' + } + 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::TopologyMapInlineData` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TopologyMapInlineData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'edges') + self.edges = attributes[:'edges'] + end + + if attributes.key?(:'nodes') + self.nodes = attributes[:'nodes'] + end + 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 && + edges == o.edges && + nodes == o.nodes + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [edges, nodes].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_inline_edge_column.rb b/lib/datadog_api_client/v1/models/topology_map_inline_edge_column.rb new file mode 100644 index 000000000000..7a6279beaa58 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_inline_edge_column.rb @@ -0,0 +1,142 @@ +=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 + # Column of edge endpoint node IDs. + class TopologyMapInlineEdgeColumn + include BaseGenericModel + + # Edge endpoint the column holds. + attr_reader :id + + # Column of strings. + attr_reader :kind + + # Node IDs. + attr_reader :values + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'kind' => :'kind', + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'TopologyMapInlineEdgeColumnId', + :'kind' => :'TopologyMapInlineColumnKindString', + :'values' => :'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::TopologyMapInlineEdgeColumn` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TopologyMapInlineEdgeColumn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = 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 @id.nil? + return false if @kind.nil? + return false if @values.nil? + true + 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 kind [Object] Object to be assigned + # @!visibility private + def kind=(kind) + if kind.nil? + fail ArgumentError, 'invalid value for "kind", kind cannot be nil.' + end + @kind = kind + end + + # Custom attribute writer method with validation + # @param values [Object] Object to be assigned + # @!visibility private + def values=(values) + if values.nil? + fail ArgumentError, 'invalid value for "values", values cannot be nil.' + end + @values = values + 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 && + id == o.id && + kind == o.kind && + values == o.values + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, kind, values].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_inline_edge_column_id.rb b/lib/datadog_api_client/v1/models/topology_map_inline_edge_column_id.rb new file mode 100644 index 000000000000..5d9baf1d31f8 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_inline_edge_column_id.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 + # Edge endpoint the column holds. + class TopologyMapInlineEdgeColumnId + include BaseEnumModel + + SOURCE = "source".freeze + TARGET = "target".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_inline_edges_data.rb b/lib/datadog_api_client/v1/models/topology_map_inline_edges_data.rb new file mode 100644 index 000000000000..b0663ab25624 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_inline_edges_data.rb @@ -0,0 +1,100 @@ +=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 + # Table of edges, one row per edge. + class TopologyMapInlineEdgesData + include BaseGenericModel + + # Columns of the edges table. Must include one `source` column and one `target` column. + attr_reader :columns + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'columns' => :'columns' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'columns' => :'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::TopologyMapInlineEdgesData` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TopologyMapInlineEdgesData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'columns') + if (value = attributes[:'columns']).is_a?(Array) + self.columns = 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 @columns.nil? + true + end + + # Custom attribute writer method with validation + # @param columns [Object] Object to be assigned + # @!visibility private + def columns=(columns) + if columns.nil? + fail ArgumentError, 'invalid value for "columns", columns cannot be nil.' + end + @columns = columns + 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 && + columns == o.columns + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [columns].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_inline_node_column.rb b/lib/datadog_api_client/v1/models/topology_map_inline_node_column.rb new file mode 100644 index 000000000000..e2da68d78179 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_inline_node_column.rb @@ -0,0 +1,64 @@ +=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 + # Column of the nodes table. + module TopologyMapInlineNodeColumn + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'TopologyMapInlineNodeIdColumn', + :'TopologyMapInlineNodeStringColumn', + :'TopologyMapInlineNodeValueColumn' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_inline_node_id_column.rb b/lib/datadog_api_client/v1/models/topology_map_inline_node_id_column.rb new file mode 100644 index 000000000000..fc6a72001194 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_inline_node_id_column.rb @@ -0,0 +1,142 @@ +=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 + # Column of node IDs. + class TopologyMapInlineNodeIdColumn + include BaseGenericModel + + # ID of the node ID column. + attr_reader :id + + # Column of strings. + attr_reader :kind + + # Node IDs. + attr_reader :values + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'kind' => :'kind', + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'TopologyMapInlineNodeIdColumnId', + :'kind' => :'TopologyMapInlineColumnKindString', + :'values' => :'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::TopologyMapInlineNodeIdColumn` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TopologyMapInlineNodeIdColumn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = 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 @id.nil? + return false if @kind.nil? + return false if @values.nil? + true + 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 kind [Object] Object to be assigned + # @!visibility private + def kind=(kind) + if kind.nil? + fail ArgumentError, 'invalid value for "kind", kind cannot be nil.' + end + @kind = kind + end + + # Custom attribute writer method with validation + # @param values [Object] Object to be assigned + # @!visibility private + def values=(values) + if values.nil? + fail ArgumentError, 'invalid value for "values", values cannot be nil.' + end + @values = values + 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 && + id == o.id && + kind == o.kind && + values == o.values + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, kind, values].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_inline_node_id_column_id.rb b/lib/datadog_api_client/v1/models/topology_map_inline_node_id_column_id.rb new file mode 100644 index 000000000000..a69f0abfa29f --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_inline_node_id_column_id.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 + # ID of the node ID column. + class TopologyMapInlineNodeIdColumnId + include BaseEnumModel + + ID = "id".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_inline_node_string_column.rb b/lib/datadog_api_client/v1/models/topology_map_inline_node_string_column.rb new file mode 100644 index 000000000000..64d71c73f6c9 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_inline_node_string_column.rb @@ -0,0 +1,142 @@ +=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 + # Column of node text. + class TopologyMapInlineNodeStringColumn + include BaseGenericModel + + # Node field the column fills. `title` is bold text at the top of the node; `subtitle` is smaller text below it. + attr_reader :id + + # Column of strings. + attr_reader :kind + + # Text for each node. A null `title` shows the node's ID; a null `subtitle` shows no subtitle. + attr_reader :values + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'kind' => :'kind', + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'TopologyMapInlineNodeStringColumnId', + :'kind' => :'TopologyMapInlineColumnKindString', + :'values' => :'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::TopologyMapInlineNodeStringColumn` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TopologyMapInlineNodeStringColumn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = 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 @id.nil? + return false if @kind.nil? + return false if @values.nil? + true + 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 kind [Object] Object to be assigned + # @!visibility private + def kind=(kind) + if kind.nil? + fail ArgumentError, 'invalid value for "kind", kind cannot be nil.' + end + @kind = kind + end + + # Custom attribute writer method with validation + # @param values [Object] Object to be assigned + # @!visibility private + def values=(values) + if values.nil? + fail ArgumentError, 'invalid value for "values", values cannot be nil.' + end + @values = values + 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 && + id == o.id && + kind == o.kind && + values == o.values + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, kind, values].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_inline_node_string_column_id.rb b/lib/datadog_api_client/v1/models/topology_map_inline_node_string_column_id.rb new file mode 100644 index 000000000000..23b8ea160cb3 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_inline_node_string_column_id.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 + # Node field the column fills. `title` is bold text at the top of the node; `subtitle` is smaller text below it. + class TopologyMapInlineNodeStringColumnId + include BaseEnumModel + + TITLE = "title".freeze + SUBTITLE = "subtitle".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_inline_node_value_column.rb b/lib/datadog_api_client/v1/models/topology_map_inline_node_value_column.rb new file mode 100644 index 000000000000..8779eca5c52b --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_inline_node_value_column.rb @@ -0,0 +1,158 @@ +=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 + # Column of numeric node values. Nodes display non-null values in order of column `id`. + class TopologyMapInlineNodeValueColumn + include BaseGenericModel + + # Position of the value in the node, as `values[N]`. The smallest N appears first. + attr_reader :id + + # Column of numbers. + attr_reader :kind + + # Display options for a value column. + attr_accessor :meta + + # Value for each node. Null values are not displayed. + attr_reader :values + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'kind' => :'kind', + :'meta' => :'meta', + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'kind' => :'TopologyMapInlineColumnKindScalar', + :'meta' => :'TopologyMapInlineNodeValueColumnMeta', + :'values' => :'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::TopologyMapInlineNodeValueColumn` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TopologyMapInlineNodeValueColumn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'kind') + self.kind = attributes[:'kind'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = 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 @id.nil? + pattern = Regexp.new(/^values\[(0|[1-9][0-9]*)\]$/) + return false if @id !~ pattern + return false if @kind.nil? + return false if @values.nil? + true + 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 + pattern = Regexp.new(/^values\[(0|[1-9][0-9]*)\]$/) + if id !~ pattern + fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}." + end + @id = id + end + + # Custom attribute writer method with validation + # @param kind [Object] Object to be assigned + # @!visibility private + def kind=(kind) + if kind.nil? + fail ArgumentError, 'invalid value for "kind", kind cannot be nil.' + end + @kind = kind + end + + # Custom attribute writer method with validation + # @param values [Object] Object to be assigned + # @!visibility private + def values=(values) + if values.nil? + fail ArgumentError, 'invalid value for "values", values cannot be nil.' + end + @values = values + 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 && + id == o.id && + kind == o.kind && + meta == o.meta && + values == o.values + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, kind, meta, values].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_inline_node_value_column_meta.rb b/lib/datadog_api_client/v1/models/topology_map_inline_node_value_column_meta.rb new file mode 100644 index 000000000000..bcec6da2c5e6 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_inline_node_value_column_meta.rb @@ -0,0 +1,80 @@ +=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 + # Display options for a value column. + class TopologyMapInlineNodeValueColumnMeta + include BaseGenericModel + + # Number format unit. + attr_accessor :unit + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'unit' => :'unit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'unit' => :'NumberFormatUnit' + } + 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::TopologyMapInlineNodeValueColumnMeta` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TopologyMapInlineNodeValueColumnMeta`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'unit') + self.unit = attributes[:'unit'] + end + 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 && + unit == o.unit + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [unit].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_inline_nodes_data.rb b/lib/datadog_api_client/v1/models/topology_map_inline_nodes_data.rb new file mode 100644 index 000000000000..00a1dc3bd84b --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_inline_nodes_data.rb @@ -0,0 +1,100 @@ +=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 + # Table of nodes, one row per node. + class TopologyMapInlineNodesData + include BaseGenericModel + + # Columns of the nodes table. Must include an `id` column, unless the list is empty (no nodes). + attr_reader :columns + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'columns' => :'columns' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'columns' => :'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::TopologyMapInlineNodesData` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TopologyMapInlineNodesData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'columns') + if (value = attributes[:'columns']).is_a?(Array) + self.columns = 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 @columns.nil? + true + end + + # Custom attribute writer method with validation + # @param columns [Object] Object to be assigned + # @!visibility private + def columns=(columns) + if columns.nil? + fail ArgumentError, 'invalid value for "columns", columns cannot be nil.' + end + @columns = columns + 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 && + columns == o.columns + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [columns].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_layout.rb b/lib/datadog_api_client/v1/models/topology_map_layout.rb new file mode 100644 index 000000000000..17258a1bf86d --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_layout.rb @@ -0,0 +1,119 @@ +=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 + # Algorithm that positions nodes and edges. The `hierarchical` layout places nodes in ranks so edges flow in one direction. + class TopologyMapLayout + include BaseGenericModel + + # Direction of ranks. For example, `top-to-bottom` places first-rank nodes at the top and last-rank nodes at the bottom. + attr_reader :direction + + # Type of layout algorithm. + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'direction' => :'direction', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'direction' => :'TopologyMapLayoutDirection', + :'type' => :'TopologyMapLayoutType' + } + 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::TopologyMapLayout` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TopologyMapLayout`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + 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 @direction.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param direction [Object] Object to be assigned + # @!visibility private + def direction=(direction) + if direction.nil? + fail ArgumentError, 'invalid value for "direction", direction cannot be nil.' + end + @direction = direction + 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 + + # 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 && + direction == o.direction && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [direction, type].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_layout_direction.rb b/lib/datadog_api_client/v1/models/topology_map_layout_direction.rb new file mode 100644 index 000000000000..5022a47e5053 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_layout_direction.rb @@ -0,0 +1,29 @@ +=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 + # Direction of ranks. For example, `top-to-bottom` places first-rank nodes at the top and last-rank nodes at the bottom. + class TopologyMapLayoutDirection + include BaseEnumModel + + TOP_TO_BOTTOM = "top-to-bottom".freeze + BOTTOM_TO_TOP = "bottom-to-top".freeze + LEFT_TO_RIGHT = "left-to-right".freeze + RIGHT_TO_LEFT = "right-to-left".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_layout_type.rb b/lib/datadog_api_client/v1/models/topology_map_layout_type.rb new file mode 100644 index 000000000000..fb9ebdcba9e0 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_layout_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 layout algorithm. + class TopologyMapLayoutType + include BaseEnumModel + + HIERARCHICAL = "hierarchical".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/topology_map_widget_definition.rb b/lib/datadog_api_client/v1/models/topology_map_widget_definition.rb index ac0c2916adc7..cd66072909d7 100644 --- a/lib/datadog_api_client/v1/models/topology_map_widget_definition.rb +++ b/lib/datadog_api_client/v1/models/topology_map_widget_definition.rb @@ -27,7 +27,8 @@ class << self def openapi_one_of [ :'TopologyMapWidgetDefinitionDataStreams', - :'TopologyMapWidgetDefinitionServiceMap' + :'TopologyMapWidgetDefinitionServiceMap', + :'TopologyMapWidgetDefinitionCustom' ] end # Builds the object diff --git a/lib/datadog_api_client/v1/models/topology_map_widget_definition_custom.rb b/lib/datadog_api_client/v1/models/topology_map_widget_definition_custom.rb new file mode 100644 index 000000000000..f8e4762c18ff --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_map_widget_definition_custom.rb @@ -0,0 +1,214 @@ +=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 + # Custom topology map widget. Renders nodes and edges from inline `data` and from scalar `requests`. There is one node for each node ID found in `data.nodes`, `data.edges`, and `requests`. When `data` and several requests set the same field on the same node (such as `title` or `values[0]`), the last non-null value wins. + class TopologyMapWidgetDefinitionCustom + include BaseGenericModel + + # List of custom links. + attr_accessor :custom_links + + # Static nodes and edges, stored in columns. Within a table, every column must have the same number of values and a unique `id`. + attr_accessor :data + + # The description of the widget. + attr_accessor :description + + # Algorithm that positions nodes and edges. The `hierarchical` layout places nodes in ranks so edges flow in one direction. + attr_reader :layout + + # List of scalar requests that supply node data. Can be empty. + attr_reader :requests + + # Time setting for the widget. + attr_accessor :time + + # Title of your widget. + attr_accessor :title + + # How to align the text on the widget. + attr_accessor :title_align + + # Size of the title. + attr_accessor :title_size + + # Type of the topology map widget. + attr_reader :type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'custom_links' => :'custom_links', + :'data' => :'data', + :'description' => :'description', + :'layout' => :'layout', + :'requests' => :'requests', + :'time' => :'time', + :'title' => :'title', + :'title_align' => :'title_align', + :'title_size' => :'title_size', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'custom_links' => :'Array', + :'data' => :'TopologyMapInlineData', + :'description' => :'String', + :'layout' => :'TopologyMapLayout', + :'requests' => :'Array', + :'time' => :'WidgetTime', + :'title' => :'String', + :'title_align' => :'WidgetTextAlign', + :'title_size' => :'String', + :'type' => :'TopologyMapWidgetDefinitionType' + } + 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::TopologyMapWidgetDefinitionCustom` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TopologyMapWidgetDefinitionCustom`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'custom_links') + if (value = attributes[:'custom_links']).is_a?(Array) + self.custom_links = value + end + end + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'layout') + self.layout = attributes[:'layout'] + end + + if attributes.key?(:'requests') + if (value = attributes[:'requests']).is_a?(Array) + self.requests = value + end + end + + if attributes.key?(:'time') + self.time = attributes[:'time'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'title_align') + self.title_align = attributes[:'title_align'] + end + + if attributes.key?(:'title_size') + self.title_size = attributes[:'title_size'] + 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 @layout.nil? + return false if @requests.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param layout [Object] Object to be assigned + # @!visibility private + def layout=(layout) + if layout.nil? + fail ArgumentError, 'invalid value for "layout", layout cannot be nil.' + end + @layout = layout + end + + # Custom attribute writer method with validation + # @param requests [Object] Object to be assigned + # @!visibility private + def requests=(requests) + if requests.nil? + fail ArgumentError, 'invalid value for "requests", requests cannot be nil.' + end + @requests = requests + 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 + + # 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 && + custom_links == o.custom_links && + data == o.data && + description == o.description && + layout == o.layout && + requests == o.requests && + time == o.time && + title == o.title && + title_align == o.title_align && + title_size == o.title_size && + type == o.type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [custom_links, data, description, layout, requests, time, title, title_align, title_size, type].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_request_custom.rb b/lib/datadog_api_client/v1/models/topology_request_custom.rb new file mode 100644 index 000000000000..2af1948696b4 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_request_custom.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 + # Scalar request whose result rows become nodes. + class TopologyRequestCustom + include BaseGenericModel + + # List of formulas that operate on queries. + attr_accessor :formulas + + # Mapping from result columns to node fields. Each result row feeds one node. + attr_reader :projection + + # List of queries that can be returned directly or used in formulas. + attr_reader :queries + + # Response format of a custom topology map request. + attr_reader :response_format + + # The controls for sorting the widget. + attr_accessor :sort + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'formulas' => :'formulas', + :'projection' => :'projection', + :'queries' => :'queries', + :'response_format' => :'response_format', + :'sort' => :'sort' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'formulas' => :'Array', + :'projection' => :'TopologyRequestCustomProjection', + :'queries' => :'Array', + :'response_format' => :'TopologyRequestCustomResponseFormat', + :'sort' => :'WidgetSortBy' + } + 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::TopologyRequestCustom` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TopologyRequestCustom`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'formulas') + if (value = attributes[:'formulas']).is_a?(Array) + self.formulas = value + end + end + + if attributes.key?(:'projection') + self.projection = attributes[:'projection'] + end + + if attributes.key?(:'queries') + if (value = attributes[:'queries']).is_a?(Array) + self.queries = value + end + end + + if attributes.key?(:'response_format') + self.response_format = attributes[:'response_format'] + 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 @projection.nil? + return false if @queries.nil? + return false if @response_format.nil? + true + end + + # Custom attribute writer method with validation + # @param projection [Object] Object to be assigned + # @!visibility private + def projection=(projection) + if projection.nil? + fail ArgumentError, 'invalid value for "projection", projection cannot be nil.' + end + @projection = projection + end + + # Custom attribute writer method with validation + # @param queries [Object] Object to be assigned + # @!visibility private + def queries=(queries) + if queries.nil? + fail ArgumentError, 'invalid value for "queries", queries cannot be nil.' + end + @queries = queries + end + + # Custom attribute writer method with validation + # @param response_format [Object] Object to be assigned + # @!visibility private + def response_format=(response_format) + if response_format.nil? + fail ArgumentError, 'invalid value for "response_format", response_format cannot be nil.' + end + @response_format = response_format + 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 && + formulas == o.formulas && + projection == o.projection && + queries == o.queries && + response_format == o.response_format && + sort == o.sort + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [formulas, projection, queries, response_format, sort].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_request_custom_projection.rb b/lib/datadog_api_client/v1/models/topology_request_custom_projection.rb new file mode 100644 index 000000000000..7993e45f4222 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_request_custom_projection.rb @@ -0,0 +1,121 @@ +=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 + # Mapping from result columns to node fields. Each result row feeds one node. + class TopologyRequestCustomProjection + include BaseGenericModel + + # List of mappings from a result column to a node field. Each `dimension` must be unique. + attr_reader :dimensions + + # Projection type. Each result row is a node. + attr_reader :type + + # 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' => :'TopologyRequestCustomProjectionType' + } + 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::TopologyRequestCustomProjection` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TopologyRequestCustomProjection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + 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 + + # 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 + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dimensions, type].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_request_custom_projection_dimension.rb b/lib/datadog_api_client/v1/models/topology_request_custom_projection_dimension.rb new file mode 100644 index 000000000000..ecfe0d4f8f5b --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_request_custom_projection_dimension.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 + # Mapping from one result column to one node field. + class TopologyRequestCustomProjectionDimension + include BaseGenericModel + + # Column name from the result. Must be a group-by tag key or a formula. + attr_reader :column + + # Node field that receives the column's value: `id`, `title`, `subtitle`, or `values[N]` for the value at position N. When `id` is not set, each node's ID is derived from the group-by tags (for example, `env:prod,service:web`). When `title` is not set, the title is the node's ID. When several rows set the same non-`id` field on a node, the last non-null value wins. + attr_reader :dimension + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'column' => :'column', + :'dimension' => :'dimension' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'column' => :'String', + :'dimension' => :'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::V1::TopologyRequestCustomProjectionDimension` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TopologyRequestCustomProjectionDimension`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'column') + self.column = attributes[:'column'] + end + + if attributes.key?(:'dimension') + self.dimension = attributes[:'dimension'] + 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? + pattern = Regexp.new(/^(id|title|subtitle|values\[(0|[1-9][0-9]*)\])$/) + return false if @dimension !~ pattern + 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 + pattern = Regexp.new(/^(id|title|subtitle|values\[(0|[1-9][0-9]*)\])$/) + if dimension !~ pattern + fail ArgumentError, "invalid value for \"dimension\", must conform to the pattern #{pattern}." + end + @dimension = dimension + 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 && + column == o.column && + dimension == o.dimension + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [column, dimension].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/topology_request_custom_projection_type.rb b/lib/datadog_api_client/v1/models/topology_request_custom_projection_type.rb new file mode 100644 index 000000000000..93c573e7fee5 --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_request_custom_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 + # Projection type. Each result row is a node. + class TopologyRequestCustomProjectionType + include BaseEnumModel + + CUSTOM_TOPOLOGY_MAP_NODE = "custom_topology_map_node".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/topology_request_custom_response_format.rb b/lib/datadog_api_client/v1/models/topology_request_custom_response_format.rb new file mode 100644 index 000000000000..dab41e96081c --- /dev/null +++ b/lib/datadog_api_client/v1/models/topology_request_custom_response_format.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 + # Response format of a custom topology map request. + class TopologyRequestCustomResponseFormat + include BaseEnumModel + + SCALAR = "scalar".freeze + end +end diff --git a/lib/datadog_api_client/v2/model_base.rb b/lib/datadog_api_client/v2/model_base.rb index 7bdfde0c6bcd..31cfac41fc01 100644 --- a/lib/datadog_api_client/v2/model_base.rb +++ b/lib/datadog_api_client/v2/model_base.rb @@ -185,7 +185,7 @@ def to_hash # @!visibility private def _to_hash(value) if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } + value.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) }