List database access hosts
GET /api/v2/shared-hosting/{accountId}/database-access-hosts
List the hosts that may connect to the account’s MySQL databases over TCP. The list is account-wide. Every database user may connect from every listed host with its own password. localhost (the local socket) is always allowed and never listed. An app on the hosting that connects over TCP is seen as 127.0.0.1 (::1 over IPv6). That address must be on the list. The account must be active. An account on Hostup’s previous hosting platform returns an empty list. Add a host with POST /api/v2/shared-hosting/{accountId}/database-access-hosts. Remove one with DELETE /api/v2/shared-hosting/{accountId}/database-access-hosts/{host}.
Authentication: An API key with the scopes read:hosting and console:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredacct_…).Example
curl "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/database-access-hosts" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 Allowed database access hosts.
{ "databaseAccessHosts": [ { "host": "127.0.0.1", "note": "Node app on the hosting" }, { "host": "203.0.113.7", "note": "Office" } ]}Response fields
databaseAccessHostsarray of objecthoststring% as the wildcard (203.0.113.%), a hostname or % for every host. Use this value as {host} to remove it.notestring or nullErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller. |
| 409 | Conflict. code is account_suspended, account_not_eligible_cpanel. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |
| 502 | Upstream failure. A dependent provider request failed; the Problem Details code is upstream_failed. Retry later or contact support if the issue persists. |