You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhanced the README with better structure, installation instructions,
PyPI/Python version badges, proper Rootly API URLs, clearer sections
for quick start, development, and publishing workflows, and added
license and support information.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
A Python client library for accessing the [Rootly API v1](https://rootly.com/). This SDK provides both synchronous and asynchronous interfaces for interacting with Rootly's incident management platform.
By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle.
66
+
## Advanced Configuration
67
+
68
+
### SSL Certificate Verification
69
+
70
+
By default, the client verifies SSL certificates. For internal APIs with custom certificates:
47
71
48
72
```python
49
73
client = AuthenticatedClient(
50
-
base_url="https://internal_api.example.com",
51
-
token="SuperSecretToken",
74
+
base_url="https://internal-api.example.com",
75
+
token="your-api-token",
52
76
verify_ssl="/path/to/certificate_bundle.pem",
53
77
)
54
78
```
55
79
56
-
You can also disable certificate validation altogether, but beware that **this is a security risk**.
80
+
**Warning:** Disabling SSL verification is a security risk and should only be used in development:
57
81
58
82
```python
59
83
client = AuthenticatedClient(
60
-
base_url="https://internal_api.example.com",
61
-
token="SuperSecretToken",
84
+
base_url="https://internal-api.example.com",
85
+
token="your-api-token",
62
86
verify_ssl=False
63
87
)
64
88
```
65
89
66
-
Things to know:
67
-
1. Every path/method combo becomes a Python module with four functions:
68
-
1.`sync`: Blocking request that returns parsed data (if successful) or `None`
69
-
1.`sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
70
-
1.`asyncio`: Like `sync` but async instead of blocking
71
-
1.`asyncio_detailed`: Like `sync_detailed` but async instead of blocking
72
-
73
-
1. All path/query params, and bodies become method arguments.
74
-
1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
75
-
1. Any endpoint which did not have a tag will be in `rootly_sdk.api.default`
90
+
### Custom HTTP Client Configuration
76
91
77
-
## Advanced customizations
78
-
79
-
There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case):
92
+
You can customize the underlying `httpx.Client` with event hooks and other options:
80
93
81
94
```python
82
95
from rootly_sdk import Client
83
96
84
97
deflog_request(request):
85
-
print(f"Request event hook: {request.method}{request.url} - Waiting for response")
98
+
print(f"Request: {request.method}{request.url}")
86
99
87
100
deflog_response(response):
88
-
request = response.request
89
-
print(f"Response event hook: {request.method}{request.url} - Status {response.status_code}")
101
+
print(f"Response: {response.request.method}{response.request.url} - Status {response.status_code}")
0 commit comments