frostfs-sdk-python/frostfs_api/client/frostfs_client.py
Ilyas Niyazov 9a1b5d778b [#3] Added generate proto script
Signed-off-by: Ilyas Niyazov <i.niyazov@yadro.com>
2025-02-26 16:24:04 +03:00

23 lines
651 B
Python

# Create channel and Stubs
import grpc
from frostfs_api.client.services.container import ContainerClient
class FrostfsClient:
def __init__(self, address):
self.channel = grpc.insecure_channel(address)
self.container = ContainerClient(self.channel)
def close(self):
self.channel.close()
if __name__ == "__main__":
client = FrostfsClient("localhost:50051")
create_response = client.container.create_container("my_container")
print("Container created:", create_response)
get_response = client.container.get_container(create_response)
print("Container details:", get_response)
client.close()