@@ -73,6 +73,31 @@ grafana.organization.create_organization(
7373 organization = {" name" : " new_organization" })
7474```
7575
76+ Or using asynchronous code... the interfaces are identical except for the fact that you will handle coroutines (async/await).
77+
78+ ``` python
79+ from grafana_client import AsyncGrafanaApi
80+ import asyncio
81+
82+ async def main ():
83+ # Connect to Grafana API endpoint using the `GrafanaApi` class
84+ grafana
= AsyncGrafanaApi.from_url(
" https://username:[email protected] /grafana/" )
85+
86+ # Create user
87+ user = await grafana.admin.create_user({
88+ " name" : " User" ,
89+ 90+ " login" : " user" ,
91+ " password" : " userpassword" ,
92+ " OrgId" : 1 ,
93+ })
94+
95+ # Change user password
96+ user = await grafana.admin.change_user_password(2 , " newpassword" )
97+
98+ asyncio.run(main())
99+ ```
100+
76101### Example programs
77102
78103There are complete example programs to get you started within the [ examples
@@ -133,7 +158,7 @@ grafana = GrafanaApi.from_env()
133158```
134159
135160Please note that, on top of the specific examples above, the object obtained by
136- ` credential ` can be an arbitrary ` requests .auth.AuthBase` instance.
161+ ` credential ` can be an arbitrary ` niquests .auth.AuthBase` instance.
137162
138163## Selecting Organizations
139164
@@ -166,14 +191,24 @@ scalar `float` value, or as a tuple of `(<read timeout>, <connect timeout>)`.
166191
167192## Proxy
168193
169- The underlying ` requests ` library honors the ` HTTP_PROXY ` and ` HTTPS_PROXY `
194+ The underlying ` niquests ` library honors the ` HTTP_PROXY ` and ` HTTPS_PROXY `
170195environment variables. Setting them before invoking an application using
171196` grafana-client ` has been confirmed to work. For example:
172197```
173198export HTTP_PROXY=10.10.1.10:3128
174199export HTTPS_PROXY=10.10.1.11:1080
175200```
176201
202+ ## DNS Resolver
203+
204+ ` niquests ` support using a custom DNS resolver, like but not limited, DNS-over-HTTPS, and DNS-over-QUIC.
205+ You will have to set ` NIQUESTS_DNS_URL ` environment variable. For example:
206+ ```
207+ export NIQUESTS_DNS_URL="doh+cloudflare://"
208+ ```
209+
210+ See the [ documentation] ( https://niquests.readthedocs.io/en/latest/user/quickstart.html#set-dns-via-environment ) to learn
211+ more about accepted URL parameters and protocols.
177212
178213## Details
179214
0 commit comments