Page 1 of 1

Documentation about [FORMAT] ?

Posted: Wed Jul 11, 2018 2:39 pm
by Spheerys
Hi,

I wonder what the [FORMAT] option on CLI is it for and how to use it.
Where is the doc about this ?

Example :

Code: Select all

Usage: v-list-mail-accounts USER DOMAIN [FORMAT]

Re: Documentation about [FORMAT] ?

Posted: Sun Jul 15, 2018 8:31 pm
by skamasle
Format maybe PLAIN or JSON and not remember if there are third option, but is just for do a format in the output text, you can use plan for cli, but vesta use JSON from php

Re: Documentation about [FORMAT] ?

Posted: Mon Jul 16, 2018 8:57 pm
by Spheerys
Can you please give an example of valid json format ?

Re: Documentation about [FORMAT] ?

Posted: Wed Aug 29, 2018 4:25 pm
by skamasle
Spheerys wrote:
Mon Jul 16, 2018 8:57 pm
Can you please give an example of valid json format ?

Code: Select all

# /usr/local/vesta/bin/v-list-web-domains admin json
{
    "tests.home": {
        "IP": "200.31.13.63",
        "IP6": "",
        "U_DISK": "0",
        "U_BANDWIDTH": "0",
        "TPL": "default",
        "ALIAS": "www.tests.home",
        "STATS": "",
        "STATS_USER": "",
        "SSL": "no",
        "SSL_HOME": "same",
        "LETSENCRYPT": "no",
        "FTP_USER": "",
        "FTP_PATH": "",
        "AUTH_USER": "",
        "BACKEND": "",
        "PROXY": "default",
        "PROXY_EXT": "jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,html,htm",
        "SUSPENDED": "no",
        "TIME": "09:19:27",
        "DATE": "2018-08-29"
    }
}

Re: Documentation about [FORMAT] ?

Posted: Fri Aug 09, 2019 10:35 am
by Emma32
skamasle wrote:
Wed Aug 29, 2018 4:25 pm
Spheerys wrote:
Mon Jul 16, 2018 8:57 pm
Can you please give an example of valid json format ?

Code: Select all

# /usr/local/vesta/bin/v-list-web-domains admin json
{
    "tests.home": {
        "IP": "200.31.13.63",
        "IP6": "",
        "U_DISK": "0",
        "U_BANDWIDTH": "0",
        "TPL": "default",
        "ALIAS": "www.tests.home",
        "STATS": "",
        "STATS_USER": "",
        "SSL": "no",
        "SSL_HOME": "same",
        "LETSENCRYPT": "no",
        "FTP_USER": "",
        "FTP_PATH": "",
        "AUTH_USER": "",
        "BACKEND": "",
        "PROXY": "default",
        "PROXY_EXT": "jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,html,htm",
        "SUSPENDED": "no",
        "TIME": "09:19:27",
        "DATE": "2018-08-29"
    }
}

Re: Documentation about [FORMAT] ?

Posted: Sat Sep 28, 2019 9:33 am
by fedekrum
There are 3 kind of outputs for the listings:
  • shell (default)
  • plain
  • json
If you don't specify any parameter or specify 'shell':

Code: Select all

v-list-mail-accounts user domain.com

ACCOUNT  ALIAS  FWD  DISK  DATE
-------  -----  ---  ----  ----
info     no     no   0     2019-09-28
sales    no     no   0     2019-09-28
news     no     no   0     2019-09-28
with "plain" parameter:

Code: Select all

v-list-mail-accounts user domain.com plain

info				no	unlimited	0	no	06:21:14	2019-09-28
sales				no	unlimited	0	no	06:21:35	2019-09-28
news				no	unlimited	0	no	06:22:06	2019-09-28
with "json" parameter:

Code: Select all

v-list-mail-accounts user domain.com json

{
    "info": {
        "ALIAS": "",
        "FWD": "",
        "FWD_ONLY": "",
        "AUTOREPLY": "no",
        "QUOTA": "unlimited",
        "U_DISK": "0",
        "SUSPENDED": "no",
        "TIME": "06:21:14",
        "DATE": "2019-09-28"
    },
    "sales": {
        "ALIAS": "",
        "FWD": "",
        "FWD_ONLY": "",
        "AUTOREPLY": "no",
        "QUOTA": "unlimited",
        "U_DISK": "0",
        "SUSPENDED": "no",
        "TIME": "06:21:35",
        "DATE": "2019-09-28"
    },
    "news": {
        "ALIAS": "",
        "FWD": "",
        "FWD_ONLY": "",
        "AUTOREPLY": "no",
        "QUOTA": "unlimited",
        "U_DISK": "0",
        "SUSPENDED": "no",
        "TIME": "06:22:06",
        "DATE": "2019-09-28"
    }
}
Hope it helps !