Skip to content
TQL 2.61 KiB
Newer Older
Seblu's avatar
Seblu committed
==================
Tag Query Language
==================
== by examples ==
# list accounts
Seblu's avatar
Seblu committed
sluttrin> list a
Seblu's avatar
Seblu committed

# list hypervisor
Seblu's avatar
Seblu committed
sluttrin> list hv
Seblu's avatar
Seblu committed

# list vm
Seblu's avatar
Seblu committed
sluttrin> list vm
Seblu's avatar
Seblu committed

# list vm of hypervisor toto
Seblu's avatar
Seblu committed
sluttrin> list hv=toto&vm
Seblu's avatar
Seblu committed

# list vm chiche of hypervisor toto
Seblu's avatar
Seblu committed
sluttrin> list hv=toto&vm=chiche
Seblu's avatar
Seblu committed

#list vm with 2 cpu
Seblu's avatar
Seblu committed
sluttrin> list vm&cpu=2
Seblu's avatar
Seblu committed

#list vm with 2 cpu and mem > 10g
Seblu's avatar
Seblu committed
sluttrin> list vm&cpu=2&mem>10g
Seblu's avatar
Seblu committed

#list hypervistor with 2cpu and vm with 2cpu
Seblu's avatar
Seblu committed
sluttrin> list hv&cpu=2&vm&cpu=2
Seblu's avatar
Seblu committed

#list hypervistor at least 2cpu and show tags pop and alloc
Seblu's avatar
Seblu committed
sluttrin> list hv&cpu>=2$pop$alloc

#list first 10 vm
sluttrin> list vm^10

#list last 10 vm
sluttrin> list vm^:10

Seblu's avatar
Seblu committed
sluttrin> list vm^5:10

#list vm sorted by vm
sluttrin> list vm%vm

#list vm sorted by vm and cpu
sluttrin> list vm%vm%cpu
Seblu's avatar
Seblu committed

== Basics ==
- TQL build a list of objects from left to right
- Every tag can add or remove objects
- Separators create link between tag
- Operators apply only on one tag

== separators of tags ==
& and between tags
$ show a tag
Seblu's avatar
Seblu committed
^ limit output
% limit output
Seblu's avatar
Seblu committed

== operators on tags ==
= strict equality
!= not strict equlity
: globing matching
!:not globing matching
~ regex matching
!~ not regex matching
> superior strict
>= superior
< inferior
<= inferior strict

== number facility ==
10k = 1000
10ki = 1024
1m = 1000 ^ 2
1mi = 1024 ^ 2
1g = 1000 ^ 3
1gi = 1024 ^ 3

== well known tags ==
a: account name (eg: bobby)
role: account role (eg: hypersivor/host/cli/vm)
id: a[.vm] (eg: hkvm-itx1-3.slfw-b)
con: connection uptime or offline (eg: 3600/offline)
Seblu's avatar
Seblu committed
ip: ip of peer
Seblu's avatar
Seblu committed
hv: hypervisor name (eg: kvm-chausette)
vm: virtual machine name (eg: access)
h: hostname (eg: access)
hvtype: hypervistor type (xen/kvm)
libvirtver: Libvirt version
status: Vm status (eg: running/paused/stopped)
pop: Point of Presence
cpu: cpu count
mem: memory size
memused: memory used
memfree: memory free
arch: (x86/x64)
uname: uname of host
uptime: uptime of hostname
load: load average
hvm: hardware virtualisation enabled
alloc: host is allowed to be selected to a migration
nvm: vm count on an hypervisor
version: account version
sto: storage pool names (eg: vg fg)
stovg_type: vg storage pool type (eg: lvm)
stovg_size: vg storage pool size (eg: 1042)
stovg_used: vg storage pool used space (eg: 1)
stovg_free: vg storage pool free space (eg: 1041)
stovg_path: vg storage pool path (eg: /dev/vg/)
stovg_vol: vg storage pool volume list (eg: sex titi toto)
disk: disk index list (eg: 1 2 3 4)
disk1_path: disk 1 path (eg: /dev/vg/sex)
disk1_size: disk 1 size (eg: 1024)
disk1_pool: storage pool back reference (eg: vg) [vmonly]
disk1_voln: storage pool volume back reference (eg: ) [vmonly]