GithubHelp home page GithubHelp logo

verdel / ipamcli Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 55 KB

With this simple phpIPAM console client you can search, add, edit or remove record for IP entry in phpIPAM manager.

License: MIT License

Python 100.00%
cli click phpipam

ipamcli's Introduction

ipamcli - phpIPAM CLI

What is this?

With this simple phpIPAM console client you can search,add, edit or remove record for IP entry in phpIPAM manager.

Installation

on most UNIX-like systems, you'll probably need to run the following install commands as root or by using sudo

from source

pip install git+https://github.com/verdel/ipamcli

or

git clone https://github.com/verdel/ipamcli.git
cd ipamcli
python setup.py install

as a result, the ipamcli executable will be installed into a system bin directory

Usage

Execute ipamcli with --url, --username, --password, --vlan-list-path options or set environment variables IPAMCLI_URL, IPAMCLI_USERNAME, IPAMCLI_PASSWORD, IPAMCLI_VLAN_LIST

With the environment variables set, running the command will look like this:

ipamcli search --ip 192.168.1.1

To view all the options that you can use to search for a VM, use the --help option:

> ipamcli --help

Usage: ipamcli [OPTIONS] COMMAND [ARGS]...

  Console utility for IPAM management with phpIPAM.

Options:
  -u, --username TEXT    Username for phpIPAM.
  -p, --password TEXT    Password for phpIPAM.
  --url TEXT             phpIPAM url.
  --vlan-list-path PATH  Path to vlan list configuration file.
  --help                 Show this message and exit.

Commands:
  add     add new entry to phpIPAM
  edit    edit exist entry in phpIPAM
  remove  remove exist entry from phpIPAM
  search  search entry in phpIPAM
  show    show entry from sub-network in phpIPAM

Contributing

  1. Check the open issues or open a new issue to start a discussion around your feature idea or the bug you found
  2. Fork the repository and make your changes
  3. Open a new pull request

If your PR has been waiting a while, feel free to ping me on Twitter.

Use this software often? Say Thanks! ๐Ÿ˜ƒ

ipamcli's People

Contributors

verdel avatar

Stargazers

 avatar

Watchers

 avatar  avatar

ipamcli's Issues

Network prefix in add subcommand output

Current output:
The entry for ip 10.33.68.160/255.255.252.0 has been successfully created. The entry ID: 13019.

Need output:
The entry for ip 10.33.68.160/22 (255.255.252.0) has been successfully created. The entry ID: 13019.

JSONDecodeError

Any ideas what may cause this ?

phpIPAM IP address management [v1.4]

jrogers@util01:~/rancid$ python3 -V
Python 3.8.10
jrogers@util01:~/rancid$ pip3 list | grep "ipamcli"
ipamcli                0.0.8
jrogers@util01:~/rancid$ ipamcli search --ip 26.57.79.23
Traceback (most recent call last):
  File "/home/jrogers/.local/bin/ipamcli", line 8, in <module>
    sys.exit(cli())
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1134, in invoke
    Command.invoke(self, ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/jrogers/.local/lib/python3.8/site-packages/ipamcli/cli.py", line 82, in cli
    ctx.token = get_token(ctx)
  File "/home/jrogers/.local/lib/python3.8/site-packages/ipamcli/libs/phpipam/client.py", line 79, in get_token
    elif r.status_code == 200 and r.json():
  File "/usr/lib/python3/dist-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.