From ca55a833be6be506f90784af9cbc58a9e8496953 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 13 Jan 2026 16:16:58 +0000 Subject: [PATCH 1/4] Add subtest for synthetics multistep tests (#2865) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v1/openapi.yaml | 55 ++++ ...st-with-subtest-returns-OK-response.frozen | 1 + ...-test-with-subtest-returns-OK-response.yml | 111 ++++++++ .../CreateSyntheticsAPITest_2106135939.rb | 49 ++++ features/v1/synthetics.feature | 8 + ...tics_api_test_multi_step_with_subtest.json | 38 +++ lib/datadog_api_client/inflector.rb | 2 + .../v1/models/synthetics_api_step.rb | 3 +- .../v1/models/synthetics_api_subtest_step.rb | 236 ++++++++++++++++++ .../synthetics_api_subtest_step_subtype.rb | 26 ++ 10 files changed, 528 insertions(+), 1 deletion(-) create mode 100644 cassettes/features/v1/synthetics/Create-a-multistep-test-with-subtest-returns-OK-response.frozen create mode 100644 cassettes/features/v1/synthetics/Create-a-multistep-test-with-subtest-returns-OK-response.yml create mode 100644 examples/v1/synthetics/CreateSyntheticsAPITest_2106135939.rb create mode 100644 features/v1/synthetics_api_test_multi_step_with_subtest.json create mode 100644 lib/datadog_api_client/v1/models/synthetics_api_subtest_step.rb create mode 100644 lib/datadog_api_client/v1/models/synthetics_api_subtest_step_subtype.rb diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index e1d20130c1e8..c8cd24def74f 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -14766,6 +14766,61 @@ components: oneOf: - $ref: '#/components/schemas/SyntheticsAPITestStep' - $ref: '#/components/schemas/SyntheticsAPIWaitStep' + - $ref: '#/components/schemas/SyntheticsAPISubtestStep' + SyntheticsAPISubtestStep: + description: The subtest step used in a Synthetics multi-step API test. + properties: + allowFailure: + description: Determines whether or not to continue with test if this step + fails. + type: boolean + alwaysExecute: + description: A boolean set to always execute this step even if the previous + step failed or was skipped. + type: boolean + exitIfSucceed: + description: Determines whether or not to exit the test if the step succeeds. + type: boolean + extractedValuesFromScript: + description: Generate variables using JavaScript. + type: string + id: + description: ID of the step. + example: abc-def-123 + readOnly: true + type: string + isCritical: + description: 'Determines whether or not to consider the entire test as failed + if this step fails. + + Can be used only if `allowFailure` is `true`.' + type: boolean + name: + description: The name of the step. + example: Example step name + type: string + retry: + $ref: '#/components/schemas/SyntheticsTestOptionsRetry' + subtestPublicId: + description: Public ID of the test to be played as part of a `playSubTest` + step type. + example: '' + type: string + subtype: + $ref: '#/components/schemas/SyntheticsAPISubtestStepSubtype' + required: + - name + - subtype + - subtestPublicId + type: object + SyntheticsAPISubtestStepSubtype: + description: The subtype of the Synthetic multi-step API subtest step. + enum: + - playSubTest + example: playSubTest + type: string + x-enum-varnames: + - PLAY_SUB_TEST SyntheticsAPITest: description: Object containing details about a Synthetic API test. properties: diff --git a/cassettes/features/v1/synthetics/Create-a-multistep-test-with-subtest-returns-OK-response.frozen b/cassettes/features/v1/synthetics/Create-a-multistep-test-with-subtest-returns-OK-response.frozen new file mode 100644 index 000000000000..6a42079e5a11 --- /dev/null +++ b/cassettes/features/v1/synthetics/Create-a-multistep-test-with-subtest-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-12-26T15:22:45.114Z \ No newline at end of file diff --git a/cassettes/features/v1/synthetics/Create-a-multistep-test-with-subtest-returns-OK-response.yml b/cassettes/features/v1/synthetics/Create-a-multistep-test-with-subtest-returns-OK-response.yml new file mode 100644 index 000000000000..1947a482bc3a --- /dev/null +++ b/cassettes/features/v1/synthetics/Create-a-multistep-test-with-subtest-returns-OK-response.yml @@ -0,0 +1,111 @@ +http_interactions: +- recorded_at: Fri, 26 Dec 2025 15:22:45 GMT + request: + body: + encoding: UTF-8 + string: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateamultisteptestwithsubtestreturnsokresponse1766762565"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_http_test_payload.json","name":"Test-Create_a_multistep_test_with_subtest_returns_OK_response-1766762565","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_a_multistep_test_with_subtest_returns_OK_response-1766762565","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/synthetics/tests/api + response: + body: + encoding: UTF-8 + string: '{"public_id":"f8v-zk3-x5h","name":"Test-Create_a_multistep_test_with_subtest_returns_OK_response-1766762565","status":"live","type":"api","subtype":"http","tags":["testing:api"],"created_at":"2025-12-26T15:22:45.449340+00:00","modified_at":"2025-12-26T15:22:45.449340+00:00","config":{"assertions":[{"operator":"is","property":"{{ + PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONPath","target":{"elementsOperator":"atLeastOneElementMatches","jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesJSONSchema","target":{"jsonSchema":"{\"type\": + \"object\", \"properties\":{\"slideshow\":{\"type\":\"object\"}}}","metaSchema":"draft-07"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"},{"operator":"md5","target":"a","type":"bodyHash"},{"code":"const + hello = ''world'';","type":"javascript"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateamultisteptestwithsubtestreturnsokresponse1766762565"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"},"variablesFromScript":"dd.variable.set(\"FOO\", + \"foo\")"},"message":"BDD test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_a_multistep_test_with_subtest_returns_OK_response-1766762565","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"created_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"},"deleted_at":null,"monitor_id":246774114,"org_id":321813,"modified_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"}}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Fri, 26 Dec 2025 15:22:45 GMT + request: + body: + encoding: UTF-8 + string: '{"config":{"steps":[{"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"name":"request + is sent","request":{"basicAuth":{"password":"password","username":"username"},"method":"GET","url":"https://httpbin.org/status/200"},"subtype":"http"},{"name":"subtest + step","subtestPublicId":"f8v-zk3-x5h","subtype":"playSubTest"}]},"locations":["aws:us-east-2"],"message":"BDD + test payload: synthetics_api_test_multi_step_with_subtest.json","name":"Test-Create_a_multistep_test_with_subtest_returns_OK_response-1766762565","options":{"tick_every":60},"subtype":"multi","type":"api"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/synthetics/tests/api + response: + body: + encoding: UTF-8 + string: '{"public_id":"5kg-4fz-eh9","name":"Test-Create_a_multistep_test_with_subtest_returns_OK_response-1766762565","status":"live","type":"api","subtype":"multi","tags":[],"created_at":"2025-12-26T15:22:45.980687+00:00","modified_at":"2025-12-26T15:22:45.980687+00:00","config":{"steps":[{"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"name":"request + is sent","request":{"basicAuth":{"password":"password","username":"username"},"method":"GET","url":"https://httpbin.org/status/200"},"subtype":"http","id":"cyy-kz8-9b6"},{"name":"subtest + step","subtestPublicId":"f8v-zk3-x5h","subtype":"playSubTest","id":"se7-rsj-k3p"}]},"message":"BDD + test payload: synthetics_api_test_multi_step_with_subtest.json","options":{"tick_every":60},"locations":["aws:us-east-2"],"created_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"},"deleted_at":null,"monitor_id":246774122,"org_id":321813,"modified_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"}}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Fri, 26 Dec 2025 15:22:45 GMT + request: + body: + encoding: UTF-8 + string: '{"public_ids":["5kg-4fz-eh9"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete + response: + body: + encoding: UTF-8 + string: '{"deleted_tests":[{"public_id":"5kg-4fz-eh9","deleted_at":"2025-12-26T15:22:46.386306+00:00"}]} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Fri, 26 Dec 2025 15:22:45 GMT + request: + body: + encoding: UTF-8 + string: '{"public_ids":["f8v-zk3-x5h"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete + response: + body: + encoding: UTF-8 + string: '{"deleted_tests":[{"public_id":"f8v-zk3-x5h","deleted_at":"2025-12-26T15:22:46.982158+00:00"}]} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest_2106135939.rb b/examples/v1/synthetics/CreateSyntheticsAPITest_2106135939.rb new file mode 100644 index 000000000000..c61ac8b4e150 --- /dev/null +++ b/examples/v1/synthetics/CreateSyntheticsAPITest_2106135939.rb @@ -0,0 +1,49 @@ +# Create a multistep test with subtest returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::SyntheticsAPI.new + +# there is a valid "synthetics_api_test" in the system +SYNTHETICS_API_TEST_PUBLIC_ID = ENV["SYNTHETICS_API_TEST_PUBLIC_ID"] + +body = DatadogAPIClient::V1::SyntheticsAPITest.new({ + config: DatadogAPIClient::V1::SyntheticsAPITestConfig.new({ + steps: [ + DatadogAPIClient::V1::SyntheticsAPITestStep.new({ + assertions: [ + DatadogAPIClient::V1::SyntheticsAssertionTarget.new({ + operator: DatadogAPIClient::V1::SyntheticsAssertionOperator::IS, + type: DatadogAPIClient::V1::SyntheticsAssertionType::STATUS_CODE, + target: 200, + }), + ], + name: "request is sent", + request: DatadogAPIClient::V1::SyntheticsTestRequest.new({ + url: "https://httpbin.org/status/200", + method: "GET", + basic_auth: DatadogAPIClient::V1::SyntheticsBasicAuthWeb.new({ + password: "password", + username: "username", + }), + }), + subtype: DatadogAPIClient::V1::SyntheticsAPITestStepSubtype::HTTP, + }), + DatadogAPIClient::V1::SyntheticsAPISubtestStep.new({ + subtype: DatadogAPIClient::V1::SyntheticsAPISubtestStepSubtype::PLAY_SUB_TEST, + subtest_public_id: SYNTHETICS_API_TEST_PUBLIC_ID, + name: "subtest step", + }), + ], + }), + locations: [ + "aws:us-east-2", + ], + message: "BDD test payload: synthetics_api_test_multi_step_with_subtest.json", + name: "Example-Synthetic", + options: DatadogAPIClient::V1::SyntheticsTestOptions.new({ + tick_every: 60, + }), + subtype: DatadogAPIClient::V1::SyntheticsTestDetailsSubType::MULTI, + type: DatadogAPIClient::V1::SyntheticsAPITestType::API, +}) +p api_instance.create_synthetics_api_test(body) diff --git a/features/v1/synthetics.feature b/features/v1/synthetics.feature index 4d3e23061ae6..25b209f05ade 100644 --- a/features/v1/synthetics.feature +++ b/features/v1/synthetics.feature @@ -169,6 +169,14 @@ Feature: Synthetics And the response "config.steps[5].request.basicAuth.type" is equal to "oauth-client" And the response "config.steps[6].request.basicAuth.type" is equal to "oauth-rop" + @team:DataDog/synthetics-managing + Scenario: Create a multistep test with subtest returns "OK" response + Given there is a valid "synthetics_api_test" in the system + And new "CreateSyntheticsAPITest" request + And body from file "synthetics_api_test_multi_step_with_subtest.json" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/synthetics-managing Scenario: Create a private location returns "OK" response Given there is a valid "role" in the system diff --git a/features/v1/synthetics_api_test_multi_step_with_subtest.json b/features/v1/synthetics_api_test_multi_step_with_subtest.json new file mode 100644 index 000000000000..5d7375c18ad0 --- /dev/null +++ b/features/v1/synthetics_api_test_multi_step_with_subtest.json @@ -0,0 +1,38 @@ +{ + "config": { + "steps": [ + { + "assertions": [ + { + "operator": "is", + "type": "statusCode", + "target": 200 + } + ], + "name": "request is sent", + "request": { + "url": "https://httpbin.org/status/200", + "method": "GET", + "basicAuth": { + "password": "password", + "username": "username" + } + }, + "subtype": "http" + }, + { + "subtype": "playSubTest", + "subtestPublicId": "{{ synthetics_api_test.public_id }}", + "name": "subtest step" + } + ] + }, + "locations": ["aws:us-east-2"], + "message": "BDD test payload: synthetics_api_test_multi_step_with_subtest.json", + "name": "{{ unique }}", + "options": { + "tick_every": 60 + }, + "subtype": "multi", + "type": "api" +} diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 59bc1b2037db..6e3fbf1eef19 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -587,6 +587,8 @@ def overrides "v1.sunburst_widget_legend_table_type" => "SunburstWidgetLegendTableType", "v1.sunburst_widget_request" => "SunburstWidgetRequest", "v1.synthetics_api_step" => "SyntheticsAPIStep", + "v1.synthetics_api_subtest_step" => "SyntheticsAPISubtestStep", + "v1.synthetics_api_subtest_step_subtype" => "SyntheticsAPISubtestStepSubtype", "v1.synthetics_api_test" => "SyntheticsAPITest", "v1.synthetics_api_test_config" => "SyntheticsAPITestConfig", "v1.synthetics_api_test_failure_code" => "SyntheticsApiTestFailureCode", diff --git a/lib/datadog_api_client/v1/models/synthetics_api_step.rb b/lib/datadog_api_client/v1/models/synthetics_api_step.rb index 6305da734041..8b79b2af618f 100644 --- a/lib/datadog_api_client/v1/models/synthetics_api_step.rb +++ b/lib/datadog_api_client/v1/models/synthetics_api_step.rb @@ -27,7 +27,8 @@ class << self def openapi_one_of [ :'SyntheticsAPITestStep', - :'SyntheticsAPIWaitStep' + :'SyntheticsAPIWaitStep', + :'SyntheticsAPISubtestStep' ] end # Builds the object diff --git a/lib/datadog_api_client/v1/models/synthetics_api_subtest_step.rb b/lib/datadog_api_client/v1/models/synthetics_api_subtest_step.rb new file mode 100644 index 000000000000..0743268967d1 --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_api_subtest_step.rb @@ -0,0 +1,236 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # The subtest step used in a Synthetics multi-step API test. + class SyntheticsAPISubtestStep + include BaseGenericModel + + # Determines whether or not to continue with test if this step fails. + attr_accessor :allow_failure + + # A boolean set to always execute this step even if the previous step failed or was skipped. + attr_accessor :always_execute + + # Determines whether or not to exit the test if the step succeeds. + attr_accessor :exit_if_succeed + + # Generate variables using JavaScript. + attr_accessor :extracted_values_from_script + + # ID of the step. + attr_accessor :id + + # Determines whether or not to consider the entire test as failed if this step fails. + # Can be used only if `allowFailure` is `true`. + attr_accessor :is_critical + + # The name of the step. + attr_reader :name + + # Object describing the retry strategy to apply to a Synthetic test. + attr_accessor :_retry + + # Public ID of the test to be played as part of a `playSubTest` step type. + attr_reader :subtest_public_id + + # The subtype of the Synthetic multi-step API subtest step. + attr_reader :subtype + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'allow_failure' => :'allowFailure', + :'always_execute' => :'alwaysExecute', + :'exit_if_succeed' => :'exitIfSucceed', + :'extracted_values_from_script' => :'extractedValuesFromScript', + :'id' => :'id', + :'is_critical' => :'isCritical', + :'name' => :'name', + :'_retry' => :'retry', + :'subtest_public_id' => :'subtestPublicId', + :'subtype' => :'subtype' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'allow_failure' => :'Boolean', + :'always_execute' => :'Boolean', + :'exit_if_succeed' => :'Boolean', + :'extracted_values_from_script' => :'String', + :'id' => :'String', + :'is_critical' => :'Boolean', + :'name' => :'String', + :'_retry' => :'SyntheticsTestOptionsRetry', + :'subtest_public_id' => :'String', + :'subtype' => :'SyntheticsAPISubtestStepSubtype' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsAPISubtestStep` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'allow_failure') + self.allow_failure = attributes[:'allow_failure'] + end + + if attributes.key?(:'always_execute') + self.always_execute = attributes[:'always_execute'] + end + + if attributes.key?(:'exit_if_succeed') + self.exit_if_succeed = attributes[:'exit_if_succeed'] + end + + if attributes.key?(:'extracted_values_from_script') + self.extracted_values_from_script = attributes[:'extracted_values_from_script'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'is_critical') + self.is_critical = attributes[:'is_critical'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'_retry') + self._retry = attributes[:'_retry'] + end + + if attributes.key?(:'subtest_public_id') + self.subtest_public_id = attributes[:'subtest_public_id'] + end + + if attributes.key?(:'subtype') + self.subtype = attributes[:'subtype'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + return false if @subtest_public_id.nil? + return false if @subtype.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param subtest_public_id [Object] Object to be assigned + # @!visibility private + def subtest_public_id=(subtest_public_id) + if subtest_public_id.nil? + fail ArgumentError, 'invalid value for "subtest_public_id", subtest_public_id cannot be nil.' + end + @subtest_public_id = subtest_public_id + end + + # Custom attribute writer method with validation + # @param subtype [Object] Object to be assigned + # @!visibility private + def subtype=(subtype) + if subtype.nil? + fail ArgumentError, 'invalid value for "subtype", subtype cannot be nil.' + end + @subtype = subtype + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + allow_failure == o.allow_failure && + always_execute == o.always_execute && + exit_if_succeed == o.exit_if_succeed && + extracted_values_from_script == o.extracted_values_from_script && + id == o.id && + is_critical == o.is_critical && + name == o.name && + _retry == o._retry && + subtest_public_id == o.subtest_public_id && + subtype == o.subtype && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [allow_failure, always_execute, exit_if_succeed, extracted_values_from_script, id, is_critical, name, _retry, subtest_public_id, subtype, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/synthetics_api_subtest_step_subtype.rb b/lib/datadog_api_client/v1/models/synthetics_api_subtest_step_subtype.rb new file mode 100644 index 000000000000..df5e57d415f6 --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_api_subtest_step_subtype.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # The subtype of the Synthetic multi-step API subtest step. + class SyntheticsAPISubtestStepSubtype + include BaseEnumModel + + PLAY_SUB_TEST = "playSubTest".freeze + end +end From cc24da39de05bae5c1f1047885b8037c237806bf Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 13 Jan 2026 16:36:07 +0000 Subject: [PATCH 2/4] Add region_filter_configs and is_global_location_enabled to v2 GCP API (#2808) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 19 +++++++++++++++ features/v2/gcp_integration.feature | 8 +++---- .../gcpsts_service_account_attributes.rb | 24 ++++++++++++++++++- 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6f4a04ffa01e..0910438e4a25 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -23984,6 +23984,13 @@ components: product for this service account. Note: This requires resource_collection_enabled to be set to true.' type: boolean + is_global_location_enabled: + default: true + description: When enabled, Datadog collects metrics where location is explicitly + stated as "global" or where location information cannot be deduced from + GCP labels. + example: true + type: boolean is_per_project_quota_enabled: default: false description: When enabled, Datadog applies the `X-Goog-User-Project` header, @@ -24025,6 +24032,18 @@ components: items: $ref: '#/components/schemas/GCPMonitoredResourceConfig' type: array + region_filter_configs: + description: Configurations for GCP location filtering, such as region, + multi-region, or zone. Only monitored resources that match the specified + regions are imported into Datadog. By default, Datadog collects from all + locations. + example: + - nam4 + - europe-north1 + items: + description: Region Filter Configs + type: string + type: array resource_collection_enabled: description: When enabled, Datadog scans for all resources in your GCP environment. type: boolean diff --git a/features/v2/gcp_integration.feature b/features/v2/gcp_integration.feature index 6d47a1508eb6..6dcb271ec177 100644 --- a/features/v2/gcp_integration.feature +++ b/features/v2/gcp_integration.feature @@ -34,14 +34,14 @@ Feature: GCP Integration @generated @skip @team:DataDog/gcp-integrations Scenario: Create a new entry for your service account returns "Bad Request" response Given new "CreateGCPSTSAccount" request - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["nam4", "europe-north1"]}, "type": "gcp_service_account"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/gcp-integrations Scenario: Create a new entry for your service account returns "Conflict" response Given new "CreateGCPSTSAccount" request - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["nam4", "europe-north1"]}, "type": "gcp_service_account"}} When the request is sent Then the response status is 409 Conflict @@ -151,7 +151,7 @@ Feature: GCP Integration Scenario: Update STS Service Account returns "Bad Request" response Given new "UpdateGCPSTSAccount" request And request contains "account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["nam4", "europe-north1"]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} When the request is sent Then the response status is 400 Bad Request @@ -159,7 +159,7 @@ Feature: GCP Integration Scenario: Update STS Service Account returns "Not Found" response Given new "UpdateGCPSTSAccount" request And request contains "account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["nam4", "europe-north1"]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} When the request is sent Then the response status is 404 Not Found diff --git a/lib/datadog_api_client/v2/models/gcpsts_service_account_attributes.rb b/lib/datadog_api_client/v2/models/gcpsts_service_account_attributes.rb index f35f2baf5f2f..7b42afdb7f2c 100644 --- a/lib/datadog_api_client/v2/models/gcpsts_service_account_attributes.rb +++ b/lib/datadog_api_client/v2/models/gcpsts_service_account_attributes.rb @@ -43,6 +43,9 @@ class GCPSTSServiceAccountAttributes # When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true. attr_accessor :is_cspm_enabled + # When enabled, Datadog collects metrics where location is explicitly stated as "global" or where location information cannot be deduced from GCP labels. + attr_accessor :is_global_location_enabled + # When enabled, Datadog applies the `X-Goog-User-Project` header, attributing Google Cloud billing and quota usage to the project being monitored rather than the default service account project. attr_accessor :is_per_project_quota_enabled @@ -58,6 +61,9 @@ class GCPSTSServiceAccountAttributes # Configurations for GCP monitored resources. attr_accessor :monitored_resource_configs + # Configurations for GCP location filtering, such as region, multi-region, or zone. Only monitored resources that match the specified regions are imported into Datadog. By default, Datadog collects from all locations. + attr_accessor :region_filter_configs + # When enabled, Datadog scans for all resources in your GCP environment. attr_accessor :resource_collection_enabled @@ -73,11 +79,13 @@ def self.attribute_map :'cloud_run_revision_filters' => :'cloud_run_revision_filters', :'host_filters' => :'host_filters', :'is_cspm_enabled' => :'is_cspm_enabled', + :'is_global_location_enabled' => :'is_global_location_enabled', :'is_per_project_quota_enabled' => :'is_per_project_quota_enabled', :'is_resource_change_collection_enabled' => :'is_resource_change_collection_enabled', :'is_security_command_center_enabled' => :'is_security_command_center_enabled', :'metric_namespace_configs' => :'metric_namespace_configs', :'monitored_resource_configs' => :'monitored_resource_configs', + :'region_filter_configs' => :'region_filter_configs', :'resource_collection_enabled' => :'resource_collection_enabled' } end @@ -92,11 +100,13 @@ def self.openapi_types :'cloud_run_revision_filters' => :'Array', :'host_filters' => :'Array', :'is_cspm_enabled' => :'Boolean', + :'is_global_location_enabled' => :'Boolean', :'is_per_project_quota_enabled' => :'Boolean', :'is_resource_change_collection_enabled' => :'Boolean', :'is_security_command_center_enabled' => :'Boolean', :'metric_namespace_configs' => :'Array', :'monitored_resource_configs' => :'Array', + :'region_filter_configs' => :'Array', :'resource_collection_enabled' => :'Boolean' } end @@ -149,6 +159,10 @@ def initialize(attributes = {}) self.is_cspm_enabled = attributes[:'is_cspm_enabled'] end + if attributes.key?(:'is_global_location_enabled') + self.is_global_location_enabled = attributes[:'is_global_location_enabled'] + end + if attributes.key?(:'is_per_project_quota_enabled') self.is_per_project_quota_enabled = attributes[:'is_per_project_quota_enabled'] end @@ -173,6 +187,12 @@ def initialize(attributes = {}) end end + if attributes.key?(:'region_filter_configs') + if (value = attributes[:'region_filter_configs']).is_a?(Array) + self.region_filter_configs = value + end + end + if attributes.key?(:'resource_collection_enabled') self.resource_collection_enabled = attributes[:'resource_collection_enabled'] end @@ -210,11 +230,13 @@ def ==(o) cloud_run_revision_filters == o.cloud_run_revision_filters && host_filters == o.host_filters && is_cspm_enabled == o.is_cspm_enabled && + is_global_location_enabled == o.is_global_location_enabled && is_per_project_quota_enabled == o.is_per_project_quota_enabled && is_resource_change_collection_enabled == o.is_resource_change_collection_enabled && is_security_command_center_enabled == o.is_security_command_center_enabled && metric_namespace_configs == o.metric_namespace_configs && monitored_resource_configs == o.monitored_resource_configs && + region_filter_configs == o.region_filter_configs && resource_collection_enabled == o.resource_collection_enabled && additional_properties == o.additional_properties end @@ -223,7 +245,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [account_tags, automute, client_email, cloud_run_revision_filters, host_filters, is_cspm_enabled, is_per_project_quota_enabled, is_resource_change_collection_enabled, is_security_command_center_enabled, metric_namespace_configs, monitored_resource_configs, resource_collection_enabled, additional_properties].hash + [account_tags, automute, client_email, cloud_run_revision_filters, host_filters, is_cspm_enabled, is_global_location_enabled, is_per_project_quota_enabled, is_resource_change_collection_enabled, is_security_command_center_enabled, metric_namespace_configs, monitored_resource_configs, region_filter_configs, resource_collection_enabled, additional_properties].hash end end end From e300c5416dc69b40395474534c5c95ea18e69234 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 13 Jan 2026 18:09:13 +0000 Subject: [PATCH 3/4] Add subtest for synthetics multistep tests (#2901) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v1/openapi.yaml | 1 - .../v1/models/heat_map_widget_x_axis.rb | 20 +------------------ 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index c8cd24def74f..56084ed19bc7 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -3865,7 +3865,6 @@ components: points (group distributions use the roll-up modifier).' format: int64 - minimum: 1 type: integer type: object Host: diff --git a/lib/datadog_api_client/v1/models/heat_map_widget_x_axis.rb b/lib/datadog_api_client/v1/models/heat_map_widget_x_axis.rb index 766d953109d4..8dcac8e136b8 100644 --- a/lib/datadog_api_client/v1/models/heat_map_widget_x_axis.rb +++ b/lib/datadog_api_client/v1/models/heat_map_widget_x_axis.rb @@ -24,7 +24,7 @@ class HeatMapWidgetXAxis # Number of time buckets to target, also known as the resolution # of the time bins. This is only applicable for distribution of # points (group distributions use the roll-up modifier). - attr_reader :num_buckets + attr_accessor :num_buckets attr_accessor :additional_properties @@ -67,24 +67,6 @@ def initialize(attributes = {}) end end - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if !@num_buckets.nil? && @num_buckets < 1 - true - end - - # Custom attribute writer method with validation - # @param num_buckets [Object] Object to be assigned - # @!visibility private - def num_buckets=(num_buckets) - if !num_buckets.nil? && num_buckets < 1 - fail ArgumentError, 'invalid value for "num_buckets", must be greater than or equal to 1.' - end - @num_buckets = num_buckets - end - # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private From 7749ccdcd742b8d82adc89e98caa69f69db63c8f Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 13 Jan 2026 19:55:46 +0000 Subject: [PATCH 4/4] [REDHOSTS-612] Update Tags API Documentation (#2822) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v1/openapi.yaml | 68 ++++++++++--------- examples/v1/tags/GetHostTags.rb | 2 +- examples/v1/tags/ListHostTags.rb | 2 +- features/v1/tags.feature | 15 ++-- lib/datadog_api_client/v1/api/tags_api.rb | 34 +++++----- lib/datadog_api_client/v1/models/host_tags.rb | 4 +- .../v1/models/tag_to_hosts.rb | 4 +- 7 files changed, 67 insertions(+), 62 deletions(-) diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 56084ed19bc7..00de5f7dc6f9 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -4219,14 +4219,14 @@ components: type: boolean type: object HostTags: - description: Set of tags to associate with your host. + description: Host name and an array of its tags properties: host: description: Your host name. example: test.host type: string tags: - description: A list of tags to apply to the host. + description: A list of tags associated with a host. items: description: A given tag in a list. example: environment:production @@ -18972,18 +18972,18 @@ components: - match type: object TagToHosts: - description: In this object, the key is the tag, the value is a list of host - names that are reporting that tag. + description: In this object, the key is the tag, and the value is a list of + host names that are reporting that tag. properties: tags: additionalProperties: - description: A list of additional properties for tags. + description: A list of host names which contain this tag items: description: A given tag in a list. example: test.metric.host type: string type: array - description: A list of tags to apply to the host. + description: A mapping of tags to host names type: object type: object TargetFormatType: @@ -36008,11 +36008,13 @@ paths: - synthetics_global_variable_write /api/v1/tags/hosts: get: - description: Return a mapping of tags to hosts for your whole infrastructure. + description: Returns a mapping of tags to hosts. For each tag, the response + returns a list of host names that contain this tag. There is a restriction + of 10k total host names from the org that can be attached to tags and returned. operationId: ListHostTags parameters: - - description: When specified, filters host list to those tags with the specified - source. + - description: Source to filter. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). + Use "user" source for custom-defined tags. in: query name: source required: false @@ -36043,7 +36045,7 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: [] - summary: Get Tags + summary: Get All Host Tags tags: - Tags x-permission: @@ -36051,21 +36053,21 @@ paths: permissions: [] /api/v1/tags/hosts/{host_name}: delete: - description: 'This endpoint allows you to remove all user-assigned tags + description: 'This endpoint allows you to remove all tags - for a single host.' + for a single host. If no source is specified, only deletes from the source + "User".' operationId: DeleteHostTags parameters: - - description: This endpoint allows you to remove all user-assigned tags for - a single host. + - description: Specified host name to delete tags in: path name: host_name required: true schema: type: string - - description: 'The source of the tags (for example chef, puppet). - - [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).' + - description: Source of the tags to be deleted. [Complete list of source attribute + values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). + Use "user" source for custom-defined tags. in: query name: source required: false @@ -36095,14 +36097,14 @@ paths: description: Return the list of tags that apply to a given host. operationId: GetHostTags parameters: - - description: When specified, filters list of tags to those tags with the specified - source. + - description: Name of the host to retrieve tags for in: path name: host_name required: true schema: type: string - - description: Source to filter. + - description: Source to filter. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). + Use "user" source for custom-defined tags. in: query name: source required: false @@ -36129,25 +36131,25 @@ paths: description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get host tags + summary: Get Host Tags tags: - Tags post: description: 'This endpoint allows you to add new tags to a host, - optionally specifying where these tags come from.' + optionally specifying what source these tags come from. If tags already exist, + appends new tags to the tag list. If no source is specified, defaults to "user".' operationId: CreateHostTags parameters: - - description: This endpoint allows you to add new tags to a host, optionally - specifying where the tags came from. + - description: Specified host name to add new tags in: path name: host_name required: true schema: type: string - - description: 'The source of the tags. - - [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).' + - description: Source to add tags. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). + Use "user" source for custom-defined tags. If no source is specified, defaults + to "user". example: chef in: query name: source @@ -36192,16 +36194,15 @@ paths: an integration source with those supplied in the request.' operationId: UpdateHostTags parameters: - - description: This endpoint allows you to update/replace all in an integration - source with those supplied in the request. + - description: Specified host name to change tags in: path name: host_name required: true schema: type: string - - description: 'The source of the tags (for example chef, puppet). - - [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value)' + - description: Source to update tags. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). + Use "user" source for custom-defined tags. If no source specified, defaults + to "user". in: query name: source required: false @@ -39217,7 +39218,8 @@ tags: by a source. For example, some valid sources include nagios, hudson, jenkins, - users, feed, chef, puppet, git, bitbucket, fabric, capistrano, etc. + users, feed, chef, puppet, git, bitbucket, fabric, capistrano, etc. Find a complete + list of source type names under [API Source Attributes](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). Read more about tags on [Getting Started with Tags](https://docs.datadoghq.com/getting_started/tagging/).' diff --git a/examples/v1/tags/GetHostTags.rb b/examples/v1/tags/GetHostTags.rb index b2ca9e0a1189..e69699394ea4 100644 --- a/examples/v1/tags/GetHostTags.rb +++ b/examples/v1/tags/GetHostTags.rb @@ -1,4 +1,4 @@ -# Get host tags returns "OK" response +# Get Host Tags returns "OK" response require "datadog_api_client" api_instance = DatadogAPIClient::V1::TagsAPI.new diff --git a/examples/v1/tags/ListHostTags.rb b/examples/v1/tags/ListHostTags.rb index 64d438a3d8fe..b69d45d004b9 100644 --- a/examples/v1/tags/ListHostTags.rb +++ b/examples/v1/tags/ListHostTags.rb @@ -1,4 +1,4 @@ -# Get Tags returns "OK" response +# Get All Host Tags returns "OK" response require "datadog_api_client" api_instance = DatadogAPIClient::V1::TagsAPI.new diff --git a/features/v1/tags.feature b/features/v1/tags.feature index 36e1eabfdc25..d6557ca18821 100644 --- a/features/v1/tags.feature +++ b/features/v1/tags.feature @@ -6,8 +6,11 @@ Feature: Tags tags to a particular host. The component of your infrastructure responsible for a tag is identified by a source. For example, some valid sources include nagios, hudson, jenkins, users, feed, chef, puppet, git, - bitbucket, fabric, capistrano, etc. Read more about tags on [Getting - Started with Tags](https://docs.datadoghq.com/getting_started/tagging/). + bitbucket, fabric, capistrano, etc. Find a complete list of source type + names under [API Source + Attributes](https://docs.datadoghq.com/integrations/faq/list-of-api- + source-attribute-value). Read more about tags on [Getting Started with + Tags](https://docs.datadoghq.com/getting_started/tagging/). Background: Given a valid "apiKeyAuth" key in the system @@ -31,26 +34,26 @@ Feature: Tags Then the response status is 404 Not Found @generated @skip @team:DataDog/core-index - Scenario: Get Tags returns "Not Found" response + Scenario: Get All Host Tags returns "Not Found" response Given new "ListHostTags" request When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/core-index - Scenario: Get Tags returns "OK" response + Scenario: Get All Host Tags returns "OK" response Given new "ListHostTags" request When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/core-index - Scenario: Get host tags returns "Not Found" response + Scenario: Get Host Tags returns "Not Found" response Given new "GetHostTags" request And request contains "host_name" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/core-index - Scenario: Get host tags returns "OK" response + Scenario: Get Host Tags returns "OK" response Given new "GetHostTags" request And request contains "host_name" parameter from "REPLACE.ME" When the request is sent diff --git a/lib/datadog_api_client/v1/api/tags_api.rb b/lib/datadog_api_client/v1/api/tags_api.rb index 7f07a24ccb44..a789ff0794bf 100644 --- a/lib/datadog_api_client/v1/api/tags_api.rb +++ b/lib/datadog_api_client/v1/api/tags_api.rb @@ -34,12 +34,12 @@ def create_host_tags(host_name, body, opts = {}) # Add tags to a host. # # This endpoint allows you to add new tags to a host, - # optionally specifying where these tags come from. + # optionally specifying what source these tags come from. If tags already exist, appends new tags to the tag list. If no source is specified, defaults to "user". # - # @param host_name [String] This endpoint allows you to add new tags to a host, optionally specifying where the tags came from. + # @param host_name [String] Specified host name to add new tags # @param body [HostTags] Update host tags request body. # @param opts [Hash] the optional parameters - # @option opts [String] :source The source of the tags. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). + # @option opts [String] :source Source to add tags. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). Use "user" source for custom-defined tags. If no source is specified, defaults to "user". # @return [Array<(HostTags, Integer, Hash)>] HostTags data, response status code and response headers def create_host_tags_with_http_info(host_name, body, opts = {}) @@ -108,12 +108,12 @@ def delete_host_tags(host_name, opts = {}) # Remove host tags. # - # This endpoint allows you to remove all user-assigned tags - # for a single host. + # This endpoint allows you to remove all tags + # for a single host. If no source is specified, only deletes from the source "User". # - # @param host_name [String] This endpoint allows you to remove all user-assigned tags for a single host. + # @param host_name [String] Specified host name to delete tags # @param opts [Hash] the optional parameters - # @option opts [String] :source The source of the tags (for example chef, puppet). [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). + # @option opts [String] :source Source of the tags to be deleted. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). Use "user" source for custom-defined tags. # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_host_tags_with_http_info(host_name, opts = {}) @@ -166,7 +166,7 @@ def delete_host_tags_with_http_info(host_name, opts = {}) return data, status_code, headers end - # Get host tags. + # Get Host Tags. # # @see #get_host_tags_with_http_info def get_host_tags(host_name, opts = {}) @@ -174,13 +174,13 @@ def get_host_tags(host_name, opts = {}) data end - # Get host tags. + # Get Host Tags. # # Return the list of tags that apply to a given host. # - # @param host_name [String] When specified, filters list of tags to those tags with the specified source. + # @param host_name [String] Name of the host to retrieve tags for # @param opts [Hash] the optional parameters - # @option opts [String] :source Source to filter. + # @option opts [String] :source Source to filter. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). Use "user" source for custom-defined tags. # @return [Array<(HostTags, Integer, Hash)>] HostTags data, response status code and response headers def get_host_tags_with_http_info(host_name, opts = {}) @@ -233,7 +233,7 @@ def get_host_tags_with_http_info(host_name, opts = {}) return data, status_code, headers end - # Get Tags. + # Get All Host Tags. # # @see #list_host_tags_with_http_info def list_host_tags(opts = {}) @@ -241,12 +241,12 @@ def list_host_tags(opts = {}) data end - # Get Tags. + # Get All Host Tags. # - # Return a mapping of tags to hosts for your whole infrastructure. + # Returns a mapping of tags to hosts. For each tag, the response returns a list of host names that contain this tag. There is a restriction of 10k total host names from the org that can be attached to tags and returned. # # @param opts [Hash] the optional parameters - # @option opts [String] :source When specified, filters host list to those tags with the specified source. + # @option opts [String] :source Source to filter. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). Use "user" source for custom-defined tags. # @return [Array<(TagToHosts, Integer, Hash)>] TagToHosts data, response status code and response headers def list_host_tags_with_http_info(opts = {}) @@ -308,10 +308,10 @@ def update_host_tags(host_name, body, opts = {}) # This endpoint allows you to update/replace all tags in # an integration source with those supplied in the request. # - # @param host_name [String] This endpoint allows you to update/replace all in an integration source with those supplied in the request. + # @param host_name [String] Specified host name to change tags # @param body [HostTags] Add tags to host # @param opts [Hash] the optional parameters - # @option opts [String] :source The source of the tags (for example chef, puppet). [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value) + # @option opts [String] :source Source to update tags. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). Use "user" source for custom-defined tags. If no source specified, defaults to "user". # @return [Array<(HostTags, Integer, Hash)>] HostTags data, response status code and response headers def update_host_tags_with_http_info(host_name, body, opts = {}) diff --git a/lib/datadog_api_client/v1/models/host_tags.rb b/lib/datadog_api_client/v1/models/host_tags.rb index 95e8e40ff23a..f6376def23ea 100644 --- a/lib/datadog_api_client/v1/models/host_tags.rb +++ b/lib/datadog_api_client/v1/models/host_tags.rb @@ -17,14 +17,14 @@ require 'time' module DatadogAPIClient::V1 - # Set of tags to associate with your host. + # Host name and an array of its tags class HostTags include BaseGenericModel # Your host name. attr_accessor :host - # A list of tags to apply to the host. + # A list of tags associated with a host. attr_accessor :tags attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v1/models/tag_to_hosts.rb b/lib/datadog_api_client/v1/models/tag_to_hosts.rb index 1c06c7f7a0c3..eb12598a3aef 100644 --- a/lib/datadog_api_client/v1/models/tag_to_hosts.rb +++ b/lib/datadog_api_client/v1/models/tag_to_hosts.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V1 - # In this object, the key is the tag, the value is a list of host names that are reporting that tag. + # In this object, the key is the tag, and the value is a list of host names that are reporting that tag. class TagToHosts include BaseGenericModel - # A list of tags to apply to the host. + # A mapping of tags to host names attr_accessor :tags attr_accessor :additional_properties