Skip to content

Conversation

@nickvergessen
Copy link
Member

Match a route

  • -v for path and requirements of parameters
  • --method to specify HTTP method
$ occ router:match '/ocs/v2.php/apps/activity/api/v2/activity/{filter}' 
+------------------------------+----------+-----------------+-----------+
| route                        | appid    | controller      | method    |
+------------------------------+----------+-----------------+-----------+
| ocs.activity.apiv2.getfilter | activity | APIv2Controller | getFilter |
+------------------------------+----------+-----------------+-----------+

$ occ router:match '/ocs/v2.php/apps/activity/api/v2/remote/1234567890' -v --method POST
+---------------------------------------------+----------+--------------------------+-----------------+-------------------------------------------------+--------------+
| route                                       | appid    | controller               | method          | path                                            | requirements |
+---------------------------------------------+----------+--------------------------+-----------------+-------------------------------------------------+--------------+
| ocs.activity.remoteactivity.receiveactivity | activity | RemoteActivityController | receiveActivity | /ocs/v2.php/apps/activity/api/v2/remote/{token} | []           |
+---------------------------------------------+----------+--------------------------+-----------------+-------------------------------------------------+--------------+

List all routes (of apps)

  • -v for requirements of parameters
  • --ocs to only list OCS routes
  • --index to only list index.php routes
  • Optional argument list of apps
$ occ router:list notifications -v
+-----------------------------------------------+---------+-------------------------------------------------------------------------------+--------------------------------------+
| route                                         | request | path                                                                          | requirements                         |
+-----------------------------------------------+---------+-------------------------------------------------------------------------------+--------------------------------------+
| notifications.api.generatenotification        | POST    | /ocs/v2.php/apps/notifications/api/{apiVersion}/admin_notifications/{userId}  | {"apiVersion":"(v1|v2)"}             |
| notifications.api.generatenotificationv3      | POST    | /ocs/v2.php/apps/notifications/api/{apiVersion3}/admin_notifications/{userId} | {"apiVersion3":"(v3)"}               |
| notifications.api.selftestpush                | POST    | /ocs/v2.php/apps/notifications/api/{apiVersion3}/test/self                    | {"apiVersion3":"(v3)"}               |
| notifications.endpoint.confirmidsforuser      | POST    | /ocs/v2.php/apps/notifications/api/{apiVersion}/notifications/exists          | {"apiVersion":"(v1|v2)"}             |
| notifications.endpoint.deleteallnotifications | DELETE  | /ocs/v2.php/apps/notifications/api/{apiVersion}/notifications                 | {"apiVersion":"(v1|v2)"}             |
| notifications.endpoint.deletenotification     | DELETE  | /ocs/v2.php/apps/notifications/api/{apiVersion}/notifications/{id}            | {"apiVersion":"(v1|v2)","id":"\\d+"} |
| notifications.endpoint.getnotification        | GET     | /ocs/v2.php/apps/notifications/api/{apiVersion}/notifications/{id}            | {"apiVersion":"(v1|v2)","id":"\\d+"} |
| notifications.endpoint.listnotifications      | GET     | /ocs/v2.php/apps/notifications/api/{apiVersion}/notifications                 | {"apiVersion":"(v1|v2)"}             |
| notifications.push.registerdevice             | POST    | /ocs/v2.php/apps/notifications/api/{apiVersion}/push                          | {"apiVersion":"(v2)"}                |
| notifications.push.removedevice               | DELETE  | /ocs/v2.php/apps/notifications/api/{apiVersion}/push                          | {"apiVersion":"(v2)"}                |
| notifications.settings.admin                  | POST    | /ocs/v2.php/apps/notifications/api/{apiVersion}/settings/admin                | {"apiVersion":"(v2)"}                |
| notifications.settings.personal               | POST    | /ocs/v2.php/apps/notifications/api/{apiVersion}/settings                      | {"apiVersion":"(v2)"}                |
+-----------------------------------------------+---------+-------------------------------------------------------------------------------+--------------------------------------+


$ occ router:list activity
+-----------------------------------------+---------+----------------------------------------------------+
| route                                   | request | path                                               |
+-----------------------------------------+---------+----------------------------------------------------+
| activity.activities.index               | GET     | /apps/activity/                                    |
| activity.activities.showlist            | GET     | /apps/activity/{filter}                            |
| activity.apiv1.get                      | GET     | /ocs/v2.php/cloud/activity                         |
| activity.apiv2.getdefault               | GET     | /ocs/v2.php/apps/activity/api/v2/activity          |
| activity.apiv2.getfilter                | GET     | /ocs/v2.php/apps/activity/api/v2/activity/{filter} |
| activity.apiv2.listfilters              | GET     | /ocs/v2.php/apps/activity/api/v2/activity/filters  |
| activity.feed.show                      | GET     | /apps/activity/rss.php                             |
| activity.remoteactivity.receiveactivity | POST    | /ocs/v2.php/apps/activity/api/v2/remote/{token}    |
| activity.settings.admin                 | POST    | /apps/activity/settings/admin                      |
| activity.settings.feed                  | POST    | /apps/activity/settings/feed                       |
| activity.settings.personal              | POST    | /apps/activity/settings                            |
+-----------------------------------------+---------+----------------------------------------------------+

$ occ router:list activity --ocs
+-----------------------------------------+---------+----------------------------------------------------+
| route                                   | request | path                                               |
+-----------------------------------------+---------+----------------------------------------------------+
| activity.apiv1.get                      | GET     | /ocs/v2.php/cloud/activity                         |
| activity.apiv2.getdefault               | GET     | /ocs/v2.php/apps/activity/api/v2/activity          |
| activity.apiv2.getfilter                | GET     | /ocs/v2.php/apps/activity/api/v2/activity/{filter} |
| activity.apiv2.listfilters              | GET     | /ocs/v2.php/apps/activity/api/v2/activity/filters  |
| activity.remoteactivity.receiveactivity | POST    | /ocs/v2.php/apps/activity/api/v2/remote/{token}    |
+-----------------------------------------+---------+----------------------------------------------------+

$ occ router:list activity --index
+------------------------------+---------+-------------------------------+
| route                        | request | path                          |
+------------------------------+---------+-------------------------------+
| activity.activities.index    | GET     | /apps/activity/               |
| activity.activities.showlist | GET     | /apps/activity/{filter}       |
| activity.feed.show           | GET     | /apps/activity/rss.php        |
| activity.settings.admin      | POST    | /apps/activity/settings/admin |
| activity.settings.feed       | POST    | /apps/activity/settings/feed  |
| activity.settings.personal   | POST    | /apps/activity/settings       |
+------------------------------+---------+-------------------------------+

Checklist

@nickvergessen nickvergessen added this to the Nextcloud 32 milestone Jun 24, 2025
@nickvergessen nickvergessen self-assigned this Jun 24, 2025
@nickvergessen nickvergessen requested a review from a team as a code owner June 24, 2025 21:46
@nickvergessen nickvergessen requested review from artonge, come-nc and leftybournes and removed request for a team June 24, 2025 21:46
@nickvergessen nickvergessen requested review from a team and provokateurin June 24, 2025 21:46
@nickvergessen nickvergessen force-pushed the feat/noid/add-command-to-list-all-routes branch from df45317 to cd52d1b Compare June 24, 2025 21:51
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen force-pushed the feat/noid/add-command-to-list-all-routes branch from cd52d1b to a957e3a Compare June 25, 2025 06:20
@nickvergessen nickvergessen added the pending documentation This pull request needs an associated documentation update label Jun 25, 2025
@nickvergessen nickvergessen merged commit 06ebbb6 into master Jun 25, 2025
212 of 214 checks passed
@nickvergessen nickvergessen deleted the feat/noid/add-command-to-list-all-routes branch June 25, 2025 07:34
@nickvergessen
Copy link
Member Author

/backport to stable31

@skjnldsv skjnldsv modified the milestones: Nextcloud 33, Nextcloud 32 Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement pending documentation This pull request needs an associated documentation update technical debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants