From 9607bcb7ff48295566869a3ff570c5890f1479ff Mon Sep 17 00:00:00 2001 From: Octogonapus Date: Mon, 3 Apr 2023 14:57:07 -0400 Subject: [PATCH 1/3] Fix describe_log_streams error --- src/stream.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stream.jl b/src/stream.jl index 5b2a1a9..589657a 100644 --- a/src/stream.jl +++ b/src/stream.jl @@ -134,7 +134,9 @@ end function describe_log_streams( config::AWSConfig, log_group_name::AbstractString, params::AbstractDict ) - return CloudWatch_Logs.describe_log_streams(log_group_name, params; aws_config=config) + full_params = Dict("logGroupName" => log_group_name) + append!(full_params, params) + return CloudWatch_Logs.describe_log_streams(full_params; aws_config=config) end """ From 67135fa18244452f7c3d9fe964244a0c847460aa Mon Sep 17 00:00:00 2001 From: Eric Davies Date: Tue, 4 Apr 2023 12:22:50 -0500 Subject: [PATCH 2/3] Update src/stream.jl --- src/stream.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stream.jl b/src/stream.jl index 589657a..9962b25 100644 --- a/src/stream.jl +++ b/src/stream.jl @@ -134,8 +134,8 @@ end function describe_log_streams( config::AWSConfig, log_group_name::AbstractString, params::AbstractDict ) - full_params = Dict("logGroupName" => log_group_name) - append!(full_params, params) + full_params = Dict{String,Any}("logGroupName" => log_group_name) + merge!(full_params, params) return CloudWatch_Logs.describe_log_streams(full_params; aws_config=config) end From 1b3f458858f7a2f71837387a9a9ffe607b93670e Mon Sep 17 00:00:00 2001 From: Eric Davies Date: Tue, 4 Apr 2023 13:56:14 -0500 Subject: [PATCH 3/3] Update tests to handle more AWS API changes --- test/online.jl | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/test/online.jl b/test/online.jl index f2fa009..6609967 100644 --- a/test/online.jl +++ b/test/online.jl @@ -114,8 +114,8 @@ @test create_stream(CFG, TEST_LOG_GROUP, stream_name) == stream_name response = CloudWatch_Logs.describe_log_streams( - TEST_LOG_GROUP, Dict( + "logGroupName" => TEST_LOG_GROUP, "logStreamNamePrefix" => stream_name, "limit" => 1, "orderBy" => "LogStreamName", @@ -129,8 +129,8 @@ delete_stream(CFG, TEST_LOG_GROUP, stream_name) response = CloudWatch_Logs.describe_log_streams( - TEST_LOG_GROUP, Dict( + "logGroupName" => TEST_LOG_GROUP, "logStreamNamePrefix" => stream_name, "limit" => 1, "orderBy" => "LogStreamName", @@ -145,8 +145,8 @@ stream_name = create_stream(CFG, TEST_LOG_GROUP) response = CloudWatch_Logs.describe_log_streams( - TEST_LOG_GROUP, Dict( + "logGroupName" => TEST_LOG_GROUP, "logStreamNamePrefix" => stream_name, "limit" => 1, "orderBy" => "LogStreamName", @@ -160,8 +160,8 @@ delete_stream(CFG, TEST_LOG_GROUP, stream_name) response = CloudWatch_Logs.describe_log_streams( - TEST_LOG_GROUP, Dict( + "logGroupName" => TEST_LOG_GROUP, "logStreamNamePrefix" => stream_name, "limit" => 1, "orderBy" => "LogStreamName", @@ -192,7 +192,8 @@ sleep(2) # wait until AWS has injested the logs; this may or may not be enough response = CloudWatch_Logs.get_log_events( - TEST_LOG_GROUP, stream_name, Dict("startFromHead" => true) + stream_name, + Dict("logGroupName" => TEST_LOG_GROUP, "startFromHead" => true), ) time_range = (start_time - 10):(CloudWatchLogs.unix_timestamp_ms() + 10) @@ -302,7 +303,8 @@ sleep(5) # wait until AWS has injested the logs; this may or may not be enough response = CloudWatch_Logs.get_log_events( - TEST_LOG_GROUP, stream_name, Dict("startFromHead" => true) + stream_name, + Dict("logGroupName" => TEST_LOG_GROUP, "startFromHead" => true), ) @test length(response["events"]) == 3 @@ -370,7 +372,8 @@ sleep(1) # wait until AWS has injested the logs; this may or may not be enough response = CloudWatch_Logs.get_log_events( - TEST_LOG_GROUP, stream_name, Dict("startFromHead" => true) + stream_name, + Dict("logGroupName" => TEST_LOG_GROUP, "startFromHead" => true), ) time_range = (start_time - 10):(CloudWatchLogs.unix_timestamp_ms() + 10) @@ -414,7 +417,9 @@ # wait for the logs to be submitted and for AWS to injest them sleep(10) - response = CloudWatch_Logs.get_log_events(TEST_LOG_GROUP, stream_name) + response = CloudWatch_Logs.get_log_events( + stream_name, Dict("logGroupName" => TEST_LOG_GROUP) + ) prev_token = "" num_events_injested = 0 while prev_token != response["nextBackwardToken"] @@ -423,7 +428,8 @@ num_events_injested += length(response["events"]) response = CloudWatch_Logs.get_log_events( - TEST_LOG_GROUP, stream_name, Dict("nextToken" => prev_token) + stream_name, + Dict("logGroupName" => TEST_LOG_GROUP, "nextToken" => prev_token), ) end @test num_events_injested == num_events @@ -456,7 +462,12 @@ sleep(10) # wait until AWS has injested the logs; this may or may not be enough response = CloudWatch_Logs.get_log_events( - TEST_LOG_GROUP, stream_name, Dict("startFromHead" => true, "limit" => 1) + stream_name, + Dict( + "logGroupName" => TEST_LOG_GROUP, + "startFromHead" => true, + "limit" => 1, + ), ) @test length(response["events"]) == 1 @@ -465,7 +476,12 @@ sleep(10) # wait until AWS has injested the logs; this may or may not be enough response = CloudWatch_Logs.get_log_events( - TEST_LOG_GROUP, stream_name, Dict("startFromHead" => false, "limit" => 1) + stream_name, + Dict( + "logGroupName" => TEST_LOG_GROUP, + "startFromHead" => false, + "limit" => 1, + ), ) @test length(response["events"]) == 1