Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from this space and version 8.2.0

...

Table of Contents
maxLevel3

ProVision versions 8.2 and newer

PeeringDB Options:

Local Installations may opt to sync peering data via the PeeringDB API (recommended), or by self-managing a local database utilizing a cron task to sync data - this option is only recommended for advanced users experiencing heavy loads. 

Sync via PeeringDB API (Recommended):

Info
ProVision only requires a Read Only API Key. For information on PeeringDB API keys, please refer to: https://docs.peeringdb.com/howto/api_keys/

To set a PeeringDB Account, go to Admin Settings → Peering, and enter the Read Only PeeringDB API key. Click "Test" to verify the connection.

Image Added

When done, click "Save Changes". If successful, the phrase "Account is set" will display above the API key form.

Self-Manage a Local DB (Not Recommended):

Instead of making API requests to PeeringDB, you can now make them to a local PeeringDB copy and sync through either a separate cron job or by using the associated Scheduler Task.


Note
This option is only recommended for advanced users experiencing heavy loads. Most users should utilize the API Key option, above.
Expand
titleClick here for instructions...

Define Constants

To link a provision instance to PeeringDB, define these constants in globals.php, where the values match the actual database that is hosting PeeringDB. :


Code Block
define('PEERINGDB_HOST', 'localhost');

define('PEERINGDB_USERNAME', 'root');

define('PEERINGDB_PASSWORD', 'mypass');

define('PEERINGDB_NAME', ‘peeringdb');


This will change Settings section in the Peering area so it will now show the database status, instead of asking you for an account API KEY.


Installation:

For local customers, they can find install instructions for the PeeringDB Python Client here:

https://peeringdb.github.io/peeringdb-py/

You may create a config file as follows:

Code Block
$ cat .peeringdb/config.yaml 
orm:
  backend: django_peeringdb
  database:
    engine: mysql
    host: localhost
    name: peeringdb
    password: supers3cr3t
    port: 0
    user: peeringdb
  migrate: true
  secret_key: ''
sync:
  api_key: YOUR_API_KEY
  only: []
  password: ''
  strip_tz: 1
  timeout: 0
  url: https://www.peeringdb.com/api
  user: ''




Sync set up:

To run a sync of PeeringDB:

Code Block
. pdbvenv/bin/activate
peeringdb sync


The database can also be synced using the scheduler. The task needs to know the location of the python virtual environment where peeringdb-py is installed and the directory that hosts the peeringdb-py config file. 
For information on how to add a scheduler task, see Scheduler


Customers who are not using a python virtual environment, or who are not running their local peeringdb database on the same server, should be able to set up their own cron task as outlined in the documentation below:
https://peeringdb.github.io/peeringdb-py/cli/#sync


View the Status:

Once set up, If the local database is reachable a green success message will display in Admin Settings → Peering Settings. 

Image Added

If the database fails to connect, a warning and error message will display instead:

Image Added



ProVision versions 7.x and newer

For ProVision versions 7.x and later, ProVision directly interfaces with PeeringDB's API to update exchange and peering data, caching the data for a default time of 12 hours.

...