mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
clean up / format / poetry (#1000)
* stub in poetry for pipenv * re-add tester image * add pre-commit / formatting * fix ghactions * revert test data whitespace, exclude tests/data * revert ws * decruft, rm tox/pipenv * install dev packages for base image * add lgtm config to force to py3
This commit is contained in:
@@ -7,7 +7,7 @@ located in this (`/docs/api/`) directory.
|
||||
The contents of these files are joined into the various openapi description fields when the schema file
|
||||
is regenerated.
|
||||
|
||||
Note that changes to these files won't show up in the documentation until the openapi schema file is
|
||||
Note that changes to these files won't show up in the documentation until the openapi schema file is
|
||||
regenerated and redeployed.
|
||||
|
||||
## Regenerating the schema
|
||||
|
@@ -1,4 +1,4 @@
|
||||
## Facility (Datacenter)
|
||||
## Facility (Datacenter)
|
||||
|
||||
Identified by the `fac` tag.
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
## Internet Exchange / Facility presence
|
||||
## Internet Exchange / Facility presence
|
||||
|
||||
Identified by the `ixfac` tag.
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
## Internet Exchange Prefix
|
||||
## Internet Exchange Prefix
|
||||
|
||||
Identified by the `ixpfx` tag.
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
## Network / Facility presence
|
||||
## Network / Facility presence
|
||||
|
||||
Identified by the `netfac` tag.
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
## Network to Internet Exchange connection
|
||||
## Network to Internet Exchange connection
|
||||
|
||||
Identified by the `netixlan` tag.
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
## Network Point of Contact
|
||||
## Network Point of Contact
|
||||
|
||||
Identified by the `poc` tag.
|
||||
|
||||
@@ -8,4 +8,4 @@ Identified by the `poc` tag.
|
||||
|
||||
### Relationship(s):
|
||||
|
||||
- None
|
||||
- None
|
||||
|
@@ -14,5 +14,3 @@ Depth can be one of three values:
|
||||
**example**
|
||||
|
||||
?depth=1
|
||||
|
||||
|
||||
|
@@ -6,7 +6,7 @@ PeeringDB offers API keys for authenticating API requests. There are two main fo
|
||||
|
||||
These API keys are created and revoked from the organization admin panel. Each key gets its own custom permissions, which can be modified from the "org api key permissions" panel.
|
||||
|
||||
Each key must have an email attached to it; this is because keys may be allowed to create and modify data in PeeringDB, and we need a contact to reach out to in case of questions.
|
||||
Each key must have an email attached to it; this is because keys may be allowed to create and modify data in PeeringDB, and we need a contact to reach out to in case of questions.
|
||||
|
||||

|
||||
|
||||
@@ -42,7 +42,7 @@ import requests
|
||||
API_KEY = os.environ.get("API_KEY")
|
||||
```
|
||||
|
||||
We set the url for the Facility we want to interact with. Note the `/api` in the URL, which signals we are making calls to the REST API.
|
||||
We set the url for the Facility we want to interact with. Note the `/api` in the URL, which signals we are making calls to the REST API.
|
||||
|
||||
```py
|
||||
URL = "https://www.peeringdb.com/api/fac/10003"
|
||||
@@ -104,12 +104,12 @@ then requests can be made with Curl like in the following examples:
|
||||
The following request would return JSON data coresponding to the [ChiX](https://www.peeringdb.com/ix/239) Internet Exchange.
|
||||
|
||||
```sh
|
||||
curl -H "Authorization: Api-Key $API_KEY" -H "Content-Type: application/json" -X GET https://peeringdb.com/api/ix/239
|
||||
curl -H "Authorization: Api-Key $API_KEY" -H "Content-Type: application/json" -X GET https://peeringdb.com/api/ix/239
|
||||
```
|
||||
|
||||
### POST
|
||||
|
||||
The following request would create a new Network under the organization [United IX](https://www.peeringdb.com/org/10843).
|
||||
The following request would create a new Network under the organization [United IX](https://www.peeringdb.com/org/10843).
|
||||
|
||||
```sh
|
||||
curl -H "Authorization: Api-Key $API_KEY" -H "Content-Type: application/json" -X POST --data "{\""org_id"\":\"10843\", \""name"\":\"Brand New Network\", \""asn"\":\"63311\"}" https://peeringdb.com/api/net
|
||||
|
@@ -11,7 +11,7 @@ python manage.py pdb_reversion_inspect <reftag> <id>
|
||||
```
|
||||
|
||||
```
|
||||
VERSION: 7 (392112) - 2018-12-24T07:13:49.612Z - User: johnsmith
|
||||
VERSION: 7 (392112) - 2018-12-24T07:13:49.612Z - User: johnsmith
|
||||
status: 'ok' => 'deleted'
|
||||
```
|
||||
|
||||
|
@@ -68,15 +68,9 @@ pytest -v -rxs --cov-report term-missing --cov=peeringdb_server/ --capture=sys t
|
||||
|
||||
## Dependencies
|
||||
|
||||
All dependencies are now handled by the Pipfile.
|
||||
All dependencies are now handled by poetry.
|
||||
|
||||
To update them, do a pipenv lock, and test.
|
||||
|
||||
To update the requirements.txt file, from the base dir, run:
|
||||
|
||||
```sh
|
||||
scripts/update_requirements_file.sh
|
||||
```
|
||||
To update them, do `poetry lock` and test.
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
Reference in New Issue
Block a user