Add simple filter example

This commit is contained in:
Scott Yeager
2025-03-14 19:19:02 -07:00
parent 413b805823
commit dfcaeec85f

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env -S v -gc none -cc tcc -d use_openssl -enable-globals -cg run
import freeflowuniverse.herolib.threefold.grid3.deployer
const gigabyte = u64(1024 * 1024 * 1024)
// We can use any of the parameters for the corresponding Grid Proxy query
// https://gridproxy.grid.tf/swagger/index.html#/GridProxy/get_nodes
filter := deployer.FilterNodesArgs{
size: 5
randomize: true
free_mru: 8 * gigabyte
free_sru: 50 * gigabyte
farm_name: 'FreeFarm'
status: 'up'
}
nodes := deployer.filter_nodes(filter)!
println(nodes)