[#3] Added generate proto script
Signed-off-by: Ilyas Niyazov <i.niyazov@yadro.com>
This commit is contained in:
parent
19282f13cc
commit
9a1b5d778b
5 changed files with 92 additions and 0 deletions
23
frostfs_api/client/frostfs_client.py
Normal file
23
frostfs_api/client/frostfs_client.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# 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()
|
Loading…
Add table
Add a link
Reference in a new issue