Skip to content

Commit

Permalink
Add a method to get outbound configs filtering by query params
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariano M committed Feb 6, 2023
1 parent 467f352 commit 9776be4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,7 @@ dmypy.json

# Pyre type checker
.pyre/

# Pycharm
.idea/

10 changes: 9 additions & 1 deletion gundi_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,12 @@ async def update_states_with_dict(
logger.info(f"update device_states resp: {response.status}")
return text

async def _get(self, session: ClientSession, url: str):
async def _get(self, session: ClientSession, url: str, params=None):
headers = await self.get_auth_header(session)
response = await session.get(
url=url,
headers=headers,
params=params,
ssl=settings.CDIP_ADMIN_SSL_VERIFY,
)
response.raise_for_status()
Expand All @@ -232,3 +233,10 @@ async def get_outbound_integration(self, session: ClientSession, integration_id:
session=session,
url=f"{settings.PORTAL_API_ENDPOINT}/integrations/outbound/configurations/{integration_id}",
)

async def get_outbound_integration_list(self, session: ClientSession, **query_params):
return await self._get(
session=session,
url=f"{settings.PORTAL_API_ENDPOINT}/integrations/outbound/configurations",
params=query_params
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gundi-client"
version = "0.1.0"
version = "0.2.1"
description = "An async client for Gundi's API"
authors = [
"Rohit Chaudhri <rohitc@vulcan.com>",
Expand Down

0 comments on commit 9776be4

Please sign in to comment.