• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved REST API /api/v2/cli/* returns 404

Alban Staehli

Regular Pleskian
Server operating system version
CentOS Linux release 7.9.2009
Plesk version and microupdate number
Plesk Obsidian v18.0.39_build1800211117.18 os_CentOS 7
Hi,

Since I migrated my Plesk vm to a new IP, I realized the REST API calls to CLI returns 404:
  • https://<IP_ADDRESS>:8443/api/v2/cli/commands/ returns 404
  • https://<host.domain.tld>:8443/api/v2/cli/commands/ returns 404
  • command curl -k -u 'admin:password' -X GET "https://<IP_ADDRESS>:8443/api/v2/cli/commands/" returns 404
  • command curl -k -u 'admin:password' -X GET "https://<host.domain.tld>:8443/api/v2/cli/commands/" returns 404
  • https://<IP_ADDRESS>:8443/api/v2/swagger.yml returns the swagger, all good
  • https://<host.domain.tld>:8443/api/v2/swagger.yml returns the swagger, all good
Would you know what has to be tweaked / enabled?
Thank you.
 
Solved.... after playing around, the trailing slash was the issue. No clue why it changed, could be something else than the new IP, such a change in PHP version of the script calling the API...

In brief:
  • https://<IP_ADDRESS>:8443/api/v2/cli/commands/ returns 404
  • https://<host.domain.tld>:8443/api/v2/cli/commands/ returns 404
  • https://<IP_ADDRESS>:8443/api/v2/cli/commands all good
  • https://<host.domain.tld>:8443/api/v2/cli/commands all good
 
Back
Top