Skip to content

Commit

Permalink
Fix update custom logs destination test for Java (#72)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Apr 8, 2024
1 parent 4abdb8d commit 5446f88
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
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.6",
"regenerated": "2024-04-05 17:05:09.050525",
"spec_repo_commit": "9b7c8967"
"regenerated": "2024-04-05 19:46:20.796817",
"spec_repo_commit": "cdcf2ed6"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-04-05 17:05:09.094275",
"spec_repo_commit": "9b7c8967"
"regenerated": "2024-04-05 19:46:20.814022",
"spec_repo_commit": "cdcf2ed6"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Update a custom destination returns "OK" response
use datadog_api_client::datadog::configuration::Configuration;
use datadog_api_client::datadogV2::api::api_logs_custom_destinations::LogsCustomDestinationsAPI;
use datadog_api_client::datadogV2::model::CustomDestinationAttributeTagsRestrictionListType;
use datadog_api_client::datadogV2::model::CustomDestinationType;
use datadog_api_client::datadogV2::model::CustomDestinationUpdateRequest;
use datadog_api_client::datadogV2::model::CustomDestinationUpdateRequestAttributes;
Expand All @@ -17,7 +18,13 @@ async fn main() {
)
.attributes(
CustomDestinationUpdateRequestAttributes::new()
.name("Nginx logs (Updated)".to_string()),
.enabled(false)
.forward_tags(false)
.forward_tags_restriction_list_type(
CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
)
.name("Nginx logs (Updated)".to_string())
.query("source:nginx".to_string()),
),
);
let configuration = Configuration::new();
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-03-12T09:20:18.077Z
2024-04-05T19:31:41.540Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"request": {
"body": {
"string": "{\"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\"}}",
"string": "{\"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\"}}",
"encoding": null
},
"headers": {
Expand All @@ -19,7 +19,7 @@
},
"response": {
"body": {
"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\"}}\n",
"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\"}}\n",
"encoding": null
},
"headers": {
Expand All @@ -32,12 +32,12 @@
"message": "OK"
}
},
"recorded_at": "Tue, 12 Mar 2024 09:20:18 GMT"
"recorded_at": "Fri, 05 Apr 2024 19:31:41 GMT"
},
{
"request": {
"body": {
"string": "{\"data\":{\"attributes\":{\"name\":\"Nginx logs (Updated)\"},\"id\":\"22ce0782-a48f-4340-98f5-fd3671b66e19\",\"type\":\"custom_destination\"}}",
"string": "{\"data\":{\"attributes\":{\"enabled\":false,\"forward_tags\":false,\"forward_tags_restriction_list_type\":\"BLOCK_LIST\",\"name\":\"Nginx logs (Updated)\",\"query\":\"source:nginx\"},\"id\":\"60f4b01e-7853-4d48-8f6d-b98802dca889\",\"type\":\"custom_destination\"}}",
"encoding": null
},
"headers": {
Expand All @@ -49,11 +49,11 @@
]
},
"method": "patch",
"uri": "https://api.datadoghq.com/api/v2/logs/config/custom-destinations/22ce0782-a48f-4340-98f5-fd3671b66e19"
"uri": "https://api.datadoghq.com/api/v2/logs/config/custom-destinations/60f4b01e-7853-4d48-8f6d-b98802dca889"
},
"response": {
"body": {
"string": "{\"data\":{\"id\":\"22ce0782-a48f-4340-98f5-fd3671b66e19\",\"attributes\":{\"name\":\"Nginx 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\"}}\n",
"string": "{\"data\":{\"id\":\"60f4b01e-7853-4d48-8f6d-b98802dca889\",\"attributes\":{\"name\":\"Nginx 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\"}}\n",
"encoding": null
},
"headers": {
Expand All @@ -66,7 +66,7 @@
"message": "OK"
}
},
"recorded_at": "Tue, 12 Mar 2024 09:20:18 GMT"
"recorded_at": "Fri, 05 Apr 2024 19:31:41 GMT"
},
{
"request": {
Expand All @@ -77,7 +77,7 @@
]
},
"method": "delete",
"uri": "https://api.datadoghq.com/api/v2/logs/config/custom-destinations/22ce0782-a48f-4340-98f5-fd3671b66e19"
"uri": "https://api.datadoghq.com/api/v2/logs/config/custom-destinations/60f4b01e-7853-4d48-8f6d-b98802dca889"
},
"response": {
"body": {
Expand All @@ -94,7 +94,7 @@
"message": "No Content"
}
},
"recorded_at": "Tue, 12 Mar 2024 09:20:18 GMT"
"recorded_at": "Fri, 05 Apr 2024 19:31:41 GMT"
}
],
"recorded_with": "VCR 6.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ Feature: Logs Custom Destinations
Given new "UpdateLogsCustomDestination" request
And there is a valid "custom_destination" in the system
And request contains "custom_destination_id" parameter from "custom_destination.data.id"
And body with value {"data": {"attributes": {"name": "Nginx logs (Updated)"}, "type": "custom_destination", "id": "{{ custom_destination.data.id }}" }}
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 }}"}}
When the request is sent
Then the response status is 200 OK
And the response "data.type" is equal to "custom_destination"
Expand Down

0 comments on commit 5446f88

Please sign in to comment.