Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
4 changes: 2 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions examples/v2/metrics/CreateTagConfiguration.rb
Original file line number Diff line number Diff line change
@@ -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)
19 changes: 19 additions & 0 deletions examples/v2/metrics/CreateTagConfiguration_215159720.rb
Original file line number Diff line number Diff line change
@@ -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)
45 changes: 27 additions & 18 deletions features/v2/metrics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions features/v2/monitors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/datadog_api_client/v2/api/metrics_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ 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 = {})
data, _status_code, _headers = create_tag_configuration_with_http_info(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
Expand Down
4 changes: 2 additions & 2 deletions lib/datadog_api_client/v2/api/monitors_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,15 @@ 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 = {})
data, _status_code, _headers = update_monitor_config_policy_with_http_info(policy_id, body, opts)
data
end

# Edit a monitor configuration policy.
# Delete a monitor configuration policy.
#
# Edit a monitor configuration policy.
#
Expand Down