Add simple filter example
This commit is contained in:
20
examples/threefold/tfgrid3deployer/filter.vsh
Executable file
20
examples/threefold/tfgrid3deployer/filter.vsh
Executable 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)
|
||||
Reference in New Issue
Block a user