Uniformize API routes

This commit is contained in:
Alexandre Aubin 2021-03-19 16:15:16 +01:00
parent f0827451ca
commit 82d5be6802

View file

@ -482,7 +482,7 @@ domain:
- maindomain - maindomain
api: api:
- GET /domains/main - GET /domains/main
- PUT /domains/main - PUT /domains/<new_main_domain>/main
arguments: arguments:
-n: -n:
full: --new-main-domain full: --new-main-domain
@ -493,7 +493,7 @@ domain:
### certificate_status() ### certificate_status()
cert-status: cert-status:
action_help: List status of current certificates (all by default). action_help: List status of current certificates (all by default).
api: GET /domains/cert-status/<domain_list> api: GET /domains/<domain_list>/cert
arguments: arguments:
domain_list: domain_list:
help: Domains to check help: Domains to check
@ -505,7 +505,7 @@ domain:
### certificate_install() ### certificate_install()
cert-install: cert-install:
action_help: Install Let's Encrypt certificates for given domains (all by default). action_help: Install Let's Encrypt certificates for given domains (all by default).
api: POST /domains/cert-install/<domain_list> api: POST /domains/<domain_list>/cert
arguments: arguments:
domain_list: domain_list:
help: Domains for which to install the certificates help: Domains for which to install the certificates
@ -526,7 +526,7 @@ domain:
### certificate_renew() ### certificate_renew()
cert-renew: cert-renew:
action_help: Renew the Let's Encrypt certificates for given domains (all by default). action_help: Renew the Let's Encrypt certificates for given domains (all by default).
api: POST /domains/cert-renew/<domain_list> api: PUT /domains/<domain_list>/cert/renew
arguments: arguments:
domain_list: domain_list:
help: Domains for which to renew the certificates help: Domains for which to renew the certificates
@ -547,7 +547,7 @@ domain:
### domain_url_available() ### domain_url_available()
url-available: url-available:
action_help: Check availability of a web path action_help: Check availability of a web path
api: GET /domain/urlavailable api: GET /domain/<domain>/urlavailable
arguments: arguments:
domain: domain:
help: The domain for the web path (e.g. your.domain.tld) help: The domain for the web path (e.g. your.domain.tld)
@ -556,20 +556,6 @@ domain:
path: path:
help: The path to check (e.g. /coffee) help: The path to check (e.g. /coffee)
### domain_info()
# info:
# action_help: Get domain informations
# api: GET /domains/<domain>
# arguments:
# domain:
# help: ""
# extra:
# pattern:
# - '^([a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)(\.[a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)*(\.[a-zA-Z]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)$'
# - "Must be a valid domain name (e.g. my-domain.org)"
############################# #############################
# App # # App #
############################# #############################
@ -631,7 +617,7 @@ app:
### app_map() ### app_map()
map: map:
action_help: Show the mapping between urls and apps action_help: Show the mapping between urls and apps
api: GET /appsmap api: GET /apps/map
arguments: arguments:
-a: -a:
full: --app full: --app
@ -679,7 +665,7 @@ app:
### app_upgrade() ### app_upgrade()
upgrade: upgrade:
action_help: Upgrade app action_help: Upgrade app
api: PUT /upgrade/apps api: PUT /apps/<app>/upgrade
arguments: arguments:
app: app:
help: App(s) to upgrade (default all) help: App(s) to upgrade (default all)
@ -737,7 +723,6 @@ app:
### app_register_url() ### app_register_url()
register-url: register-url:
action_help: Book/register a web path for a given app action_help: Book/register a web path for a given app
api: PUT /tools/registerurl
arguments: arguments:
app: app:
help: App which will use the web path help: App which will use the web path
@ -761,7 +746,6 @@ app:
### app_ssowatconf() ### app_ssowatconf()
ssowatconf: ssowatconf:
action_help: Regenerate SSOwat configuration file action_help: Regenerate SSOwat configuration file
api: PUT /ssowatconf
### app_change_label() ### app_change_label()
change-label: change-label:
@ -776,7 +760,6 @@ app:
### app_addaccess() TODO: Write help ### app_addaccess() TODO: Write help
addaccess: addaccess:
action_help: Grant access right to users (everyone by default) action_help: Grant access right to users (everyone by default)
api: PUT /access
deprecated: true deprecated: true
arguments: arguments:
apps: apps:
@ -788,7 +771,6 @@ app:
### app_removeaccess() TODO: Write help ### app_removeaccess() TODO: Write help
removeaccess: removeaccess:
action_help: Revoke access right to users (everyone by default) action_help: Revoke access right to users (everyone by default)
api: DELETE /access
deprecated: true deprecated: true
arguments: arguments:
apps: apps:
@ -800,7 +782,6 @@ app:
### app_clearaccess() ### app_clearaccess()
clearaccess: clearaccess:
action_help: Reset access rights for the app action_help: Reset access rights for the app
api: POST /access
deprecated: true deprecated: true
arguments: arguments:
apps: apps:
@ -866,7 +847,7 @@ backup:
### backup_create() ### backup_create()
create: create:
action_help: Create a backup local archive. If neither --apps or --system are given, this will backup all apps and all system parts. If only --apps if given, this will only backup apps and no system parts. Similarly, if only --system is given, this will only backup system parts and no apps. action_help: Create a backup local archive. If neither --apps or --system are given, this will backup all apps and all system parts. If only --apps if given, this will only backup apps and no system parts. Similarly, if only --system is given, this will only backup system parts and no apps.
api: POST /backup api: POST /backups
arguments: arguments:
-n: -n:
full: --name full: --name
@ -894,7 +875,7 @@ backup:
### backup_restore() ### backup_restore()
restore: restore:
action_help: Restore from a local backup archive. If neither --apps or --system are given, this will restore all apps and all system parts in the archive. If only --apps if given, this will only restore apps and no system parts. Similarly, if only --system is given, this will only restore system parts and no apps. action_help: Restore from a local backup archive. If neither --apps or --system are given, this will restore all apps and all system parts in the archive. If only --apps if given, this will only restore apps and no system parts. Similarly, if only --system is given, this will only restore system parts and no apps.
api: POST /backup/restore/<name> api: PUT /backups/<name>/restore
arguments: arguments:
name: name:
help: Name of the local backup archive help: Name of the local backup archive
@ -911,7 +892,7 @@ backup:
### backup_list() ### backup_list()
list: list:
action_help: List available local backup archives action_help: List available local backup archives
api: GET /backup/archives api: GET /backups
arguments: arguments:
-i: -i:
full: --with-info full: --with-info
@ -925,7 +906,7 @@ backup:
### backup_info() ### backup_info()
info: info:
action_help: Show info about a local backup archive action_help: Show info about a local backup archive
api: GET /backup/archives/<name> api: GET /backups/<name>
arguments: arguments:
name: name:
help: Name of the local backup archive help: Name of the local backup archive
@ -941,7 +922,7 @@ backup:
### backup_download() ### backup_download()
download: download:
action_help: (API only) Request to download the file action_help: (API only) Request to download the file
api: GET /backup/download/<name> api: GET /backups/<name>/download
arguments: arguments:
name: name:
help: Name of the local backup archive help: Name of the local backup archive
@ -949,7 +930,7 @@ backup:
### backup_delete() ### backup_delete()
delete: delete:
action_help: Delete a backup archive action_help: Delete a backup archive
api: DELETE /backup/archives/<name> api: DELETE /backups/<name>
arguments: arguments:
name: name:
help: Name of the archive to delete help: Name of the archive to delete
@ -1016,7 +997,6 @@ service:
### service_add() ### service_add()
add: add:
action_help: Add a service action_help: Add a service
# api: POST /services
arguments: arguments:
name: name:
help: Service name to add help: Service name to add
@ -1054,7 +1034,6 @@ service:
### service_remove() ### service_remove()
remove: remove:
action_help: Remove a service action_help: Remove a service
# api: DELETE /services
arguments: arguments:
name: name:
help: Service name to remove help: Service name to remove
@ -1062,7 +1041,7 @@ service:
### service_start() ### service_start()
start: start:
action_help: Start one or more services action_help: Start one or more services
api: PUT /services/<names> api: PUT /services/<names>/start
arguments: arguments:
names: names:
help: Service name to start help: Service name to start
@ -1072,7 +1051,7 @@ service:
### service_stop() ### service_stop()
stop: stop:
action_help: Stop one or more services action_help: Stop one or more services
api: DELETE /services/<names> api: PUT /services/<names>/stop
arguments: arguments:
names: names:
help: Service name to stop help: Service name to stop
@ -1120,7 +1099,7 @@ service:
### service_disable() ### service_disable()
disable: disable:
action_help: Disable one or more services action_help: Disable one or more services
api: DELETE /services/<names>/enable api: PUT /services/<names>/disable
arguments: arguments:
names: names:
help: Service name to disable help: Service name to disable
@ -1155,7 +1134,6 @@ service:
### service_regen_conf() ### service_regen_conf()
regen-conf: regen-conf:
action_help: Regenerate the configuration file(s) for a service action_help: Regenerate the configuration file(s) for a service
api: PUT /services/regenconf
deprecated_alias: deprecated_alias:
- regenconf - regenconf
arguments: arguments:
@ -1207,19 +1185,10 @@ firewall:
help: List forwarded ports with UPnP help: List forwarded ports with UPnP
action: store_true action: store_true
### firewall_reload()
reload:
action_help: Reload all firewall rules
api: PUT /firewall
arguments:
--skip-upnp:
help: Do not refresh port forwarding using UPnP
action: store_true
### firewall_allow() ### firewall_allow()
allow: allow:
action_help: Allow connections on a port action_help: Allow connections on a port
api: POST /firewall/port api: POST /firewall/<port>
arguments: arguments:
protocol: protocol:
help: "Protocol type to allow (TCP/UDP/Both)" help: "Protocol type to allow (TCP/UDP/Both)"
@ -1249,11 +1218,10 @@ firewall:
help: Do not reload firewall rules help: Do not reload firewall rules
action: store_true action: store_true
### firewall_disallow() ### firewall_disallow()
disallow: disallow:
action_help: Disallow connections on a port action_help: Disallow connections on a port
api: DELETE /firewall/port api: DELETE /firewall/<port>
arguments: arguments:
protocol: protocol:
help: "Protocol type to allow (TCP/UDP/Both)" help: "Protocol type to allow (TCP/UDP/Both)"
@ -1281,11 +1249,10 @@ firewall:
help: Do not reload firewall rules help: Do not reload firewall rules
action: store_true action: store_true
### firewall_upnp() ### firewall_upnp()
upnp: upnp:
action_help: Manage port forwarding using UPnP action_help: Manage port forwarding using UPnP
api: GET /firewall/upnp api: PUT /firewall/upnp/<action>
arguments: arguments:
action: action:
choices: choices:
@ -1299,10 +1266,19 @@ firewall:
help: Do not refresh port forwarding help: Do not refresh port forwarding
action: store_true action: store_true
### firewall_reload()
reload:
action_help: Reload all firewall rules
arguments:
--skip-upnp:
help: Do not refresh port forwarding using UPnP
action: store_true
### firewall_stop() ### firewall_stop()
stop: stop:
action_help: Stop iptables and ip6tables action_help: Stop iptables and ip6tables
api: DELETE /firewall
@ -1316,7 +1292,6 @@ dyndns:
### dyndns_subscribe() ### dyndns_subscribe()
subscribe: subscribe:
action_help: Subscribe to a DynDNS service action_help: Subscribe to a DynDNS service
api: POST /dyndns
arguments: arguments:
--subscribe-host: --subscribe-host:
help: Dynette HTTP API to subscribe to help: Dynette HTTP API to subscribe to
@ -1333,7 +1308,6 @@ dyndns:
### dyndns_update() ### dyndns_update()
update: update:
action_help: Update IP on DynDNS platform action_help: Update IP on DynDNS platform
api: PUT /dyndns
arguments: arguments:
--dyn-host: --dyn-host:
help: Dynette DNS server to inform help: Dynette DNS server to inform
@ -1489,7 +1463,9 @@ tools:
### tools_regen_conf() ### tools_regen_conf()
regen-conf: regen-conf:
action_help: Regenerate the configuration file(s) action_help: Regenerate the configuration file(s)
api: PUT /tools/regenconf api:
- PUT /regenconf
- PUT /regenconf/<names>
arguments: arguments:
names: names:
help: Categories to regenerate configuration of (all by default) help: Categories to regenerate configuration of (all by default)
@ -1538,7 +1514,7 @@ tools:
### tools_migrations_run() ### tools_migrations_run()
run: run:
action_help: Run migrations action_help: Run migrations
api: POST /migrations/run api: PUT /migrations/<targets>
deprecated_alias: deprecated_alias:
- migrate - migrate
arguments: arguments:
@ -1561,7 +1537,6 @@ tools:
### tools_migrations_state() ### tools_migrations_state()
state: state:
action_help: Show current migrations state action_help: Show current migrations state
api: GET /migrations/state
############################# #############################
@ -1590,7 +1565,6 @@ hook:
### hook_info() ### hook_info()
info: info:
action_help: Get information about a given hook action_help: Get information about a given hook
api: GET /hooks/<action>/<name>
arguments: arguments:
action: action:
help: Action name help: Action name
@ -1600,7 +1574,6 @@ hook:
### hook_list() ### hook_list()
list: list:
action_help: List available hooks for an action action_help: List available hooks for an action
api: GET /hooks/<action>
arguments: arguments:
action: action:
help: Action name help: Action name
@ -1620,7 +1593,6 @@ hook:
### hook_callback() ### hook_callback()
callback: callback:
action_help: Execute all scripts binded to an action action_help: Execute all scripts binded to an action
api: POST /hooks/<action>
arguments: arguments:
action: action:
help: Action name help: Action name
@ -1716,7 +1688,7 @@ log:
### log_share() ### log_share()
share: share:
action_help: Share the full log on yunopaste (alias to show --share) action_help: Share the full log on yunopaste (alias to show --share)
api: GET /logs/share api: GET /logs/<path>/share
arguments: arguments:
path: path:
help: Log file to share help: Log file to share
@ -1731,11 +1703,11 @@ diagnosis:
list: list:
action_help: List diagnosis categories action_help: List diagnosis categories
api: GET /diagnosis/list api: GET /diagnosis/categories
show: show:
action_help: Show most recents diagnosis results action_help: Show most recents diagnosis results
api: GET /diagnosis/show api: GET /diagnosis
arguments: arguments:
categories: categories:
help: Diagnosis categories to display (all by default) help: Diagnosis categories to display (all by default)
@ -1753,9 +1725,20 @@ diagnosis:
help: Show a human-readable output help: Show a human-readable output
action: store_true action: store_true
get:
action_help: Low-level command to fetch raw data and status about a specific diagnosis test
api: GET /diagnosis/<category>
arguments:
category:
help: Diagnosis category to fetch results from
item:
help: "List of criteria describing the test. Must correspond exactly to the 'meta' infos in 'yunohost diagnosis show'"
metavar: CRITERIA
nargs: "*"
run: run:
action_help: Run diagnosis action_help: Run diagnosis
api: POST /diagnosis/run api: PUT /diagnosis/run
arguments: arguments:
categories: categories:
help: Diagnosis categories to run (all by default) help: Diagnosis categories to run (all by default)
@ -1786,13 +1769,3 @@ diagnosis:
help: List active ignore filters help: List active ignore filters
action: store_true action: store_true
get:
action_help: Low-level command to fetch raw data and status about a specific diagnosis test
api: GET /diagnosis/item/<category>
arguments:
category:
help: Diagnosis category to fetch results from
item:
help: "List of criteria describing the test. Must correspond exactly to the 'meta' infos in 'yunohost diagnosis show'"
metavar: CRITERIA
nargs: "*"