/docs/source/api/v3/dbdump.rst

https://github.com/apache/trafficcontrol · ReStructuredText · 66 lines · 54 code · 12 blank · 0 comment · 0 complexity · 3100f966562e1487ba264b46d35fdd2b MD5 · raw file

  1. ..
  2. ..
  3. .. Licensed under the Apache License, Version 2.0 (the "License");
  4. .. you may not use this file except in compliance with the License.
  5. .. You may obtain a copy of the License at
  6. ..
  7. .. http://www.apache.org/licenses/LICENSE-2.0
  8. ..
  9. .. Unless required by applicable law or agreed to in writing, software
  10. .. distributed under the License is distributed on an "AS IS" BASIS,
  11. .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. .. See the License for the specific language governing permissions and
  13. .. limitations under the License.
  14. ..
  15. .. _to-api-dbdump:
  16. **********
  17. ``dbdump``
  18. **********
  19. .. caution:: This is an extremely dangerous thing to do, as it exposes the entirety of the database, including possibly sensitive information. Administrators and systems engineers are advised to instead use database-specific tools to make server transitions more securely.
  20. Dumps the Traffic Ops database as an SQL script that should recreate its schema and contents exactly.
  21. .. impl-detail:: The script is output using the :manpage:`pg_dump(1)` utility, and is thus compatible for use with the :manpage:`pg_restore(1)` utility.
  22. ``GET``
  23. =======
  24. Fetches the database dump.
  25. :Auth. Required: Yes
  26. :Roles Required: "admin"
  27. :Response Type: ``undefined`` - outputs an SQL script, not JSON
  28. Request Structure
  29. -----------------
  30. No parameters available
  31. .. code-block:: http
  32. :caption: Request Example
  33. GET /api/3.0/dbdump HTTP/1.1
  34. Host: trafficops.infra.ciab.test
  35. User-Agent: curl/7.47.0
  36. Accept: */*
  37. Cookie: mojolicious=...
  38. Response Structure
  39. ------------------
  40. .. code-block:: http
  41. :caption: Response Example
  42. HTTP/1.1 200 OK
  43. Access-Control-Allow-Credentials: true
  44. Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
  45. Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
  46. Access-Control-Allow-Origin: *
  47. Content-Type: application/sql
  48. Content-Disposition: attachment
  49. Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
  50. Whole-Content-Sha512: YwvPB0ZToyzT8ilBnDlWWdwV+E3f2Xgus1OKrkNaipQqgrw5zGwq0rC1U9TZ8Zl6kAGcRZgCYnr1EWfHXpJRkg==
  51. X-Server-Name: traffic_ops_golang/
  52. Date: Mon, 09 Sep 2019 21:08:28 GMT
  53. Transfer-Encoding: chunked
  54. -- Actual text omitted - it's huge