Skip to content

Commit

Permalink
Update library for Yggdrasil version 0.4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoreeq committed Feb 20, 2022
1 parent 6c9b789 commit 80af6e5
Showing 1 changed file with 10 additions and 47 deletions.
57 changes: 10 additions & 47 deletions yctl/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ async def get_DHT(self) -> Dict:
async def get_peers(self) -> Dict:
return await self._request("getPeers")

async def add_peer(self, uri: str) -> Dict:
return await self._request("addPeer", {"uri": uri})

async def remove_peer(self, port: int) -> Dict:
return await self._request("removePeer", {"port": port})

async def disconnect_peer(self, port: int) -> Dict:
return await self._request("disconnectPeer", {"port": port})

async def get_switch_peers(self) -> Dict:
return await self._request("getSwitchPeers")

async def get_self(self) -> Dict:
return await self._request("getSelf")

Expand All @@ -68,46 +56,21 @@ async def get_sessions(self) -> Dict:
async def get_tun_tap(self) -> Dict:
return await self._request("getTunTap")

async def get_allowed_encryption_public_keys(self) -> Dict:
return await self._request("getAllowedEncryptionPublicKeys")

async def add_allowed_encryption_public_key(self, box_pub_key: str) -> Dict:
return await self._request("addAllowedEncryptionPublicKey", {
"box_pub_key": box_pub_key})

async def remove_allowed_encryption_public_key(self, box_pub_key: str) -> Dict:
return await self._request("removeAllowedEncryptionPublicKey", {
"box_pub_key": box_pub_key})

async def get_multicast_interfaces(self) -> Dict:
return await self._request("getMulticastInterfaces")

async def get_routes(self) -> Dict:
return await self._request("getRoutes")

async def add_route(self, subnet: str, box_pub_key: str) -> Dict:
return await self._request("addRoute",
{"subnet": subnet, "box_pub_key": box_pub_key})

async def remove_route(self, subnet: str, box_pub_key: str) -> Dict:
return await self._request("removeRoute",
{"subnet": subnet, "box_pub_key": box_pub_key})

async def get_source_subnets(self) -> Dict:
return await self._request("getSourceSubnets")
async def get_paths(self) -> Dict:
return await self._request("getPaths")

async def add_source_subnet(self, subnet: str) -> Dict:
return await self._request("addSourceSubnet", {"subnet": subnet})
async def get_node_info(self, key: str) -> Dict:
return await self._request("getNodeInfo", {"key": key})

async def remove_source_subnet(self, subnet: str) -> Dict:
return await self._request("removeSourceSubnet", {"subnet": subnet})
async def debug_remote_get_self(self, key: str) -> Dict:
return await self._request("debug_remoteGetSelf", {"key": key})

async def dht_ping(self, box_pub_key: str, coords: str, target: str = "") -> Dict:
args = {"box_pub_key": box_pub_key, "coords": coords}
if target: args["target"] = target
return await self._request("dhtPing", args)
async def debug_remote_get_peers(self, key: str) -> Dict:
return await self._request("debug_remoteGetPeers", {"key": key})

async def get_node_info(self, box_pub_key: str, coords: str) -> Dict:
return await self._request("getNodeInfo",
{"box_pub_key": box_pub_key, "coords": coords})
async def debug_remote_get_dht(self, key: str) -> Dict:
return await self._request("debug_remoteGetDHT", {"key": key})

0 comments on commit 80af6e5

Please sign in to comment.