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.2.tar.gz (35.7 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.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyrri-0.1.2.tar.gz
  • Upload date:
  • Size: 35.7 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.2.tar.gz
Algorithm Hash digest
SHA256 4897950a0e4b683bc4f411fa5835e596aa12301c9737ea1aa78aadbee8579473
MD5 bb4c3e9bd43ca58ee433377de3ee41d2
BLAKE2b-256 d96481fcdb17e3eb2e35417d53abb26bf1922abea291c6a75a1ed5087c45ab73

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrri-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6d4fa5d707f6dc93a0a3c3324e8c53479a04fa33d41c74e546d6bd53d453b95b
MD5 875388273fa187f579f83255cb450c22
BLAKE2b-256 0dfa168197268e9f35a9644fe1992921259b60fa2a93efbf1e014655e014a509

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