Skip to main content

Send and receive DENIC RRI commands

Project description

pyrri

Commandline client and module to send/receive RRI commands, written in Python 3

requirements

You must have a recent version of Python 3 installed. The client is tested with Python 3.6, but it may run with older versions, too. It is not compatible with Python 2.x!

No third party modules are needed.

Use it as a client

You need to copy "rri.py" somewhere in your PATH and make it executable. Then call it with "-h" to show help:

rri.py -h

All parameters are optional:

  • -s SERVER defaults to "rri.denic.de:51131"
  • Username and Password can be given as Parameters with -u and -p, but also and more secure as environment variables RRI_USERNAME and RRI_PASSWORD
  • order can be piped in from stdin or as file with parameter -i
  • answer is written to stdout or to a file which can be set with parameter -o

Example 1:

export RRI_USERNAME="DENIC-1000006-USER"
export RRI_PASSWORD="this is a secret"
cat example_kv.txt | ./rri.py

Example 2:

./rri.py -s rri.test.denic.de:51131 -u DENIC-1000006-USER -p password -i example_kv.txt -o answer.txt

Use it as a module

Copy rri.py to your project, import the RRIClient class, instantiate it, connect to the rri server and login

from rri import RRIClient
...

rri = RRIClient()
# connect to rri server
rri.connect(hostname, port)
# login with your credentials
rri.login(username, password)

Now you can send a command to the rri server:

answer = rri.talk(order)

You can repeatedly call the "talk"-method with further orders.

When you are done, logout and disconnect

rri.logout()
rri.disconnect()

When an error occures the methods raise exceptions, which you should handle properly!

TODO

  • Implement check and validation of certificate with trustchain in module and cli
  • add automated tests

License

Copyright (c) 2019 DENIC eG

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrri-0.1.1.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrri-0.1.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file pyrri-0.1.1.tar.gz.

File metadata

  • Download URL: pyrri-0.1.1.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.1 cpython/3.13.11 HTTPX/0.28.1

File hashes

Hashes for pyrri-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3258e00dfe11b455c659b55656bcc93b47de17bfa357c7b9d9c12910708900f1
MD5 3245fee2159b11015c219f349b7f0019
BLAKE2b-256 eef4c47a1b54c18e7da4a6d2537de5af461f2f065194827c975175fcda59faa9

See more details on using hashes here.

File details

Details for the file pyrri-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyrri-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.1 cpython/3.13.11 HTTPX/0.28.1

File hashes

Hashes for pyrri-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7699db8e11231644c29588af4d4a2a20ee7102b9d90f5e25bdfc493ccc9b058b
MD5 835c9c6a60ae7f5584693d497ed244cf
BLAKE2b-256 9f5eb6282b2fc1988576f4637c79347e80aa73874cac94f440ec226445b05170

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page