From 3caad221899bf2ade821d5ee10aa9bb175d2d730 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 23 Mar 2026 13:38:02 +0000 Subject: [PATCH] Regenerate client from commit 3200932 of spec repo --- .generator/schemas/v1/openapi.yaml | 118 ++++++++++++++ .generator/schemas/v2/openapi.yaml | 91 +---------- docs/datadog_api_client.v1.model.rst | 28 ++++ docs/datadog_api_client.v2.model.rst | 35 ----- .../dashboards/CreateDashboard_2252738813.py | 67 ++++++++ examples/v2/teams/SyncTeams_3215592344.py | 27 ++++ .../v1/model/bar_chart_widget_request.py | 4 + .../v1/model/change_widget_request.py | 4 + .../v1/model/distribution_widget_request.py | 4 + ...rmula_and_function_apm_metric_stat_name.py | 80 ++++++++++ ...a_and_function_apm_metrics_data_source.py} | 14 +- ...d_function_apm_metrics_query_definition.py | 148 ++++++++++++++++++ ...mula_and_function_apm_metrics_span_kind.py | 47 ++++++ .../formula_and_function_query_definition.py | 19 +++ .../v1/model/geomap_widget_request.py | 4 + .../v1/model/heat_map_widget_request.py | 4 + .../v1/model/query_value_widget_request.py | 4 + .../v1/model/scatterplot_table_request.py | 4 + .../v1/model/sunburst_widget_request.py | 4 + .../v1/model/table_widget_request.py | 4 + .../v1/model/timeseries_widget_request.py | 4 + .../v1/model/toplist_widget_request.py | 4 + .../v1/model/tree_map_widget_request.py | 4 + src/datadog_api_client/v1/models/__init__.py | 12 ++ src/datadog_api_client/v2/api/teams_api.py | 6 +- .../v2/model/team_sync_attributes.py | 14 +- .../team_sync_selection_state_external_id.py | 55 ------- ...m_sync_selection_state_external_id_type.py | 40 ----- .../model/team_sync_selection_state_item.py | 70 --------- .../team_sync_selection_state_operation.py | 37 ----- src/datadog_api_client/v2/models/__init__.py | 10 -- ...w_dashboard_with_apm_metrics_widget.frozen | 1 + ...new_dashboard_with_apm_metrics_widget.yaml | 36 +++++ tests/v1/features/dashboards.feature | 14 ++ ..._configurations_returns_ok_response.frozen | 1 - ...nc_configurations_returns_ok_response.yaml | 18 --- ...b_teams_returns_no_content_response.frozen | 1 - ...test_sync_teams_returns_ok_response.frozen | 1 + ... test_sync_teams_returns_ok_response.yaml} | 10 +- tests/v2/features/teams.feature | 25 +-- 40 files changed, 683 insertions(+), 390 deletions(-) create mode 100644 examples/v1/dashboards/CreateDashboard_2252738813.py create mode 100644 examples/v2/teams/SyncTeams_3215592344.py create mode 100644 src/datadog_api_client/v1/model/formula_and_function_apm_metric_stat_name.py rename src/datadog_api_client/{v2/model/team_sync_selection_state_scope.py => v1/model/formula_and_function_apm_metrics_data_source.py} (55%) create mode 100644 src/datadog_api_client/v1/model/formula_and_function_apm_metrics_query_definition.py create mode 100644 src/datadog_api_client/v1/model/formula_and_function_apm_metrics_span_kind.py delete mode 100644 src/datadog_api_client/v2/model/team_sync_selection_state_external_id.py delete mode 100644 src/datadog_api_client/v2/model/team_sync_selection_state_external_id_type.py delete mode 100644 src/datadog_api_client/v2/model/team_sync_selection_state_item.py delete mode 100644 src/datadog_api_client/v2/model/team_sync_selection_state_operation.py create mode 100644 tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_apm_metrics_widget.frozen create mode 100644 tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_apm_metrics_widget.yaml delete mode 100644 tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.frozen delete mode 100644 tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.yaml delete mode 100644 tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.frozen rename tests/v2/cassettes/test_scenarios/{test_link_teams_with_github_teams_returns_no_content_response.yaml => test_sync_teams_returns_ok_response.yaml} (51%) diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 6eb50c8c03..c82a369290 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -2648,6 +2648,123 @@ components: - service - name type: object + FormulaAndFunctionApmMetricStatName: + description: APM metric stat name. + enum: + - errors + - error_rate + - errors_per_second + - latency_avg + - latency_max + - latency_p50 + - latency_p75 + - latency_p90 + - latency_p95 + - latency_p99 + - latency_p999 + - latency_distribution + - hits + - hits_per_second + - total_time + - apdex + example: "hits" + type: string + x-enum-varnames: + - ERRORS + - ERROR_RATE + - ERRORS_PER_SECOND + - LATENCY_AVG + - LATENCY_MAX + - LATENCY_P50 + - LATENCY_P75 + - LATENCY_P90 + - LATENCY_P95 + - LATENCY_P99 + - LATENCY_P999 + - LATENCY_DISTRIBUTION + - HITS + - HITS_PER_SECOND + - TOTAL_TIME + - APDEX + FormulaAndFunctionApmMetricsDataSource: + description: Data source for APM metrics queries. + enum: + - apm_metrics + example: apm_metrics + type: string + x-enum-varnames: + - APM_METRICS + FormulaAndFunctionApmMetricsQueryDefinition: + description: A formula and functions APM metrics query. + properties: + data_source: + $ref: "#/components/schemas/FormulaAndFunctionApmMetricsDataSource" + group_by: + description: Optional fields to group the query results by. + items: + description: A field to group results by. + example: "resource_name" + type: string + type: array + name: + description: Name of this query to use in formulas. + example: "query_errors" + type: string + operation_mode: + description: Optional operation mode to aggregate across operation names. + example: "primary" + type: string + operation_name: + description: Name of operation on service. If not provided, the primary operation name is used. + example: "web.request" + type: string + peer_tags: + description: Tags to query for a specific downstream entity (peer.service, peer.db_instance, peer.s3, peer.s3.bucket, etc.). + items: + example: "peer.service:my-service" + type: string + type: array + query_filter: + description: Additional filters for the query using metrics query syntax (e.g., env, primary_tag). + example: "env:prod" + type: string + resource_hash: + description: The hash of a specific resource to filter by. + example: "abc123" + type: string + resource_name: + description: The full name of a specific resource to filter by. + example: "GET /api/v1/users" + type: string + service: + description: APM service name. + example: "web-store" + type: string + span_kind: + $ref: "#/components/schemas/FormulaAndFunctionApmMetricsSpanKind" + stat: + $ref: "#/components/schemas/FormulaAndFunctionApmMetricStatName" + required: + - data_source + - name + - stat + type: object + FormulaAndFunctionApmMetricsSpanKind: + description: Describes the relationship between the span, its parents, and its children in a trace. + enum: + - consumer + - server + - client + - producer + - internal + example: "server" + type: string + x-enum-varnames: + - CONSUMER + - SERVER + - CLIENT + - PRODUCER + - INTERNAL FormulaAndFunctionApmResourceStatName: description: APM resource stat name. enum: @@ -3077,6 +3194,7 @@ components: - $ref: "#/components/schemas/FormulaAndFunctionProcessQueryDefinition" - $ref: "#/components/schemas/FormulaAndFunctionApmDependencyStatsQueryDefinition" - $ref: "#/components/schemas/FormulaAndFunctionApmResourceStatsQueryDefinition" + - $ref: "#/components/schemas/FormulaAndFunctionApmMetricsQueryDefinition" - $ref: "#/components/schemas/FormulaAndFunctionSLOQueryDefinition" - $ref: "#/components/schemas/FormulaAndFunctionCloudCostQueryDefinition" FormulaAndFunctionResponseFormat: diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 1fe1b58cae..a5b836b66b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -65885,8 +65885,6 @@ components: properties: frequency: $ref: "#/components/schemas/TeamSyncAttributesFrequency" - selection_state: - $ref: "#/components/schemas/TeamSyncAttributesSelectionState" source: $ref: "#/components/schemas/TeamSyncAttributesSource" sync_membership: @@ -65909,14 +65907,6 @@ components: - ONCE - CONTINUOUSLY - PAUSED - TeamSyncAttributesSelectionState: - description: |- - Specifies which teams or organizations to sync. When - provided, synchronization is limited to the specified - items and their subtrees. - items: - $ref: "#/components/schemas/TeamSyncSelectionStateItem" - type: array TeamSyncAttributesSource: description: The external source platform for team synchronization. Only "github" is supported. enum: @@ -65926,7 +65916,6 @@ components: x-enum-varnames: - GITHUB TeamSyncAttributesSyncMembership: - default: false description: Whether to sync members from the external team to the Datadog team. Defaults to `false` when not provided. example: true type: boolean @@ -65986,72 +65975,6 @@ components: $ref: "#/components/schemas/TeamSyncData" type: array type: object - TeamSyncSelectionStateExternalId: - description: The external identifier for a team or organization in the source platform. - properties: - type: - $ref: "#/components/schemas/TeamSyncSelectionStateExternalIdType" - value: - $ref: "#/components/schemas/TeamSyncSelectionStateExternalIdValue" - required: - - type - - value - type: object - TeamSyncSelectionStateExternalIdType: - description: |- - The type of external identifier for the selection state item. - For GitHub synchronization, the allowed values are `team` and - `organization`. - enum: - - team - - organization - example: team - type: string - x-enum-varnames: - - TEAM - - ORGANIZATION - TeamSyncSelectionStateExternalIdValue: - description: |- - The external identifier value from the source - platform. For GitHub, this is the string - representation of a GitHub organization ID or team - ID. - example: "1" - type: string - TeamSyncSelectionStateItem: - description: Identifies a team or organization hierarchy to include in synchronization. - properties: - external_id: - $ref: "#/components/schemas/TeamSyncSelectionStateExternalId" - operation: - $ref: "#/components/schemas/TeamSyncSelectionStateOperation" - scope: - $ref: "#/components/schemas/TeamSyncSelectionStateScope" - required: - - external_id - type: object - TeamSyncSelectionStateOperation: - description: |- - The operation to perform on the selected hierarchy. - When set to `include`, synchronization covers the - referenced teams or organizations. - enum: - - include - example: include - type: string - x-enum-varnames: - - INCLUDE - TeamSyncSelectionStateScope: - description: |- - The scope of the selection. When set to `subtree`, - synchronization includes the referenced team or - organization and everything nested under it. - enum: - - subtree - example: subtree - type: string - x-enum-varnames: - - SUBTREE TeamTarget: description: "Represents a team target for an escalation policy step, including the team's ID and resource type." properties: @@ -105511,6 +105434,12 @@ paths: description: OK "403": $ref: "#/components/responses/ForbiddenResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Team sync configurations not found "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -105527,17 +105456,13 @@ paths: - teams_read post: description: |- - This endpoint configures synchronization between your existing Datadog teams and GitHub teams by matching their names. + This endpoint attempts to link your existing Datadog teams with GitHub teams by matching their names. It evaluates all current Datadog teams and compares them against teams in the GitHub organization connected to your Datadog account, based on Datadog Team handle and GitHub Team slug (lowercased and kebab-cased). This operation is read-only on the GitHub side, no teams will be modified or created. - Optionally, provide `selection_state` to limit synchronization - to specific teams or organizations and their subtrees, instead - of syncing all teams. - [A GitHub organization must be connected to your Datadog account](https://docs.datadoghq.com/integrations/github/), and the GitHub App integrated with Datadog must have the `Members Read` permission. Matching is performed by comparing the Datadog team handle to the GitHub team slug using a normalized exact match; case is ignored and spaces are removed. No modifications are made @@ -105552,8 +105477,6 @@ paths: responses: "200": description: OK - "204": - description: No Content "403": $ref: "#/components/responses/ForbiddenResponse" "429": diff --git a/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index 5370f824d8..8fcb677666 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -865,6 +865,34 @@ datadog\_api\_client.v1.model.formula\_and\_function\_apm\_dependency\_stats\_qu :members: :show-inheritance: +datadog\_api\_client.v1.model.formula\_and\_function\_apm\_metric\_stat\_name module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v1.model.formula_and_function_apm_metric_stat_name + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.formula\_and\_function\_apm\_metrics\_data\_source module +--------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.formula_and_function_apm_metrics_data_source + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.formula\_and\_function\_apm\_metrics\_query\_definition module +-------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition + :members: + :show-inheritance: + +datadog\_api\_client.v1.model.formula\_and\_function\_apm\_metrics\_span\_kind module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v1.model.formula_and_function_apm_metrics_span_kind + :members: + :show-inheritance: + datadog\_api\_client.v1.model.formula\_and\_function\_apm\_resource\_stat\_name module -------------------------------------------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 559286621a..8dbf4eef3a 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -30468,41 +30468,6 @@ datadog\_api\_client.v2.model.team\_sync\_response module :members: :show-inheritance: -datadog\_api\_client.v2.model.team\_sync\_selection\_state\_external\_id module -------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.team_sync_selection_state_external_id - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.team\_sync\_selection\_state\_external\_id\_type module -------------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.team_sync_selection_state_external_id_type - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.team\_sync\_selection\_state\_item module ------------------------------------------------------------------------ - -.. automodule:: datadog_api_client.v2.model.team_sync_selection_state_item - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.team\_sync\_selection\_state\_operation module ----------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.team_sync_selection_state_operation - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.team\_sync\_selection\_state\_scope module ------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.team_sync_selection_state_scope - :members: - :show-inheritance: - datadog\_api\_client.v2.model.team\_target module ------------------------------------------------- diff --git a/examples/v1/dashboards/CreateDashboard_2252738813.py b/examples/v1/dashboards/CreateDashboard_2252738813.py new file mode 100644 index 0000000000..27b432e08b --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_2252738813.py @@ -0,0 +1,67 @@ +""" +Create a new dashboard with apm metrics widget +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v1.api.dashboards_api import DashboardsApi +from datadog_api_client.v1.model.dashboard import Dashboard +from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType +from datadog_api_client.v1.model.formula_and_function_apm_metric_stat_name import FormulaAndFunctionApmMetricStatName +from datadog_api_client.v1.model.formula_and_function_apm_metrics_data_source import ( + FormulaAndFunctionApmMetricsDataSource, +) +from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, +) +from datadog_api_client.v1.model.formula_and_function_response_format import FormulaAndFunctionResponseFormat +from datadog_api_client.v1.model.table_widget_definition import TableWidgetDefinition +from datadog_api_client.v1.model.table_widget_definition_type import TableWidgetDefinitionType +from datadog_api_client.v1.model.table_widget_request import TableWidgetRequest +from datadog_api_client.v1.model.widget import Widget +from datadog_api_client.v1.model.widget_layout import WidgetLayout +from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign + +body = Dashboard( + title="Example-Dashboard", + widgets=[ + Widget( + definition=TableWidgetDefinition( + title="", + title_size="16", + title_align=WidgetTextAlign.LEFT, + type=TableWidgetDefinitionType.QUERY_TABLE, + requests=[ + TableWidgetRequest( + response_format=FormulaAndFunctionResponseFormat.SCALAR, + queries=[ + FormulaAndFunctionApmMetricsQueryDefinition( + stat=FormulaAndFunctionApmMetricStatName.HITS, + name="query1", + service="web-store", + data_source=FormulaAndFunctionApmMetricsDataSource.APM_METRICS, + query_filter="env:prod", + group_by=[ + "resource_name", + ], + ), + ], + ), + ], + ), + layout=WidgetLayout( + x=0, + y=0, + width=4, + height=4, + ), + ), + ], + layout_type=DashboardLayoutType.ORDERED, +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = DashboardsApi(api_client) + response = api_instance.create_dashboard(body=body) + + print(response) diff --git a/examples/v2/teams/SyncTeams_3215592344.py b/examples/v2/teams/SyncTeams_3215592344.py new file mode 100644 index 0000000000..18e47d2f42 --- /dev/null +++ b/examples/v2/teams/SyncTeams_3215592344.py @@ -0,0 +1,27 @@ +""" +Sync teams returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.teams_api import TeamsApi +from datadog_api_client.v2.model.team_sync_attributes import TeamSyncAttributes +from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource +from datadog_api_client.v2.model.team_sync_attributes_type import TeamSyncAttributesType +from datadog_api_client.v2.model.team_sync_bulk_type import TeamSyncBulkType +from datadog_api_client.v2.model.team_sync_data import TeamSyncData +from datadog_api_client.v2.model.team_sync_request import TeamSyncRequest + +body = TeamSyncRequest( + data=TeamSyncData( + attributes=TeamSyncAttributes( + source=TeamSyncAttributesSource.GITHUB, + type=TeamSyncAttributesType.LINK, + ), + type=TeamSyncBulkType.TEAM_SYNC_BULK, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = TeamsApi(api_client) + api_instance.sync_teams(body=body) diff --git a/src/datadog_api_client/v1/model/bar_chart_widget_request.py b/src/datadog_api_client/v1/model/bar_chart_widget_request.py index eefd5b7055..cffff47eb0 100644 --- a/src/datadog_api_client/v1/model/bar_chart_widget_request.py +++ b/src/datadog_api_client/v1/model/bar_chart_widget_request.py @@ -37,6 +37,9 @@ from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import ( FormulaAndFunctionApmResourceStatsQueryDefinition, ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, + ) from datadog_api_client.v1.model.formula_and_function_slo_query_definition import ( FormulaAndFunctionSLOQueryDefinition, ) @@ -116,6 +119,7 @@ def __init__( FormulaAndFunctionProcessQueryDefinition, FormulaAndFunctionApmDependencyStatsQueryDefinition, FormulaAndFunctionApmResourceStatsQueryDefinition, + FormulaAndFunctionApmMetricsQueryDefinition, FormulaAndFunctionSLOQueryDefinition, FormulaAndFunctionCloudCostQueryDefinition, ] diff --git a/src/datadog_api_client/v1/model/change_widget_request.py b/src/datadog_api_client/v1/model/change_widget_request.py index e7f1b2f1d4..3239cfc6d8 100644 --- a/src/datadog_api_client/v1/model/change_widget_request.py +++ b/src/datadog_api_client/v1/model/change_widget_request.py @@ -38,6 +38,9 @@ from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import ( FormulaAndFunctionApmResourceStatsQueryDefinition, ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, + ) from datadog_api_client.v1.model.formula_and_function_slo_query_definition import ( FormulaAndFunctionSLOQueryDefinition, ) @@ -125,6 +128,7 @@ def __init__( FormulaAndFunctionProcessQueryDefinition, FormulaAndFunctionApmDependencyStatsQueryDefinition, FormulaAndFunctionApmResourceStatsQueryDefinition, + FormulaAndFunctionApmMetricsQueryDefinition, FormulaAndFunctionSLOQueryDefinition, FormulaAndFunctionCloudCostQueryDefinition, ] diff --git a/src/datadog_api_client/v1/model/distribution_widget_request.py b/src/datadog_api_client/v1/model/distribution_widget_request.py index aa57f430f9..07169bd162 100644 --- a/src/datadog_api_client/v1/model/distribution_widget_request.py +++ b/src/datadog_api_client/v1/model/distribution_widget_request.py @@ -40,6 +40,9 @@ from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import ( FormulaAndFunctionApmResourceStatsQueryDefinition, ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, + ) from datadog_api_client.v1.model.formula_and_function_slo_query_definition import ( FormulaAndFunctionSLOQueryDefinition, ) @@ -121,6 +124,7 @@ def __init__( FormulaAndFunctionProcessQueryDefinition, FormulaAndFunctionApmDependencyStatsQueryDefinition, FormulaAndFunctionApmResourceStatsQueryDefinition, + FormulaAndFunctionApmMetricsQueryDefinition, FormulaAndFunctionSLOQueryDefinition, FormulaAndFunctionCloudCostQueryDefinition, ] diff --git a/src/datadog_api_client/v1/model/formula_and_function_apm_metric_stat_name.py b/src/datadog_api_client/v1/model/formula_and_function_apm_metric_stat_name.py new file mode 100644 index 0000000000..7c8d416b1e --- /dev/null +++ b/src/datadog_api_client/v1/model/formula_and_function_apm_metric_stat_name.py @@ -0,0 +1,80 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FormulaAndFunctionApmMetricStatName(ModelSimple): + """ + APM metric stat name. + + :param value: Must be one of ["errors", "error_rate", "errors_per_second", "latency_avg", "latency_max", "latency_p50", "latency_p75", "latency_p90", "latency_p95", "latency_p99", "latency_p999", "latency_distribution", "hits", "hits_per_second", "total_time", "apdex"]. + :type value: str + """ + + allowed_values = { + "errors", + "error_rate", + "errors_per_second", + "latency_avg", + "latency_max", + "latency_p50", + "latency_p75", + "latency_p90", + "latency_p95", + "latency_p99", + "latency_p999", + "latency_distribution", + "hits", + "hits_per_second", + "total_time", + "apdex", + } + ERRORS: ClassVar["FormulaAndFunctionApmMetricStatName"] + ERROR_RATE: ClassVar["FormulaAndFunctionApmMetricStatName"] + ERRORS_PER_SECOND: ClassVar["FormulaAndFunctionApmMetricStatName"] + LATENCY_AVG: ClassVar["FormulaAndFunctionApmMetricStatName"] + LATENCY_MAX: ClassVar["FormulaAndFunctionApmMetricStatName"] + LATENCY_P50: ClassVar["FormulaAndFunctionApmMetricStatName"] + LATENCY_P75: ClassVar["FormulaAndFunctionApmMetricStatName"] + LATENCY_P90: ClassVar["FormulaAndFunctionApmMetricStatName"] + LATENCY_P95: ClassVar["FormulaAndFunctionApmMetricStatName"] + LATENCY_P99: ClassVar["FormulaAndFunctionApmMetricStatName"] + LATENCY_P999: ClassVar["FormulaAndFunctionApmMetricStatName"] + LATENCY_DISTRIBUTION: ClassVar["FormulaAndFunctionApmMetricStatName"] + HITS: ClassVar["FormulaAndFunctionApmMetricStatName"] + HITS_PER_SECOND: ClassVar["FormulaAndFunctionApmMetricStatName"] + TOTAL_TIME: ClassVar["FormulaAndFunctionApmMetricStatName"] + APDEX: ClassVar["FormulaAndFunctionApmMetricStatName"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FormulaAndFunctionApmMetricStatName.ERRORS = FormulaAndFunctionApmMetricStatName("errors") +FormulaAndFunctionApmMetricStatName.ERROR_RATE = FormulaAndFunctionApmMetricStatName("error_rate") +FormulaAndFunctionApmMetricStatName.ERRORS_PER_SECOND = FormulaAndFunctionApmMetricStatName("errors_per_second") +FormulaAndFunctionApmMetricStatName.LATENCY_AVG = FormulaAndFunctionApmMetricStatName("latency_avg") +FormulaAndFunctionApmMetricStatName.LATENCY_MAX = FormulaAndFunctionApmMetricStatName("latency_max") +FormulaAndFunctionApmMetricStatName.LATENCY_P50 = FormulaAndFunctionApmMetricStatName("latency_p50") +FormulaAndFunctionApmMetricStatName.LATENCY_P75 = FormulaAndFunctionApmMetricStatName("latency_p75") +FormulaAndFunctionApmMetricStatName.LATENCY_P90 = FormulaAndFunctionApmMetricStatName("latency_p90") +FormulaAndFunctionApmMetricStatName.LATENCY_P95 = FormulaAndFunctionApmMetricStatName("latency_p95") +FormulaAndFunctionApmMetricStatName.LATENCY_P99 = FormulaAndFunctionApmMetricStatName("latency_p99") +FormulaAndFunctionApmMetricStatName.LATENCY_P999 = FormulaAndFunctionApmMetricStatName("latency_p999") +FormulaAndFunctionApmMetricStatName.LATENCY_DISTRIBUTION = FormulaAndFunctionApmMetricStatName("latency_distribution") +FormulaAndFunctionApmMetricStatName.HITS = FormulaAndFunctionApmMetricStatName("hits") +FormulaAndFunctionApmMetricStatName.HITS_PER_SECOND = FormulaAndFunctionApmMetricStatName("hits_per_second") +FormulaAndFunctionApmMetricStatName.TOTAL_TIME = FormulaAndFunctionApmMetricStatName("total_time") +FormulaAndFunctionApmMetricStatName.APDEX = FormulaAndFunctionApmMetricStatName("apdex") diff --git a/src/datadog_api_client/v2/model/team_sync_selection_state_scope.py b/src/datadog_api_client/v1/model/formula_and_function_apm_metrics_data_source.py similarity index 55% rename from src/datadog_api_client/v2/model/team_sync_selection_state_scope.py rename to src/datadog_api_client/v1/model/formula_and_function_apm_metrics_data_source.py index 5518b78d8e..d7945c838e 100644 --- a/src/datadog_api_client/v2/model/team_sync_selection_state_scope.py +++ b/src/datadog_api_client/v1/model/formula_and_function_apm_metrics_data_source.py @@ -12,20 +12,18 @@ from typing import ClassVar -class TeamSyncSelectionStateScope(ModelSimple): +class FormulaAndFunctionApmMetricsDataSource(ModelSimple): """ - The scope of the selection. When set to `subtree`, - synchronization includes the referenced team or - organization and everything nested under it. + Data source for APM metrics queries. - :param value: If omitted defaults to "subtree". Must be one of ["subtree"]. + :param value: If omitted defaults to "apm_metrics". Must be one of ["apm_metrics"]. :type value: str """ allowed_values = { - "subtree", + "apm_metrics", } - SUBTREE: ClassVar["TeamSyncSelectionStateScope"] + APM_METRICS: ClassVar["FormulaAndFunctionApmMetricsDataSource"] @cached_property def openapi_types(_): @@ -34,4 +32,4 @@ def openapi_types(_): } -TeamSyncSelectionStateScope.SUBTREE = TeamSyncSelectionStateScope("subtree") +FormulaAndFunctionApmMetricsDataSource.APM_METRICS = FormulaAndFunctionApmMetricsDataSource("apm_metrics") diff --git a/src/datadog_api_client/v1/model/formula_and_function_apm_metrics_query_definition.py b/src/datadog_api_client/v1/model/formula_and_function_apm_metrics_query_definition.py new file mode 100644 index 0000000000..6f40efa05b --- /dev/null +++ b/src/datadog_api_client/v1/model/formula_and_function_apm_metrics_query_definition.py @@ -0,0 +1,148 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v1.model.formula_and_function_apm_metrics_data_source import ( + FormulaAndFunctionApmMetricsDataSource, + ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_span_kind import ( + FormulaAndFunctionApmMetricsSpanKind, + ) + from datadog_api_client.v1.model.formula_and_function_apm_metric_stat_name import ( + FormulaAndFunctionApmMetricStatName, + ) + + +class FormulaAndFunctionApmMetricsQueryDefinition(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v1.model.formula_and_function_apm_metrics_data_source import ( + FormulaAndFunctionApmMetricsDataSource, + ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_span_kind import ( + FormulaAndFunctionApmMetricsSpanKind, + ) + from datadog_api_client.v1.model.formula_and_function_apm_metric_stat_name import ( + FormulaAndFunctionApmMetricStatName, + ) + + return { + "data_source": (FormulaAndFunctionApmMetricsDataSource,), + "group_by": ([str],), + "name": (str,), + "operation_mode": (str,), + "operation_name": (str,), + "peer_tags": ([str],), + "query_filter": (str,), + "resource_hash": (str,), + "resource_name": (str,), + "service": (str,), + "span_kind": (FormulaAndFunctionApmMetricsSpanKind,), + "stat": (FormulaAndFunctionApmMetricStatName,), + } + + attribute_map = { + "data_source": "data_source", + "group_by": "group_by", + "name": "name", + "operation_mode": "operation_mode", + "operation_name": "operation_name", + "peer_tags": "peer_tags", + "query_filter": "query_filter", + "resource_hash": "resource_hash", + "resource_name": "resource_name", + "service": "service", + "span_kind": "span_kind", + "stat": "stat", + } + + def __init__( + self_, + data_source: FormulaAndFunctionApmMetricsDataSource, + name: str, + stat: FormulaAndFunctionApmMetricStatName, + group_by: Union[List[str], UnsetType] = unset, + operation_mode: Union[str, UnsetType] = unset, + operation_name: Union[str, UnsetType] = unset, + peer_tags: Union[List[str], UnsetType] = unset, + query_filter: Union[str, UnsetType] = unset, + resource_hash: Union[str, UnsetType] = unset, + resource_name: Union[str, UnsetType] = unset, + service: Union[str, UnsetType] = unset, + span_kind: Union[FormulaAndFunctionApmMetricsSpanKind, UnsetType] = unset, + **kwargs, + ): + """ + A formula and functions APM metrics query. + + :param data_source: Data source for APM metrics queries. + :type data_source: FormulaAndFunctionApmMetricsDataSource + + :param group_by: Optional fields to group the query results by. + :type group_by: [str], optional + + :param name: Name of this query to use in formulas. + :type name: str + + :param operation_mode: Optional operation mode to aggregate across operation names. + :type operation_mode: str, optional + + :param operation_name: Name of operation on service. If not provided, the primary operation name is used. + :type operation_name: str, optional + + :param peer_tags: Tags to query for a specific downstream entity (peer.service, peer.db_instance, peer.s3, peer.s3.bucket, etc.). + :type peer_tags: [str], optional + + :param query_filter: Additional filters for the query using metrics query syntax (e.g., env, primary_tag). + :type query_filter: str, optional + + :param resource_hash: The hash of a specific resource to filter by. + :type resource_hash: str, optional + + :param resource_name: The full name of a specific resource to filter by. + :type resource_name: str, optional + + :param service: APM service name. + :type service: str, optional + + :param span_kind: Describes the relationship between the span, its parents, and its children in a trace. + :type span_kind: FormulaAndFunctionApmMetricsSpanKind, optional + + :param stat: APM metric stat name. + :type stat: FormulaAndFunctionApmMetricStatName + """ + if group_by is not unset: + kwargs["group_by"] = group_by + if operation_mode is not unset: + kwargs["operation_mode"] = operation_mode + if operation_name is not unset: + kwargs["operation_name"] = operation_name + if peer_tags is not unset: + kwargs["peer_tags"] = peer_tags + if query_filter is not unset: + kwargs["query_filter"] = query_filter + if resource_hash is not unset: + kwargs["resource_hash"] = resource_hash + if resource_name is not unset: + kwargs["resource_name"] = resource_name + if service is not unset: + kwargs["service"] = service + if span_kind is not unset: + kwargs["span_kind"] = span_kind + super().__init__(kwargs) + + self_.data_source = data_source + self_.name = name + self_.stat = stat diff --git a/src/datadog_api_client/v1/model/formula_and_function_apm_metrics_span_kind.py b/src/datadog_api_client/v1/model/formula_and_function_apm_metrics_span_kind.py new file mode 100644 index 0000000000..2296dbf397 --- /dev/null +++ b/src/datadog_api_client/v1/model/formula_and_function_apm_metrics_span_kind.py @@ -0,0 +1,47 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FormulaAndFunctionApmMetricsSpanKind(ModelSimple): + """ + Describes the relationship between the span, its parents, and its children in a trace. + + :param value: Must be one of ["consumer", "server", "client", "producer", "internal"]. + :type value: str + """ + + allowed_values = { + "consumer", + "server", + "client", + "producer", + "internal", + } + CONSUMER: ClassVar["FormulaAndFunctionApmMetricsSpanKind"] + SERVER: ClassVar["FormulaAndFunctionApmMetricsSpanKind"] + CLIENT: ClassVar["FormulaAndFunctionApmMetricsSpanKind"] + PRODUCER: ClassVar["FormulaAndFunctionApmMetricsSpanKind"] + INTERNAL: ClassVar["FormulaAndFunctionApmMetricsSpanKind"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FormulaAndFunctionApmMetricsSpanKind.CONSUMER = FormulaAndFunctionApmMetricsSpanKind("consumer") +FormulaAndFunctionApmMetricsSpanKind.SERVER = FormulaAndFunctionApmMetricsSpanKind("server") +FormulaAndFunctionApmMetricsSpanKind.CLIENT = FormulaAndFunctionApmMetricsSpanKind("client") +FormulaAndFunctionApmMetricsSpanKind.PRODUCER = FormulaAndFunctionApmMetricsSpanKind("producer") +FormulaAndFunctionApmMetricsSpanKind.INTERNAL = FormulaAndFunctionApmMetricsSpanKind("internal") diff --git a/src/datadog_api_client/v1/model/formula_and_function_query_definition.py b/src/datadog_api_client/v1/model/formula_and_function_query_definition.py index 23b6354aaa..5b3e006fbb 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_query_definition.py +++ b/src/datadog_api_client/v1/model/formula_and_function_query_definition.py @@ -90,6 +90,21 @@ def __init__(self, **kwargs): :param stat: APM statistic. :type stat: FormulaAndFunctionApmDependencyStatName + :param operation_mode: Optional operation mode to aggregate across operation names. + :type operation_mode: str, optional + + :param peer_tags: Tags to query for a specific downstream entity (peer.service, peer.db_instance, peer.s3, peer.s3.bucket, etc.). + :type peer_tags: [str], optional + + :param query_filter: Additional filters for the query using metrics query syntax (e.g., env, primary_tag). + :type query_filter: str, optional + + :param resource_hash: The hash of a specific resource to filter by. + :type resource_hash: str, optional + + :param span_kind: Describes the relationship between the span, its parents, and its children in a trace. + :type span_kind: FormulaAndFunctionApmMetricsSpanKind, optional + :param additional_query_filters: Additional filters applied to the SLO query. :type additional_query_filters: str, optional @@ -131,6 +146,9 @@ def _composed_schemas(_): from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import ( FormulaAndFunctionApmResourceStatsQueryDefinition, ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, + ) from datadog_api_client.v1.model.formula_and_function_slo_query_definition import ( FormulaAndFunctionSLOQueryDefinition, ) @@ -145,6 +163,7 @@ def _composed_schemas(_): FormulaAndFunctionProcessQueryDefinition, FormulaAndFunctionApmDependencyStatsQueryDefinition, FormulaAndFunctionApmResourceStatsQueryDefinition, + FormulaAndFunctionApmMetricsQueryDefinition, FormulaAndFunctionSLOQueryDefinition, FormulaAndFunctionCloudCostQueryDefinition, ], diff --git a/src/datadog_api_client/v1/model/geomap_widget_request.py b/src/datadog_api_client/v1/model/geomap_widget_request.py index e02097f33c..d24df25ea3 100644 --- a/src/datadog_api_client/v1/model/geomap_widget_request.py +++ b/src/datadog_api_client/v1/model/geomap_widget_request.py @@ -39,6 +39,9 @@ from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import ( FormulaAndFunctionApmResourceStatsQueryDefinition, ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, + ) from datadog_api_client.v1.model.formula_and_function_slo_query_definition import ( FormulaAndFunctionSLOQueryDefinition, ) @@ -109,6 +112,7 @@ def __init__( FormulaAndFunctionProcessQueryDefinition, FormulaAndFunctionApmDependencyStatsQueryDefinition, FormulaAndFunctionApmResourceStatsQueryDefinition, + FormulaAndFunctionApmMetricsQueryDefinition, FormulaAndFunctionSLOQueryDefinition, FormulaAndFunctionCloudCostQueryDefinition, ] diff --git a/src/datadog_api_client/v1/model/heat_map_widget_request.py b/src/datadog_api_client/v1/model/heat_map_widget_request.py index 4babf46d4f..a2b7c4abd1 100644 --- a/src/datadog_api_client/v1/model/heat_map_widget_request.py +++ b/src/datadog_api_client/v1/model/heat_map_widget_request.py @@ -40,6 +40,9 @@ from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import ( FormulaAndFunctionApmResourceStatsQueryDefinition, ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, + ) from datadog_api_client.v1.model.formula_and_function_slo_query_definition import ( FormulaAndFunctionSLOQueryDefinition, ) @@ -118,6 +121,7 @@ def __init__( FormulaAndFunctionProcessQueryDefinition, FormulaAndFunctionApmDependencyStatsQueryDefinition, FormulaAndFunctionApmResourceStatsQueryDefinition, + FormulaAndFunctionApmMetricsQueryDefinition, FormulaAndFunctionSLOQueryDefinition, FormulaAndFunctionCloudCostQueryDefinition, ] diff --git a/src/datadog_api_client/v1/model/query_value_widget_request.py b/src/datadog_api_client/v1/model/query_value_widget_request.py index ee3c337bc9..a04c2a8cc0 100644 --- a/src/datadog_api_client/v1/model/query_value_widget_request.py +++ b/src/datadog_api_client/v1/model/query_value_widget_request.py @@ -36,6 +36,9 @@ from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import ( FormulaAndFunctionApmResourceStatsQueryDefinition, ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, + ) from datadog_api_client.v1.model.formula_and_function_slo_query_definition import ( FormulaAndFunctionSLOQueryDefinition, ) @@ -113,6 +116,7 @@ def __init__( FormulaAndFunctionProcessQueryDefinition, FormulaAndFunctionApmDependencyStatsQueryDefinition, FormulaAndFunctionApmResourceStatsQueryDefinition, + FormulaAndFunctionApmMetricsQueryDefinition, FormulaAndFunctionSLOQueryDefinition, FormulaAndFunctionCloudCostQueryDefinition, ] diff --git a/src/datadog_api_client/v1/model/scatterplot_table_request.py b/src/datadog_api_client/v1/model/scatterplot_table_request.py index 646266d546..7dd99a5a9e 100644 --- a/src/datadog_api_client/v1/model/scatterplot_table_request.py +++ b/src/datadog_api_client/v1/model/scatterplot_table_request.py @@ -32,6 +32,9 @@ from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import ( FormulaAndFunctionApmResourceStatsQueryDefinition, ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, + ) from datadog_api_client.v1.model.formula_and_function_slo_query_definition import ( FormulaAndFunctionSLOQueryDefinition, ) @@ -71,6 +74,7 @@ def __init__( FormulaAndFunctionProcessQueryDefinition, FormulaAndFunctionApmDependencyStatsQueryDefinition, FormulaAndFunctionApmResourceStatsQueryDefinition, + FormulaAndFunctionApmMetricsQueryDefinition, FormulaAndFunctionSLOQueryDefinition, FormulaAndFunctionCloudCostQueryDefinition, ] diff --git a/src/datadog_api_client/v1/model/sunburst_widget_request.py b/src/datadog_api_client/v1/model/sunburst_widget_request.py index 3dd60710f0..52dea33d24 100644 --- a/src/datadog_api_client/v1/model/sunburst_widget_request.py +++ b/src/datadog_api_client/v1/model/sunburst_widget_request.py @@ -35,6 +35,9 @@ from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import ( FormulaAndFunctionApmResourceStatsQueryDefinition, ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, + ) from datadog_api_client.v1.model.formula_and_function_slo_query_definition import ( FormulaAndFunctionSLOQueryDefinition, ) @@ -107,6 +110,7 @@ def __init__( FormulaAndFunctionProcessQueryDefinition, FormulaAndFunctionApmDependencyStatsQueryDefinition, FormulaAndFunctionApmResourceStatsQueryDefinition, + FormulaAndFunctionApmMetricsQueryDefinition, FormulaAndFunctionSLOQueryDefinition, FormulaAndFunctionCloudCostQueryDefinition, ] diff --git a/src/datadog_api_client/v1/model/table_widget_request.py b/src/datadog_api_client/v1/model/table_widget_request.py index 8b2032d117..1912bf5ea2 100644 --- a/src/datadog_api_client/v1/model/table_widget_request.py +++ b/src/datadog_api_client/v1/model/table_widget_request.py @@ -41,6 +41,9 @@ from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import ( FormulaAndFunctionApmResourceStatsQueryDefinition, ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, + ) from datadog_api_client.v1.model.formula_and_function_slo_query_definition import ( FormulaAndFunctionSLOQueryDefinition, ) @@ -139,6 +142,7 @@ def __init__( FormulaAndFunctionProcessQueryDefinition, FormulaAndFunctionApmDependencyStatsQueryDefinition, FormulaAndFunctionApmResourceStatsQueryDefinition, + FormulaAndFunctionApmMetricsQueryDefinition, FormulaAndFunctionSLOQueryDefinition, FormulaAndFunctionCloudCostQueryDefinition, ] diff --git a/src/datadog_api_client/v1/model/timeseries_widget_request.py b/src/datadog_api_client/v1/model/timeseries_widget_request.py index 2396ed38d7..84cc6b6a64 100644 --- a/src/datadog_api_client/v1/model/timeseries_widget_request.py +++ b/src/datadog_api_client/v1/model/timeseries_widget_request.py @@ -37,6 +37,9 @@ from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import ( FormulaAndFunctionApmResourceStatsQueryDefinition, ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, + ) from datadog_api_client.v1.model.formula_and_function_slo_query_definition import ( FormulaAndFunctionSLOQueryDefinition, ) @@ -120,6 +123,7 @@ def __init__( FormulaAndFunctionProcessQueryDefinition, FormulaAndFunctionApmDependencyStatsQueryDefinition, FormulaAndFunctionApmResourceStatsQueryDefinition, + FormulaAndFunctionApmMetricsQueryDefinition, FormulaAndFunctionSLOQueryDefinition, FormulaAndFunctionCloudCostQueryDefinition, ] diff --git a/src/datadog_api_client/v1/model/toplist_widget_request.py b/src/datadog_api_client/v1/model/toplist_widget_request.py index 2ffa52cfe0..f55fdb3464 100644 --- a/src/datadog_api_client/v1/model/toplist_widget_request.py +++ b/src/datadog_api_client/v1/model/toplist_widget_request.py @@ -37,6 +37,9 @@ from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import ( FormulaAndFunctionApmResourceStatsQueryDefinition, ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, + ) from datadog_api_client.v1.model.formula_and_function_slo_query_definition import ( FormulaAndFunctionSLOQueryDefinition, ) @@ -122,6 +125,7 @@ def __init__( FormulaAndFunctionProcessQueryDefinition, FormulaAndFunctionApmDependencyStatsQueryDefinition, FormulaAndFunctionApmResourceStatsQueryDefinition, + FormulaAndFunctionApmMetricsQueryDefinition, FormulaAndFunctionSLOQueryDefinition, FormulaAndFunctionCloudCostQueryDefinition, ] diff --git a/src/datadog_api_client/v1/model/tree_map_widget_request.py b/src/datadog_api_client/v1/model/tree_map_widget_request.py index 27bec1f95b..9aff29c1fb 100644 --- a/src/datadog_api_client/v1/model/tree_map_widget_request.py +++ b/src/datadog_api_client/v1/model/tree_map_widget_request.py @@ -32,6 +32,9 @@ from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import ( FormulaAndFunctionApmResourceStatsQueryDefinition, ) + from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, + ) from datadog_api_client.v1.model.formula_and_function_slo_query_definition import ( FormulaAndFunctionSLOQueryDefinition, ) @@ -74,6 +77,7 @@ def __init__( FormulaAndFunctionProcessQueryDefinition, FormulaAndFunctionApmDependencyStatsQueryDefinition, FormulaAndFunctionApmResourceStatsQueryDefinition, + FormulaAndFunctionApmMetricsQueryDefinition, FormulaAndFunctionSLOQueryDefinition, FormulaAndFunctionCloudCostQueryDefinition, ] diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index 9cc8c680a3..0c3ffd56ad 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -129,6 +129,14 @@ from datadog_api_client.v1.model.formula_and_function_apm_dependency_stats_query_definition import ( FormulaAndFunctionApmDependencyStatsQueryDefinition, ) +from datadog_api_client.v1.model.formula_and_function_apm_metric_stat_name import FormulaAndFunctionApmMetricStatName +from datadog_api_client.v1.model.formula_and_function_apm_metrics_data_source import ( + FormulaAndFunctionApmMetricsDataSource, +) +from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import ( + FormulaAndFunctionApmMetricsQueryDefinition, +) +from datadog_api_client.v1.model.formula_and_function_apm_metrics_span_kind import FormulaAndFunctionApmMetricsSpanKind from datadog_api_client.v1.model.formula_and_function_apm_resource_stat_name import ( FormulaAndFunctionApmResourceStatName, ) @@ -1336,6 +1344,10 @@ "FormulaAndFunctionApmDependencyStatName", "FormulaAndFunctionApmDependencyStatsDataSource", "FormulaAndFunctionApmDependencyStatsQueryDefinition", + "FormulaAndFunctionApmMetricStatName", + "FormulaAndFunctionApmMetricsDataSource", + "FormulaAndFunctionApmMetricsQueryDefinition", + "FormulaAndFunctionApmMetricsSpanKind", "FormulaAndFunctionApmResourceStatName", "FormulaAndFunctionApmResourceStatsDataSource", "FormulaAndFunctionApmResourceStatsQueryDefinition", diff --git a/src/datadog_api_client/v2/api/teams_api.py b/src/datadog_api_client/v2/api/teams_api.py index f0cea6d425..e5b6af700e 100644 --- a/src/datadog_api_client/v2/api/teams_api.py +++ b/src/datadog_api_client/v2/api/teams_api.py @@ -1972,17 +1972,13 @@ def sync_teams( ) -> None: """Link Teams with GitHub Teams. - This endpoint configures synchronization between your existing Datadog teams and GitHub teams by matching their names. + This endpoint attempts to link your existing Datadog teams with GitHub teams by matching their names. It evaluates all current Datadog teams and compares them against teams in the GitHub organization connected to your Datadog account, based on Datadog Team handle and GitHub Team slug (lowercased and kebab-cased). This operation is read-only on the GitHub side, no teams will be modified or created. - Optionally, provide ``selection_state`` to limit synchronization - to specific teams or organizations and their subtrees, instead - of syncing all teams. - `A GitHub organization must be connected to your Datadog account `_ , and the GitHub App integrated with Datadog must have the ``Members Read`` permission. Matching is performed by comparing the Datadog team handle to the GitHub team slug using a normalized exact match; case is ignored and spaces are removed. No modifications are made diff --git a/src/datadog_api_client/v2/model/team_sync_attributes.py b/src/datadog_api_client/v2/model/team_sync_attributes.py index 431ae8de98..fe18232f01 100644 --- a/src/datadog_api_client/v2/model/team_sync_attributes.py +++ b/src/datadog_api_client/v2/model/team_sync_attributes.py @@ -3,7 +3,7 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, Union, TYPE_CHECKING +from typing import Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, @@ -15,7 +15,6 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.team_sync_attributes_frequency import TeamSyncAttributesFrequency - from datadog_api_client.v2.model.team_sync_selection_state_item import TeamSyncSelectionStateItem from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource from datadog_api_client.v2.model.team_sync_attributes_type import TeamSyncAttributesType @@ -24,13 +23,11 @@ class TeamSyncAttributes(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.team_sync_attributes_frequency import TeamSyncAttributesFrequency - from datadog_api_client.v2.model.team_sync_selection_state_item import TeamSyncSelectionStateItem from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource from datadog_api_client.v2.model.team_sync_attributes_type import TeamSyncAttributesType return { "frequency": (TeamSyncAttributesFrequency,), - "selection_state": ([TeamSyncSelectionStateItem],), "source": (TeamSyncAttributesSource,), "sync_membership": (bool,), "type": (TeamSyncAttributesType,), @@ -38,7 +35,6 @@ def openapi_types(_): attribute_map = { "frequency": "frequency", - "selection_state": "selection_state", "source": "source", "sync_membership": "sync_membership", "type": "type", @@ -49,7 +45,6 @@ def __init__( source: TeamSyncAttributesSource, type: TeamSyncAttributesType, frequency: Union[TeamSyncAttributesFrequency, UnsetType] = unset, - selection_state: Union[List[TeamSyncSelectionStateItem], UnsetType] = unset, sync_membership: Union[bool, UnsetType] = unset, **kwargs, ): @@ -59,11 +54,6 @@ def __init__( :param frequency: How often the sync process should be run. Defaults to ``once`` when not provided. :type frequency: TeamSyncAttributesFrequency, optional - :param selection_state: Specifies which teams or organizations to sync. When - provided, synchronization is limited to the specified - items and their subtrees. - :type selection_state: [TeamSyncSelectionStateItem], optional - :param source: The external source platform for team synchronization. Only "github" is supported. :type source: TeamSyncAttributesSource @@ -75,8 +65,6 @@ def __init__( """ if frequency is not unset: kwargs["frequency"] = frequency - if selection_state is not unset: - kwargs["selection_state"] = selection_state if sync_membership is not unset: kwargs["sync_membership"] = sync_membership super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/team_sync_selection_state_external_id.py b/src/datadog_api_client/v2/model/team_sync_selection_state_external_id.py deleted file mode 100644 index b36dd1e491..0000000000 --- a/src/datadog_api_client/v2/model/team_sync_selection_state_external_id.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 2019-Present Datadog, Inc. -from __future__ import annotations - -from typing import TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.team_sync_selection_state_external_id_type import ( - TeamSyncSelectionStateExternalIdType, - ) - - -class TeamSyncSelectionStateExternalId(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.team_sync_selection_state_external_id_type import ( - TeamSyncSelectionStateExternalIdType, - ) - - return { - "type": (TeamSyncSelectionStateExternalIdType,), - "value": (str,), - } - - attribute_map = { - "type": "type", - "value": "value", - } - - def __init__(self_, type: TeamSyncSelectionStateExternalIdType, value: str, **kwargs): - """ - The external identifier for a team or organization in the source platform. - - :param type: The type of external identifier for the selection state item. - For GitHub synchronization, the allowed values are ``team`` and - ``organization``. - :type type: TeamSyncSelectionStateExternalIdType - - :param value: The external identifier value from the source - platform. For GitHub, this is the string - representation of a GitHub organization ID or team - ID. - :type value: str - """ - super().__init__(kwargs) - - self_.type = type - self_.value = value diff --git a/src/datadog_api_client/v2/model/team_sync_selection_state_external_id_type.py b/src/datadog_api_client/v2/model/team_sync_selection_state_external_id_type.py deleted file mode 100644 index 68d4e2c90e..0000000000 --- a/src/datadog_api_client/v2/model/team_sync_selection_state_external_id_type.py +++ /dev/null @@ -1,40 +0,0 @@ -# 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 2019-Present Datadog, Inc. -from __future__ import annotations - - -from datadog_api_client.model_utils import ( - ModelSimple, - cached_property, -) - -from typing import ClassVar - - -class TeamSyncSelectionStateExternalIdType(ModelSimple): - """ - The type of external identifier for the selection state item. - For GitHub synchronization, the allowed values are `team` and - `organization`. - - :param value: Must be one of ["team", "organization"]. - :type value: str - """ - - allowed_values = { - "team", - "organization", - } - TEAM: ClassVar["TeamSyncSelectionStateExternalIdType"] - ORGANIZATION: ClassVar["TeamSyncSelectionStateExternalIdType"] - - @cached_property - def openapi_types(_): - return { - "value": (str,), - } - - -TeamSyncSelectionStateExternalIdType.TEAM = TeamSyncSelectionStateExternalIdType("team") -TeamSyncSelectionStateExternalIdType.ORGANIZATION = TeamSyncSelectionStateExternalIdType("organization") diff --git a/src/datadog_api_client/v2/model/team_sync_selection_state_item.py b/src/datadog_api_client/v2/model/team_sync_selection_state_item.py deleted file mode 100644 index c548f3f103..0000000000 --- a/src/datadog_api_client/v2/model/team_sync_selection_state_item.py +++ /dev/null @@ -1,70 +0,0 @@ -# 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 2019-Present Datadog, Inc. -from __future__ import annotations - -from typing import Union, TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - unset, - UnsetType, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.team_sync_selection_state_external_id import TeamSyncSelectionStateExternalId - from datadog_api_client.v2.model.team_sync_selection_state_operation import TeamSyncSelectionStateOperation - from datadog_api_client.v2.model.team_sync_selection_state_scope import TeamSyncSelectionStateScope - - -class TeamSyncSelectionStateItem(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.team_sync_selection_state_external_id import TeamSyncSelectionStateExternalId - from datadog_api_client.v2.model.team_sync_selection_state_operation import TeamSyncSelectionStateOperation - from datadog_api_client.v2.model.team_sync_selection_state_scope import TeamSyncSelectionStateScope - - return { - "external_id": (TeamSyncSelectionStateExternalId,), - "operation": (TeamSyncSelectionStateOperation,), - "scope": (TeamSyncSelectionStateScope,), - } - - attribute_map = { - "external_id": "external_id", - "operation": "operation", - "scope": "scope", - } - - def __init__( - self_, - external_id: TeamSyncSelectionStateExternalId, - operation: Union[TeamSyncSelectionStateOperation, UnsetType] = unset, - scope: Union[TeamSyncSelectionStateScope, UnsetType] = unset, - **kwargs, - ): - """ - Identifies a team or organization hierarchy to include in synchronization. - - :param external_id: The external identifier for a team or organization in the source platform. - :type external_id: TeamSyncSelectionStateExternalId - - :param operation: The operation to perform on the selected hierarchy. - When set to ``include`` , synchronization covers the - referenced teams or organizations. - :type operation: TeamSyncSelectionStateOperation, optional - - :param scope: The scope of the selection. When set to ``subtree`` , - synchronization includes the referenced team or - organization and everything nested under it. - :type scope: TeamSyncSelectionStateScope, optional - """ - if operation is not unset: - kwargs["operation"] = operation - if scope is not unset: - kwargs["scope"] = scope - super().__init__(kwargs) - - self_.external_id = external_id diff --git a/src/datadog_api_client/v2/model/team_sync_selection_state_operation.py b/src/datadog_api_client/v2/model/team_sync_selection_state_operation.py deleted file mode 100644 index f5068c4811..0000000000 --- a/src/datadog_api_client/v2/model/team_sync_selection_state_operation.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 2019-Present Datadog, Inc. -from __future__ import annotations - - -from datadog_api_client.model_utils import ( - ModelSimple, - cached_property, -) - -from typing import ClassVar - - -class TeamSyncSelectionStateOperation(ModelSimple): - """ - The operation to perform on the selected hierarchy. - When set to `include`, synchronization covers the - referenced teams or organizations. - - :param value: If omitted defaults to "include". Must be one of ["include"]. - :type value: str - """ - - allowed_values = { - "include", - } - INCLUDE: ClassVar["TeamSyncSelectionStateOperation"] - - @cached_property - def openapi_types(_): - return { - "value": (str,), - } - - -TeamSyncSelectionStateOperation.INCLUDE = TeamSyncSelectionStateOperation("include") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 0a5073a5ba..1fca8f4351 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -6209,11 +6209,6 @@ from datadog_api_client.v2.model.team_sync_data import TeamSyncData from datadog_api_client.v2.model.team_sync_request import TeamSyncRequest from datadog_api_client.v2.model.team_sync_response import TeamSyncResponse -from datadog_api_client.v2.model.team_sync_selection_state_external_id import TeamSyncSelectionStateExternalId -from datadog_api_client.v2.model.team_sync_selection_state_external_id_type import TeamSyncSelectionStateExternalIdType -from datadog_api_client.v2.model.team_sync_selection_state_item import TeamSyncSelectionStateItem -from datadog_api_client.v2.model.team_sync_selection_state_operation import TeamSyncSelectionStateOperation -from datadog_api_client.v2.model.team_sync_selection_state_scope import TeamSyncSelectionStateScope from datadog_api_client.v2.model.team_target import TeamTarget from datadog_api_client.v2.model.team_target_type import TeamTargetType from datadog_api_client.v2.model.team_type import TeamType @@ -10943,11 +10938,6 @@ "TeamSyncData", "TeamSyncRequest", "TeamSyncResponse", - "TeamSyncSelectionStateExternalId", - "TeamSyncSelectionStateExternalIdType", - "TeamSyncSelectionStateItem", - "TeamSyncSelectionStateOperation", - "TeamSyncSelectionStateScope", "TeamTarget", "TeamTargetType", "TeamType", diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_apm_metrics_widget.frozen b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_apm_metrics_widget.frozen new file mode 100644 index 0000000000..75b84eafed --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_apm_metrics_widget.frozen @@ -0,0 +1 @@ +2025-02-20T10:00:00.000Z \ No newline at end of file diff --git a/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_apm_metrics_widget.yaml b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_apm_metrics_widget.yaml new file mode 100644 index 0000000000..030a3b2ef7 --- /dev/null +++ b/tests/v1/cassettes/test_scenarios/test_create_a_new_dashboard_with_apm_metrics_widget.yaml @@ -0,0 +1,36 @@ +interactions: +- request: + body: '{"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_apm_metrics_widget-1740045600","widgets":[{"definition":{"requests":[{"queries":[{"data_source":"apm_metrics","group_by":["resource_name"],"name":"query1","query_filter":"env:prod","service":"web-store","stat":"hits"}],"response_format":"scalar"}],"title":"","title_align":"left","title_size":"16","type":"query_table"},"layout":{"height":4,"width":4,"x":0,"y":0}}]}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard + response: + body: + string: '{"id":"apm-met-ric","title":"Test-Create_a_new_dashboard_with_apm_metrics_widget-1740045600","description":null,"author_handle":"test@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/apm-met-ric/testcreateanewdashboardwithapmmetricswidget1740045600","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"requests":[{"queries":[{"data_source":"apm_metrics","group_by":["resource_name"],"name":"query1","query_filter":"env:prod","service":"web-store","stat":"hits"}],"response_format":"scalar"}],"title":"","title_align":"left","title_size":"16","type":"query_table"},"layout":{"height":4,"width":4,"x":0,"y":0},"id":1234567890123456}],"notify_list":null,"created_at":"2025-02-20T10:00:01.000000+00:00","modified_at":"2025-02-20T10:00:01.000000+00:00","restricted_roles":[]}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/apm-met-ric + response: + body: + string: '{"deleted_dashboard_id":"apm-met-ric"}' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v1/features/dashboards.feature b/tests/v1/features/dashboards.feature index a586f0f7dd..c6b72b6673 100644 --- a/tests/v1/features/dashboards.feature +++ b/tests/v1/features/dashboards.feature @@ -320,6 +320,20 @@ Feature: Dashboards And the response "widgets[0].definition.requests[0].queries[0].primary_tag_name" is equal to "datacenter" And the response "widgets[0].definition.requests[0].queries[0].operation_name" is equal to "cassandra.query" + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with apm metrics widget + Given new "CreateDashboard" request + And body with value { "title": "{{ unique }}", "widgets": [{"definition": { "title": "", "title_size": "16", "title_align": "left", "type": "query_table", "requests": [ { "response_format": "scalar", "queries": [ { "stat": "hits", "name": "query1", "service": "web-store", "data_source": "apm_metrics", "query_filter": "env:prod", "group_by": ["resource_name"] } ] } ] }, "layout": { "x": 0, "y": 0, "width": 4, "height": 4 } } ], "layout_type": "ordered" } + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.requests[0].response_format" is equal to "scalar" + And the response "widgets[0].definition.requests[0].queries[0].stat" is equal to "hits" + And the response "widgets[0].definition.requests[0].queries[0].group_by[0]" is equal to "resource_name" + And the response "widgets[0].definition.requests[0].queries[0].name" is equal to "query1" + And the response "widgets[0].definition.requests[0].queries[0].service" is equal to "web-store" + And the response "widgets[0].definition.requests[0].queries[0].data_source" is equal to "apm_metrics" + And the response "widgets[0].definition.requests[0].queries[0].query_filter" is equal to "env:prod" + @team:DataDog/dashboards-backend Scenario: Create a new dashboard with apm resource stats widget Given new "CreateDashboard" request diff --git a/tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.frozen deleted file mode 100644 index 1332175b3b..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2026-03-04T16:01:00.945Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.yaml deleted file mode 100644 index 32050b75d8..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_get_team_sync_configurations_returns_ok_response.yaml +++ /dev/null @@ -1,18 +0,0 @@ -interactions: -- request: - body: null - headers: - accept: - - application/json - method: GET - uri: https://api.datadoghq.com/api/v2/team/sync?filter%5Bsource%5D=github - response: - body: - string: '{"data":[{"id":"3d33cc55-aea4-4801-bb75-139d347298c9","type":"team_sync_bulk","attributes":{"frequency":"once","selection_state":[{"external_id":{"type":"organization","value":"1"},"operation":"include","scope":"subtree"}],"source":"github","sync_membership":false,"type":"link"}}]}' - headers: - content-type: - - application/vnd.api+json - status: - code: 200 - message: OK -version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.frozen b/tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.frozen deleted file mode 100644 index 8e230ad671..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2026-03-04T16:01:34.366Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.frozen new file mode 100644 index 0000000000..8723edd4fb --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-15T17:48:19.712Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.yaml b/tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.yaml similarity index 51% rename from tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.yaml rename to tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.yaml index 2c763c4501..53217b4c1c 100644 --- a/tests/v2/cassettes/test_scenarios/test_link_teams_with_github_teams_returns_no_content_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_sync_teams_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"selection_state":[{"external_id":{"type":"organization","value":"1"}}],"source":"github","type":"link"},"type":"team_sync_bulk"}}' + body: '{"data":{"attributes":{"source":"github","type":"link"},"type":"team_sync_bulk"}}' headers: accept: - '*/*' @@ -11,8 +11,10 @@ interactions: response: body: string: '' - headers: {} + headers: + content-type: + - text/plain status: - code: 204 - message: No Content + code: 200 + message: OK version: 1 diff --git a/tests/v2/features/teams.feature b/tests/v2/features/teams.feature index 480e3215e9..26bf0130d4 100644 --- a/tests/v2/features/teams.feature +++ b/tests/v2/features/teams.feature @@ -431,13 +431,20 @@ Feature: Teams Then the response status is 200 OK And the response "data" has length 1 - @team:DataDog/aaa-omg + @generated @skip @team:DataDog/aaa-omg Scenario: Get team sync configurations returns "OK" response Given new "GetTeamSync" request - And request contains "filter[source]" parameter with value "github" + And request contains "filter[source]" parameter from "REPLACE.ME" When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/aaa-omg + Scenario: Get team sync configurations returns "Team sync configurations not found" response + Given new "GetTeamSync" request + And request contains "filter[source]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Team sync configurations not found + @generated @skip @team:DataDog/aaa-omg Scenario: Get user memberships returns "API error response." response Given new "GetUserMemberships" request @@ -454,13 +461,6 @@ Feature: Teams Then the response status is 200 Represents a user's association to a team And the response "data" has length 0 - @team:DataDog/aaa-omg - Scenario: Link Teams with GitHub Teams returns "No Content" response - Given new "SyncTeams" request - And body with value {"data": {"attributes": {"source": "github", "type": "link", "selection_state": [{"external_id": {"type": "organization", "value": "1"}}]}, "type": "team_sync_bulk"}} - When the request is sent - Then the response status is 204 No Content - @generated @skip @team:DataDog/aaa-omg Scenario: Link Teams with GitHub Teams returns "OK" response Given new "SyncTeams" request @@ -582,6 +582,13 @@ Feature: Teams When the request is sent Then the response status is 204 No Content + @replay-only @team:DataDog/aaa-omg + Scenario: Sync teams returns "OK" response + Given new "SyncTeams" request + And body with value {"data": {"attributes": {"source": "github", "type": "link"}, "type": "team_sync_bulk"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/aaa-omg Scenario: Update a team link returns "API error response." response Given new "UpdateTeamLink" request