cockroachdb-cloud-client-2022.9.20
توضیحات
A client library for accessing CockroachDB Cloud API
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | cockroachdb-cloud-client-2022.9.20 |
| نام | cockroachdb-cloud-client |
| نسخه کتابخانه | 2022.9.20 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Fabio Ghirardello |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://www.cockroachlabs.com/docs/api/cloud/v1.html#get-/api/v1/clusters |
| آدرس اینترنتی | https://pypi.org/project/cockroachdb-cloud-client/ |
| مجوز | GPL-3.0-or-later |
# cockroachdb-cloud-client
A client library for accessing the CockroachDB Cloud API.
Read the [CockroachDB Cloud OpenAPI Spec](https://www.cockroachlabs.com/docs/api/cloud/v1.html) on our docs page.
## Usage
First, create a client, then, call your endpoint and use your models:
```python
from cockroachdb_cloud_client import AuthenticatedClient
from cockroachdb_cloud_client.models import ListClustersResponse
from cockroachdb_cloud_client.api.cockroach_cloud import cockroach_cloud_list_clusters
from cockroachdb_cloud_client.types import Response
import os
cc_key = os.environ['CC_KEY']
client = AuthenticatedClient(
base_url="https://cockroachlabs.cloud",
token=cc_key,
headers={"cc-version": "2022-09-20"},
)
resp: Response[ListClustersResponse] = cockroach_cloud_list_clusters.sync_detailed(client=client)
for x in resp.parsed.clusters:
print(x.name)
# Output:
# cute-otter
# gummy-rabbit
# half-weasel
# itchy-donkey
# redear-thrush
```
### Things to know
1. Every path/method combo becomes a Python module with four functions:
1. `sync`: Blocking request that returns parsed data (if successful) or `None`
2. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
3. `asyncio`: Like `sync` but async instead of blocking
4. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking
2. All path/query params, and bodies become method arguments.
3. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
4. Any endpoint which did not have a tag will be in `cockroachdb_cloud_client.api.default`
نیازمندی
| مقدار | نام |
|---|---|
| >=0.15.4,<0.24.0 | httpx |
| >=21.3.0 | attrs |
| >=2.8.0,<3.0.0 | python-dateutil |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl cockroachdb-cloud-client-2022.9.20:
pip install cockroachdb-cloud-client-2022.9.20.whl
نصب پکیج tar.gz cockroachdb-cloud-client-2022.9.20:
pip install cockroachdb-cloud-client-2022.9.20.tar.gz