diff --git a/.apigentools-info b/.apigentools-info index 1c5aa18e8b86..7dfccb86df4f 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2023-05-30 14:28:59.189755", - "spec_repo_commit": "adf5379f" + "regenerated": "2023-05-30 18:00:30.113968", + "spec_repo_commit": "a4e581c4" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2023-05-30 14:28:59.202177", - "spec_repo_commit": "adf5379f" + "regenerated": "2023-05-30 18:00:30.128881", + "spec_repo_commit": "a4e581c4" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 451b90810006..ecb53b33173b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -19484,7 +19484,7 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Too Many Requests - summary: Create a tag configuration + summary: Get a monitor configuration policy tags: - Metrics x-codegen-request-body-name: body @@ -19721,7 +19721,7 @@ paths: description: Unprocessable Entity '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Edit a monitor configuration policy + summary: Delete a monitor configuration policy tags: - Monitors x-codegen-request-body-name: body diff --git a/examples/v2/metrics/CreateTagConfiguration.rb b/examples/v2/metrics/CreateTagConfiguration.rb index 5a7deb8de0e7..454e609634ba 100644 --- a/examples/v2/metrics/CreateTagConfiguration.rb +++ b/examples/v2/metrics/CreateTagConfiguration.rb @@ -1,19 +1,20 @@ -# Create a tag configuration returns "Created" response +# Get a monitor configuration policy returns "Created" response require "datadog_api_client" api_instance = DatadogAPIClient::V2::MetricsAPI.new body = DatadogAPIClient::V2::MetricTagConfigurationCreateRequest.new({ data: DatadogAPIClient::V2::MetricTagConfigurationCreateData.new({ - type: DatadogAPIClient::V2::MetricTagConfigurationType::MANAGE_TAGS, - id: "ExampleMetric", attributes: DatadogAPIClient::V2::MetricTagConfigurationCreateAttributes.new({ + include_percentiles: false, + metric_type: DatadogAPIClient::V2::MetricTagConfigurationMetricTypes::DISTRIBUTION, tags: [ "app", "datacenter", ], - metric_type: DatadogAPIClient::V2::MetricTagConfigurationMetricTypes::GAUGE, }), + id: "http.endpoint.request", + type: DatadogAPIClient::V2::MetricTagConfigurationType::MANAGE_TAGS, }), }) -p api_instance.create_tag_configuration("ExampleMetric", body) +p api_instance.create_tag_configuration("metric_name", body) diff --git a/examples/v2/metrics/CreateTagConfiguration_215159720.rb b/examples/v2/metrics/CreateTagConfiguration_215159720.rb new file mode 100644 index 000000000000..5a7deb8de0e7 --- /dev/null +++ b/examples/v2/metrics/CreateTagConfiguration_215159720.rb @@ -0,0 +1,19 @@ +# Create a tag configuration returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::MetricsAPI.new + +body = DatadogAPIClient::V2::MetricTagConfigurationCreateRequest.new({ + data: DatadogAPIClient::V2::MetricTagConfigurationCreateData.new({ + type: DatadogAPIClient::V2::MetricTagConfigurationType::MANAGE_TAGS, + id: "ExampleMetric", + attributes: DatadogAPIClient::V2::MetricTagConfigurationCreateAttributes.new({ + tags: [ + "app", + "datacenter", + ], + metric_type: DatadogAPIClient::V2::MetricTagConfigurationMetricTypes::GAUGE, + }), + }), +}) +p api_instance.create_tag_configuration("ExampleMetric", body) diff --git a/examples/v2/monitors/UpdateMonitorConfigPolicy.rb b/examples/v2/monitors/UpdateMonitorConfigPolicy_1761088824.rb similarity index 100% rename from examples/v2/monitors/UpdateMonitorConfigPolicy.rb rename to examples/v2/monitors/UpdateMonitorConfigPolicy_1761088824.rb diff --git a/features/v2/metrics.feature b/features/v2/metrics.feature index 24b48241cf5b..9cbffc75d3cd 100644 --- a/features/v2/metrics.feature +++ b/features/v2/metrics.feature @@ -38,24 +38,6 @@ Feature: Metrics When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/metrics-experience - Scenario: Create a tag configuration returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "CreateTagConfiguration" request - And request contains "metric_name" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"include_percentiles": false, "metric_type": "distribution", "tags": ["app", "datacenter"]}, "id": "http.endpoint.request", "type": "manage_tags"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/metrics-experience - Scenario: Create a tag configuration returns "Conflict" response - Given a valid "appKeyAuth" key in the system - And new "CreateTagConfiguration" request - And request contains "metric_name" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"include_percentiles": false, "metric_type": "distribution", "tags": ["app", "datacenter"]}, "id": "http.endpoint.request", "type": "manage_tags"}} - When the request is sent - Then the response status is 409 Conflict - @replay-only @skip-validation @team:DataDog/metrics-experience Scenario: Create a tag configuration returns "Created" response Given a valid "appKeyAuth" key in the system @@ -141,6 +123,33 @@ Feature: Metrics Then the response status is 200 Success And the response "data[0].type" is equal to "manage_tags" + @generated @skip @team:DataDog/metrics-experience + Scenario: Get a monitor configuration policy returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "CreateTagConfiguration" request + And request contains "metric_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"include_percentiles": false, "metric_type": "distribution", "tags": ["app", "datacenter"]}, "id": "http.endpoint.request", "type": "manage_tags"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/metrics-experience + Scenario: Get a monitor configuration policy returns "Conflict" response + Given a valid "appKeyAuth" key in the system + And new "CreateTagConfiguration" request + And request contains "metric_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"include_percentiles": false, "metric_type": "distribution", "tags": ["app", "datacenter"]}, "id": "http.endpoint.request", "type": "manage_tags"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/metrics-experience + Scenario: Get a monitor configuration policy returns "Created" response + Given a valid "appKeyAuth" key in the system + And new "CreateTagConfiguration" request + And request contains "metric_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"include_percentiles": false, "metric_type": "distribution", "tags": ["app", "datacenter"]}, "id": "http.endpoint.request", "type": "manage_tags"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:DataDog/metrics-experience Scenario: List active tags and aggregations returns "Bad Request" response Given a valid "appKeyAuth" key in the system diff --git a/features/v2/monitors.feature b/features/v2/monitors.feature index 7585d0663d3e..07801000001b 100644 --- a/features/v2/monitors.feature +++ b/features/v2/monitors.feature @@ -51,6 +51,14 @@ Feature: Monitors When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/monitor-app + Scenario: Delete a monitor configuration policy returns "Unprocessable Entity" response + Given new "UpdateMonitorConfigPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"policy": {"tag_key": "datacenter", "tag_key_required": true, "valid_tag_values": ["prod", "staging"]}, "policy_type": "tag"}, "id": "00000000-0000-1234-0000-000000000000", "type": "monitor-config-policy"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @team:DataDog/monitor-app Scenario: Edit a monitor configuration policy returns "Not Found" response Given new "UpdateMonitorConfigPolicy" request diff --git a/lib/datadog_api_client/v2/api/metrics_api.rb b/lib/datadog_api_client/v2/api/metrics_api.rb index 3dc0a86f6aff..006614dd0b38 100644 --- a/lib/datadog_api_client/v2/api/metrics_api.rb +++ b/lib/datadog_api_client/v2/api/metrics_api.rb @@ -95,7 +95,7 @@ def create_bulk_tags_metrics_configuration_with_http_info(body, opts = {}) return data, status_code, headers end - # Create a tag configuration. + # Get a monitor configuration policy. # # @see #create_tag_configuration_with_http_info def create_tag_configuration(metric_name, body, opts = {}) @@ -103,7 +103,7 @@ def create_tag_configuration(metric_name, body, opts = {}) data end - # Create a tag configuration. + # Get a monitor configuration policy. # # Create and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric. # Optionally, include percentile aggregations on any distribution metric or configure custom aggregations diff --git a/lib/datadog_api_client/v2/api/monitors_api.rb b/lib/datadog_api_client/v2/api/monitors_api.rb index abbd96ced1e4..e7caca7dec8b 100644 --- a/lib/datadog_api_client/v2/api/monitors_api.rb +++ b/lib/datadog_api_client/v2/api/monitors_api.rb @@ -280,7 +280,7 @@ def list_monitor_config_policies_with_http_info(opts = {}) return data, status_code, headers end - # Edit a monitor configuration policy. + # Delete a monitor configuration policy. # # @see #update_monitor_config_policy_with_http_info def update_monitor_config_policy(policy_id, body, opts = {}) @@ -288,7 +288,7 @@ def update_monitor_config_policy(policy_id, body, opts = {}) data end - # Edit a monitor configuration policy. + # Delete a monitor configuration policy. # # Edit a monitor configuration policy. #