A simple registry information service that provides information about IGSN allocating agents and namespaces through a simple API.
To get a local copy up and running follow these simple steps.
- python 3.8 and pip - I'll not go into how to get Python (see here or here) and pip should come for free with your install.
- pipenv - we use this to manage dependencies. You can install it using pip by doing
$ pip install pipenv
- Clone the repo
$ git clone https://github.com/jesserobertson/igsn_namespace_service.git
Cloning into 'igsn_namespace_service'...
# snp output
- Install Python packages
$ cd igsn_namespace_service
$ pipenv install
[====] Creating virtual environment...
# snip output
Installing dependencies from Pipfile.lock (e902b8)…
================================ 46/46 - 00:00:19
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
- To run the test suite or do development, include the
--dev
dependencies:
$ pipenv install --dev
# output as above, should include dev dependencies like pytest
$ pipenv run python -m pytest
========================== test session starts ===========================
# snip test output
Success: no issues found in 6 source files
========================== 39 passed in 10.36s ===========================
The service is very basic and can run standalone. To run a local version of the service, you just need to stand up a test server and start making requests:
- Run the test server using uvicorn (or similar ASGI webservice). This should start a service listening on whatever port you bind it to
$ pipenv run uvicorn app:app --port 8080
INFO: Started server process [21152]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
- Now you should be able to start making requsts using whatever client takes your fancy. I quite like httpie, so I'd do
$ http :8080/agents/CSIRO
HTTP/1.1 200 OK
content-length: 459
content-type: application/json
date: Sun, 12 Apr 2020 05:29:34 GMT
server: uvicorn
{
"name": "CSIRO",
"namespaces": [
{
"date_created": "2013-05-24T15:07:34+02:00",
"handle_prefix": "10273/ARRC",
"namespace": "ARRC",
"owner": "CSIRO"
},
{
"date_created": "2015-01-22T13:01:15+01:00",
"handle_prefix": "10273/CS",
"namespace": "CS",
"owner": "CSIRO"
},
{
"date_created": "2014-05-19T08:44:04+02:00",
"handle_prefix": "10273/CSD",
"namespace": "CSD",
"owner": "CSIRO"
},
{
"date_created": "2013-05-24T15:06:59+02:00",
"handle_prefix": "10273/CSI",
"namespace": "CSI",
"owner": "CSIRO"
}
]
}
- To see the Swagger documentation, head to https://localhost:8080/docs.
For more examples, please refer to the Documentation
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Your Name - @jessrobertson
Project Link: https://github.com/jesserobertson/igsn_namespace_service