Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stereobutter/talos-linux-api
Python bindings for the Talos Linux gRPC API
https://github.com/stereobutter/talos-linux-api
asyncio betterproto grpc protobuf python talos
Last synced: about 2 months ago
JSON representation
Python bindings for the Talos Linux gRPC API
- Host: GitHub
- URL: https://github.com/stereobutter/talos-linux-api
- Owner: stereobutter
- License: mit
- Created: 2023-02-26T23:54:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-31T08:35:55.000Z (11 months ago)
- Last Synced: 2024-10-18T09:21:10.760Z (2 months ago)
- Topics: asyncio, betterproto, grpc, protobuf, python, talos
- Language: Python
- Homepage:
- Size: 216 KB
- Stars: 19
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `talos-linux-api` - Python bindings for the Talos Linux gRPC API
## Installation
Multiple API versions can be installed simultaneously and are made available
at runtime under an *Implicit Namespace Package* named `talos_linux_api`.Currently available API versions:
* `pip install talos-linux-api-v1.2.0`
* `pip install talos-linux-api-v1.3.0`
* `pip install talos-linux-api-v1.4.0`
* `pip install talos-linux-api-v1.5.0`
* `pip install talos-linux-api-v1.6.0`## Usage example
```python
import ssl
from talos_linux_api.v1_6_0.machine import MachineServiceStub
from grpclib.client import Channel
from betterproto.lib.google.protobuf import Emptyssl_context = ssl.create_default_context()
ssl_context.load_cert_chain('client.crt', 'client.key')
ssl_context.load_verify_locations('ca.crt')async with Channel(host="example.com", port=50000, ssl=ssl_context) as channel:
machine_service = MachineServiceStub(channel)
response = await machine_service.cpu_info(Empty())
```> [!NOTE]
> `openssl` which the `ssl` module relies upon does not like the format of the
> private key that `talosctl` generates.
> ```
> -----BEGIN ED25519 PRIVATE KEY-----
> ...
> -----END ED25519 PRIVATE KEY-----
> ```
> To make `openssl` happy you have to fix the header and footer by removing the
> `ED25519` part.
> ```
> -----BEGIN PRIVATE KEY-----
> ...
> -----END PRIVATE KEY-----
> ```