Skip to content

Commit 01b9f22

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Fix update custom logs destination test for Java (#1939)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent ba84d55 commit 01b9f22

File tree

5 files changed

+20
-12
lines changed

5 files changed

+20
-12
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-04-05 17:05:14.224046",
8-
"spec_repo_commit": "9b7c8967"
7+
"regenerated": "2024-04-05 19:46:32.515208",
8+
"spec_repo_commit": "cdcf2ed6"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-04-05 17:05:14.240804",
13-
"spec_repo_commit": "9b7c8967"
12+
"regenerated": "2024-04-05 19:46:32.532018",
13+
"spec_repo_commit": "cdcf2ed6"
1414
}
1515
}
1616
}

examples/v2/logs-custom-destinations/UpdateLogsCustomDestination.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
from os import environ
66
from datadog_api_client import ApiClient, Configuration
77
from datadog_api_client.v2.api.logs_custom_destinations_api import LogsCustomDestinationsApi
8+
from datadog_api_client.v2.model.custom_destination_attribute_tags_restriction_list_type import (
9+
CustomDestinationAttributeTagsRestrictionListType,
10+
)
811
from datadog_api_client.v2.model.custom_destination_type import CustomDestinationType
912
from datadog_api_client.v2.model.custom_destination_update_request import CustomDestinationUpdateRequest
1013
from datadog_api_client.v2.model.custom_destination_update_request_attributes import (
@@ -21,6 +24,10 @@
2124
data=CustomDestinationUpdateRequestDefinition(
2225
attributes=CustomDestinationUpdateRequestAttributes(
2326
name="Nginx logs (Updated)",
27+
query="source:nginx",
28+
enabled=False,
29+
forward_tags=False,
30+
forward_tags_restriction_list_type=CustomDestinationAttributeTagsRestrictionListType.BLOCK_LIST,
2431
),
2532
type=CustomDestinationType.CUSTOM_DESTINATION,
2633
id=CUSTOM_DESTINATION_DATA_ID,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-03-12T09:20:18.077Z
1+
2024-04-05T19:31:41.540Z

tests/v2/cassettes/test_scenarios/test_update_a_custom_destination_returns_ok_response.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"data":{"attributes":{"enabled":false,"forward_tags":false,"forward_tags_restriction_list":["host"],"forward_tags_restriction_list_type":"BLOCK_LIST","forwarder_destination":{"auth":{"password":"my-password","type":"basic","username":"my-username"},"endpoint":"https://example.com","type":"http"},"name":"Test-Update_a_custom_destination_returns_OK_response-1710235218","query":"source:nginx"},"type":"custom_destination"}}'
3+
body: '{"data":{"attributes":{"enabled":false,"forward_tags":false,"forward_tags_restriction_list":["host"],"forward_tags_restriction_list_type":"BLOCK_LIST","forwarder_destination":{"auth":{"password":"my-password","type":"basic","username":"my-username"},"endpoint":"https://example.com","type":"http"},"name":"Test-Update_a_custom_destination_returns_OK_response-1712345501","query":"source:nginx"},"type":"custom_destination"}}'
44
headers:
55
accept:
66
- application/json
@@ -10,7 +10,7 @@ interactions:
1010
uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations
1111
response:
1212
body:
13-
string: '{"data":{"id":"22ce0782-a48f-4340-98f5-fd3671b66e19","attributes":{"name":"Test-Update_a_custom_destination_returns_OK_response-1710235218","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","auth":{"type":"basic"},"type":"http"},"forward_tags_restriction_list_type":"BLOCK_LIST","forward_tags_restriction_list":["host"],"forward_tags":false},"type":"custom_destination"}}
13+
string: '{"data":{"id":"60f4b01e-7853-4d48-8f6d-b98802dca889","attributes":{"name":"Test-Update_a_custom_destination_returns_OK_response-1712345501","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","auth":{"type":"basic"},"type":"http"},"forward_tags_restriction_list_type":"BLOCK_LIST","forward_tags_restriction_list":["host"],"forward_tags":false},"type":"custom_destination"}}
1414
1515
'
1616
headers:
@@ -20,17 +20,18 @@ interactions:
2020
code: 200
2121
message: OK
2222
- request:
23-
body: '{"data":{"attributes":{"name":"Nginx logs (Updated)"},"id":"22ce0782-a48f-4340-98f5-fd3671b66e19","type":"custom_destination"}}'
23+
body: '{"data":{"attributes":{"enabled":false,"forward_tags":false,"forward_tags_restriction_list_type":"BLOCK_LIST","name":"Nginx
24+
logs (Updated)","query":"source:nginx"},"id":"60f4b01e-7853-4d48-8f6d-b98802dca889","type":"custom_destination"}}'
2425
headers:
2526
accept:
2627
- application/json
2728
content-type:
2829
- application/json
2930
method: PATCH
30-
uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/22ce0782-a48f-4340-98f5-fd3671b66e19
31+
uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/60f4b01e-7853-4d48-8f6d-b98802dca889
3132
response:
3233
body:
33-
string: '{"data":{"id":"22ce0782-a48f-4340-98f5-fd3671b66e19","attributes":{"name":"Nginx
34+
string: '{"data":{"id":"60f4b01e-7853-4d48-8f6d-b98802dca889","attributes":{"name":"Nginx
3435
logs (Updated)","query":"source:nginx","enabled":false,"forwarder_destination":{"endpoint":"https://example.com","auth":{"type":"basic"},"type":"http"},"forward_tags_restriction_list_type":"BLOCK_LIST","forward_tags_restriction_list":["host"],"forward_tags":false},"type":"custom_destination"}}
3536
3637
'
@@ -46,7 +47,7 @@ interactions:
4647
accept:
4748
- '*/*'
4849
method: DELETE
49-
uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/22ce0782-a48f-4340-98f5-fd3671b66e19
50+
uri: https://api.datadoghq.com/api/v2/logs/config/custom-destinations/60f4b01e-7853-4d48-8f6d-b98802dca889
5051
response:
5152
body:
5253
string: ''

tests/v2/features/logs_custom_destinations.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Feature: Logs Custom Destinations
226226
Given new "UpdateLogsCustomDestination" request
227227
And there is a valid "custom_destination" in the system
228228
And request contains "custom_destination_id" parameter from "custom_destination.data.id"
229-
And body with value {"data": {"attributes": {"name": "Nginx logs (Updated)"}, "type": "custom_destination", "id": "{{ custom_destination.data.id }}" }}
229+
And body with value {"data": {"attributes": {"name": "Nginx logs (Updated)", "query": "source:nginx", "enabled":false, "forward_tags":false, "forward_tags_restriction_list_type":"BLOCK_LIST"}, "type": "custom_destination", "id": "{{ custom_destination.data.id }}"}}
230230
When the request is sent
231231
Then the response status is 200 OK
232232
And the response "data.type" is equal to "custom_destination"

0 commit comments

Comments
 (0)