From d112da6f3c33c2d20d9b48e10e4e3ecd14653be0 Mon Sep 17 00:00:00 2001 From: Kyle Verhoog Date: Mon, 23 Oct 2023 11:24:15 -0400 Subject: [PATCH] Add GET support for /v0.7/config (#142) --- ddapm_test_agent/agent.py | 1 + releasenotes/notes/rc-get-endpoint-e502f55b7df544e2.yaml | 5 +++++ tests/test_remoteconfig.py | 9 ++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/rc-get-endpoint-e502f55b7df544e2.yaml diff --git a/ddapm_test_agent/agent.py b/ddapm_test_agent/agent.py index 3118a005..9fa12e2f 100644 --- a/ddapm_test_agent/agent.py +++ b/ddapm_test_agent/agent.py @@ -985,6 +985,7 @@ def make_app( web.post("/v0.6/stats", agent.handle_v06_tracestats), web.post("/v0.1/pipeline_stats", agent.handle_v01_pipelinestats), web.put("/v0.6/stats", agent.handle_v06_tracestats), + web.get("/v0.7/config", agent.handle_v07_remoteconfig), web.post("/v0.7/config", agent.handle_v07_remoteconfig), web.post("/telemetry/proxy/api/v2/apmtelemetry", agent.handle_v2_apmtelemetry), web.post("/profiling/v1/input", agent.handle_v1_profiling), diff --git a/releasenotes/notes/rc-get-endpoint-e502f55b7df544e2.yaml b/releasenotes/notes/rc-get-endpoint-e502f55b7df544e2.yaml new file mode 100644 index 00000000..1e79c93c --- /dev/null +++ b/releasenotes/notes/rc-get-endpoint-e502f55b7df544e2.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Add GET method support for the ``/v0.7/config`` endpoint. The Go library + uses ``GET`` requests and the Datadog Agent supports multiple HTTP methods. diff --git a/tests/test_remoteconfig.py b/tests/test_remoteconfig.py index bc3522a9..27b43e89 100644 --- a/tests/test_remoteconfig.py +++ b/tests/test_remoteconfig.py @@ -28,14 +28,17 @@ async def _request_update_and_get_data_with_session(rc_agent, token, data, expec assert json.loads(content) == expected -async def test_remoteconfig( - rc_agent, -): +async def test_remoteconfig(rc_agent): resp = await rc_agent.post("/v0.7/config") content = await resp.text() assert resp.status == 200 assert content == "{}" + resp = await rc_agent.get("/v0.7/config") + content = await resp.text() + assert resp.status == 200 + assert content == "{}" + async def test_remoteconfig_create_payload( rc_agent,