Agent: Use PUT instead of POST to send agent logs
This commit is contained in:
parent
87d25d2ac8
commit
ff8c8bd0a0
|
@ -93,7 +93,7 @@ class HTTPIslandAPIClient(IIslandAPIClient):
|
|||
|
||||
@handle_island_errors
|
||||
def send_log(self, agent_id: AgentID, log_contents: str):
|
||||
response = requests.post( # noqa: DUO123
|
||||
response = requests.put( # noqa: DUO123
|
||||
f"{self._api_url}/agent-logs/{agent_id}",
|
||||
json=log_contents,
|
||||
verify=False,
|
||||
|
|
|
@ -119,7 +119,7 @@ def test_island_api_client__send_log(island_api_client, actual_error, expected_e
|
|||
island_api_client.connect(SERVER)
|
||||
|
||||
with pytest.raises(expected_error):
|
||||
m.post(ISLAND_SEND_LOG_URI, exc=actual_error)
|
||||
m.put(ISLAND_SEND_LOG_URI, exc=actual_error)
|
||||
island_api_client.send_log(agent_id=AGENT_ID, log_contents="some_data")
|
||||
|
||||
|
||||
|
@ -136,7 +136,7 @@ def test_island_api_client_send_log__status_code(island_api_client, status_code,
|
|||
island_api_client.connect(SERVER)
|
||||
|
||||
with pytest.raises(expected_error):
|
||||
m.post(ISLAND_SEND_LOG_URI, status_code=status_code)
|
||||
m.put(ISLAND_SEND_LOG_URI, status_code=status_code)
|
||||
island_api_client.send_log(agent_id=AGENT_ID, log_contents="some_data")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue