mirror of
https://github.com/andrewthetechie/py-healthchecks.io.git
synced 2025-12-05 17:18:16 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
818dd54f2f | ||
|
|
376578ac36 | ||
|
|
67cbd2963f | ||
|
|
960d78bc10 | ||
|
|
17c612c29f | ||
|
|
79ae404e63 |
@@ -98,7 +98,7 @@ class AsyncClient(AbstractClient):
|
||||
"""
|
||||
request_url = self._get_api_request_url("checks/")
|
||||
response = self.check_response(
|
||||
await self._client.post(request_url, json=new_check.dict())
|
||||
await self._client.post(request_url, json=new_check.dict(exclude_none=True))
|
||||
)
|
||||
return Check.from_api_result(response.json())
|
||||
|
||||
@@ -118,7 +118,8 @@ class AsyncClient(AbstractClient):
|
||||
request_url = self._get_api_request_url(f"checks/{uuid}")
|
||||
response = self.check_response(
|
||||
await self._client.post(
|
||||
request_url, json=update_check.dict(exclude_unset=True)
|
||||
request_url,
|
||||
json=update_check.dict(exclude_unset=True, exclude_none=True),
|
||||
)
|
||||
)
|
||||
return Check.from_api_result(response.json())
|
||||
|
||||
@@ -138,7 +138,7 @@ class Client(AbstractClient):
|
||||
"""
|
||||
request_url = self._get_api_request_url("checks/")
|
||||
response = self.check_response(
|
||||
self._client.post(request_url, json=new_check.dict())
|
||||
self._client.post(request_url, json=new_check.dict(exclude_none=True))
|
||||
)
|
||||
return Check.from_api_result(response.json())
|
||||
|
||||
@@ -163,7 +163,10 @@ class Client(AbstractClient):
|
||||
"""
|
||||
request_url = self._get_api_request_url(f"checks/{uuid}")
|
||||
response = self.check_response(
|
||||
self._client.post(request_url, json=update_check.dict(exclude_unset=True))
|
||||
self._client.post(
|
||||
request_url,
|
||||
json=update_check.dict(exclude_unset=True, exclude_none=True),
|
||||
)
|
||||
)
|
||||
return Check.from_api_result(response.json())
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class Check(BaseModel):
|
||||
update_url: Optional[str]
|
||||
pause_url: Optional[str]
|
||||
channels: Optional[str]
|
||||
timeout: int
|
||||
timeout: Optional[int]
|
||||
uuid: Optional[str]
|
||||
|
||||
@validator("uuid", always=True)
|
||||
@@ -83,7 +83,7 @@ class CheckCreate(BaseModel):
|
||||
lte=31536000,
|
||||
)
|
||||
schedule: Optional[str] = Field(
|
||||
"* * * * *",
|
||||
None,
|
||||
description="A cron expression defining this check's schedule. "
|
||||
"If you specify both timeout and schedule parameters, "
|
||||
"Healthchecks.io will create a Cron check and ignore the "
|
||||
|
||||
Reference in New Issue
Block a user