-
Notifications
You must be signed in to change notification settings - Fork 12
How SubutaiTray works? [For Testers]
Alex O. Karasulu edited this page Mar 10, 2018
·
3 revisions
Every 20 seconds, tray gets the information about current user via REST API from bazaar.subutai.io. Following REST endpoints are used by SubutaiTray:
- To get info about
Environments
- https://bazaar.subutai.io/rest/v1/tray/environments - To get info about
Peers
- https://bazaar.subutai.io/rest/v1/tray/my-peers
Every 15 seconds, tray checks if environments of a user is connected to swarm
, if it is connected, then it checks the status of each Peer.
Following commands are used to check status:
- To check if the environment is connected to
swarm
:-
p2p show
gives the list of swarms - if the list contains the environment, then it is connected to swarm
-
- To check the status of Containers in Environment:
p2p show -hash some_hash -check resource_host_ip
Tray uses sockets to connect to the container by Resource Host IP and Port. If it can connect, then it makes the button for SSHing active. Same with EZ-Desktop
, if tray can connect to host via sockets, then it makes button active.
Every 1 minutes, tray uses SSDP to find Resource hosts in a local network.
And it uses libssh2 to check if provided credentials for a Peer are correct/