dneuman64 closed pull request #3128: Updated documentation for the new Go db/admin binary URL: https://github.com/apache/trafficcontrol/pull/3128
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b07ecba4..49863ea54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - /api/1.1/cdns/name/:name/dnsseckeys `GET` - /api/1.4/cdns/name/:name/dnsseckeys `GET` - To support reusing a single riak cluster connection, an optional parameter is added to riak.conf: "HealthCheckInterval". This options takes a 'Duration' value (ie: 10s, 5m) which affects how often the riak cluster is health checked. Default is currently set to: "HealthCheckInterval": "5s". +- Added a new Go db/admin binary to replace the Perl db/admin.pl script which is now deprecated and will be removed in a future release. The new db/admin binary is essentially a drop-in replacement for db/admin.pl since it supports all of the same commands and options; therefore, it should be used in place of db/admin.pl for all the same tasks. - Added an API 1.4 endpoint, /api/1.4/cdns/dnsseckeys/refresh, to perform necessary behavior previously served outside the API under `/internal`. - Adds the DS Record text to the cdn dnsseckeys endpoint in 1.4. - Added monitoring.json snapshotting. This stores the monitoring json in the same table as the crconfig snapshot. Snapshotting is now required in order to push out monitoring changes. diff --git a/docs/source/admin/traffic_ops/installation.rst b/docs/source/admin/traffic_ops/installation.rst index 6e09bde0a..518dc3bf1 100644 --- a/docs/source/admin/traffic_ops/installation.rst +++ b/docs/source/admin/traffic_ops/installation.rst @@ -238,7 +238,7 @@ To upgrade from older Traffic Ops versions, run the following commands as the ro systemctl stop traffic_ops yum upgrade traffic_ops pushd /opt/traffic_ops/app/ - PERL5LIB=/opt/traffic_ops/app/lib:/opt/traffic_ops/app/local/lib/perl5 ./db/admin.pl --env production upgrade + ./db/admin --env production upgrade After this completes, see :ref:`to-install` to run the ``postinstall`` script. Once the ``postinstall`` script, has finished, run the following command as the root user (or with ``sudo``): diff --git a/docs/source/api/federations.rst b/docs/source/api/federations.rst index aa771734a..1ce319ae6 100644 --- a/docs/source/api/federations.rst +++ b/docs/source/api/federations.rst @@ -97,7 +97,7 @@ Request Structure :resolve4: An array of IPv4 addresses that can resolve the Delivery Service's federation :resolve6: An array of IPv6 addresses that can resolve the Delivery Service's federation -.. code-block::http +.. code-block:: http :caption: Request Example POST /api/1.1/federations HTTP/1.1 diff --git a/docs/source/development/traffic_ops.rst b/docs/source/development/traffic_ops.rst index de9484c92..ecbecd7a1 100644 --- a/docs/source/development/traffic_ops.rst +++ b/docs/source/development/traffic_ops.rst @@ -129,7 +129,7 @@ Perl Formatting Conventions =========================== `Perltidy <http://perltidy.sourceforge.net/>`_ is for use in code formatting. -.. code-block::perl +.. code-block:: perl :caption: Example Perltidy Configuration (usually in ``~/.perltidyrc``) -l=156 @@ -155,11 +155,11 @@ Perl Formatting Conventions Database Management =================== -The ``app/db/admin.pl`` script is for use in managing the Traffic Ops database tables. This essentially serves as a front-end for `Goose <https://bitbucket.org/liamstask/goose/>`_ Below is an example of its usage. +The ``app/db/admin`` binary is for use in managing the Traffic Ops database tables. This essentially serves as a front-end for `Goose <https://bitbucket.org/liamstask/goose/>`_ Below is an example of its usage. -.. note:: For proper resolution of Perl library paths and SOL statement files, it's recommended that this script be run from the ``app`` directory +.. note:: For proper resolution of configuration and SOL statement files, it's recommended that this binary be run from the ``app`` directory -``db/admin.pl [options] command`` +``db/admin [options] command`` Options: @@ -202,12 +202,12 @@ status upgrade Performs a migration on the database for the current environment, then seeds it and patches it using the SQL statements from the ``app/db/patches.sql`` file -.. code-block::bash +.. code-block:: bash :caption: Example Usage - db/admin.pl --env=test reset + db/admin --env=test reset -The environments are defined in the ``app/db/dbconf.yml`` file, and the name of the database generated will be the name of the environment for which it was created. To use the ``admin.pl`` script, you may need to add ``traffic_ops/lib`` and ``traffic_ops/local/lib/perl5`` to your `PERL5LIB <http://modperlbook.org/html/3-9-2-2-Using-the-PERL5LIB-environment-variable.html>`_ environment variable. +The environments are defined in the ``app/db/dbconf.yml`` file, and the name of the database generated will be the name of the environment for which it was created. @@ -218,7 +218,7 @@ To install the Traffic Ops Developer environment: #. Clone the `Traffic Control repository <https://github.com/apache/trafficcontrol>`_ from GitHub. #. Install the local dependencies using `Carton <https://metacpan.org/release/Carton>`_. - .. code-block::shell + .. code-block:: shell :caption: Install Development Dependencies cd traffic_ops/app @@ -229,30 +229,12 @@ To install the Traffic Ops Developer environment: .. seealso:: `PostgreSQL instructions on setting up a database <https://wiki.postgresql.org/wiki/First_steps>`_. -#. Use the ``setup`` command of the ``admin.pl`` script (see `Database Management`_ for usage) to set up the traffic_ops database(s). - - Example Output:: - - $ db/admin.pl --env=development setup - Using database.conf: conf/development/database.conf - Using database.conf: conf/development/database.conf - Using database.conf: conf/development/database.conf - Using database.conf: conf/development/database.conf - Using database.conf: conf/development/database.conf - Using database.conf: conf/development/database.conf - Executing 'drop database to_development' - Executing 'create database to_development' - Creating database tables... - Warning: Using a password on the command line interface can be insecure. - Migrating database... - goose: migrating db environment 'development', current version: 0, target: 20150210100000 - OK 20141222103718_extension.sql - OK 20150108100000_add_job_deliveryservice.sql - OK 20150205100000_cg_location.sql - OK 20150209100000_cran_to_asn.sql - OK 20150210100000_ds_keyinfo.sql - Seeding database... - Warning: Using a password on the command line interface can be insecure. +#. Use the ``reset`` and ``upgrade`` commands of the ``admin`` binary (see `Database Management`_ for usage) to set up the traffic_ops database(s). + + .. code-block:: shell + :caption: Example Usage + + db/admin --env=development reset && db/admin --env=development upgrade #. (Optional) To load the 'KableTown' example/testing data set into the tables, use the ``setup_kabletown.pl`` script located in ``app/bin/db/``. @@ -291,7 +273,7 @@ The integration tests will load an example CDN with most of the features of Traf #. Be sure the integration tests have been run #. Start the Traffic Ops server. The ``MOJO_MODE`` environment variable should be set to the name of the environment that has been loaded. - .. code-block::bash + .. code-block:: bash :caption: Example Startup export MOJO_MODE=integration diff --git a/traffic_ops/testing/api/README.md b/traffic_ops/testing/api/README.md index 06a03b921..e712d5c85 100644 --- a/traffic_ops/testing/api/README.md +++ b/traffic_ops/testing/api/README.md @@ -31,7 +31,7 @@ In order to run the tests you will need the following: `$ cd trafficcontrol/traffic_ops/app` - `$ db/admin.pl --env=test reset` + `$ db/admin --env=test reset` NOTE on passwords: Check that the passwords defined defined for your `to_test` database match ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
