Explorer

The explorer is the component that is responsible to host all the public information about the nodes running 0-OS, the farms, the users identity and the capacity reservations.

The explorer exposes both a web UI and a REST API.

  • The web UI allows users to discover all the nodes and farms in the grid.
  • The API is used by nodes and users.

Explorer Client

  • Get explorer client
explorer = j.clients.explorer.get("explore_client","http://explorer.grid.tf/explorer")

Users

  • List all users in explorer
explorer.users.list(name="3BOT_NAME", email="3BOT_EMAIL")
  • Get specific user
explorer.users.get(tid="USER_TID", name="3BOT_NAME", email="3BOT_EMAIL")
  • Create new user
user = explorer.users.new()
user.email="3BOT_EMAIL"
user.name = "3BOT_NAME"
  • Register user in explorer
explorer.users.register(user)

Farms

  • List all farms in explorer
explorer.farms.list()
  • get specific farm
explorer.farms.get(farm_id="ID", farm_name="NAME")
  • Create new farm
from jumpscale.clients.explorer.models import TfgridDirectoryWallet_address1
farm = explorer.farms.new()
farm.name = "FARM_NAME"
farm.email = "FARM_EMAIL"
wallet = TfgridDirectoryWallet_address1()
wallet.address= "WALLET_ADREESS"
wallet.save()
farm.wallet_addresses = [wallet]
  • Register new farm
explorer.farms.register(farm)

Nodes

  • List all nodes in explorer
explorer.nodes.list()
  • List all nodes with the possibility of filtering them based on resources specified
explorer.nodes.list(country="COUNTRY",city="CITY",cru="CPU",sru="SSD_SIZE",mru="MEMORY_SIZE",hru="HDD_SIZE")
  • Get Specific node
explorer.nodes.get(node_id="NODE_ID")
  • Check if node free to use or not
explorer.nodes.configure_free_to_use(node_id="NODE_ID",free=True)

Reservations

  • List all reserations of specific 3bot user with the possibility of filtering
explorer.reservations.list(customer_tid="TID", next_action="NEXT_ACTION_OF_RESERVATION", page="NUMBER_OF_PAGE")
  • Create new reservation
res = explorer.reservations.new()
res.customre_tid = "CUSTOMER_TID"
res.data_reservation = YOUR_DATA_RESERVATION
res.json = "RESERVATION_JSON"
  • Get reservation
explorer.reservations.get(reservation_id="ID")
  • Delete reservation
explorer.reservations.sign_delete(reservation_id="ID",tid="CUSTOMER_TID",signature="3BOT_signature")