Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

Commit

Permalink
Renamed method to be consistent with other clients
Browse files Browse the repository at this point in the history
  • Loading branch information
jsma committed Jul 29, 2020
1 parent 05555c2 commit 8b1d887
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ Creating a search key that will only search over the body field.
### Search the API logs

```python
>>> client.search_api_logs('my-meta-engine', {
>>> client.get_api_logs('my-meta-engine', {
"filters": {
"date": {
"from": "2020-03-30T00:00:00+00:00",
Expand Down
2 changes: 1 addition & 1 deletion elastic_app_search/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def create_signed_search_key(api_key, api_key_name, options):
options['api_key_name'] = api_key_name
return jwt.encode(options, api_key, algorithm=Client.SIGNED_SEARCH_TOKEN_JWT_ALGORITHM)

def search_api_logs(self, engine_name, options=None):
def get_api_logs(self, engine_name, options=None):
"""
Searches the API logs.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def test_delete_meta_engine_sources(self):
self.engine_name, [source_engine_name])
self.assertEqual(response, expected_return)

def test_search_api_logs(self):
def test_get_api_logs(self):
expected_return = {'meta': {}, 'results': []}

with requests_mock.Mocker() as m:
Expand All @@ -562,5 +562,5 @@ def test_search_api_logs(self):
"engines/{}/logs/api".format(self.engine_name)
)
m.register_uri('GET', url, json=expected_return, status_code=200)
response = self.client.search_api_logs(self.engine_name, options={})
response = self.client.get_api_logs(self.engine_name, options={})
self.assertEqual(response, expected_return)

0 comments on commit 8b1d887

Please sign in to comment.