firemon-api


Namefiremon-api JSON
Version 0.3.4 PyPI version JSON
download
home_page
SummaryPython Wrapper for Firemon APIs
upload_time2023-11-22 14:50:37
maintainer
docs_urlNone
authorLuke Johannsen
requires_python>=3.8
licenseMIT
keywords firemon api development
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            FireMon-API
===========

This project is for wrapper for the Firemon APIs (Security Manager, etc).

The User Guide available on `Read the Docs <https://firemon-api.readthedocs.io/>` 

Current Philosophy
------------------

The ``firemon-api`` is an attempt to make a Pythonic wrapper to the FireMon SIP APIs (Security Manager, etc...).

The intent is to hopefully speed up development of projects. There is no intent to do a 1-to-1 reference of all
the potential API calls. If that is desired you may try to use the dynamically built functions created using
the ``get_api()``. Or read the ``/api-doc`` of your FireMon product and make use of the ``request()`` function for
the individually created application objects.

**Request Example**::

   >>> fm.sm.request(key="device", use_domain=True).get()
   [{'id': 27, 'domainId': 1, 'name': 'PA-VM 11.0.1', 'managementIp': <snip...>]

There is currently no intention to follow any version of the FireMon products and so there may
be instances where a function worked in one version but no longer in another though this generally is not a 
problem.

Installation of FireMon API
---------------------------

Install ``firemon-api`` into a Python ``venv``.

.. code-block:: console

    ~$ python3 -m venv ~/virtualenvs/fmapi
    ~$ source ~/virtualenvs/fmapi/bin/activate
    (fmapi) ~$ pip install firemon-api
    Collecting firemon-api
    ...


Usage
-----

Import module. Disable unverfied https certificate warnings. Switch https verification off.

::

    >>> import firemon_api as fmapi
    >>> fmapi.disable_warnings()
    >>> fm = fmapi.api('saffron', verify=False).auth('firemon', 'firemon')
    >>> fm
    <Firemon(url='https://saffron', version='10.0.0')>
    >>> for dev in fm.sm.devices.all():
    ...   print(dev.name)
    ...
    asa-2961.lab.firemon.com
    ASA5505-8-3-2
    ciscoASA8dot2
    CSM-2
    vSRX-3


Create a new Device. Newer versions of Firemon require we specify which Collector Group and 
ID to use. Grab the first Collector Group. 

Use all the default information from the device pack for our device.

Add in some required information and other settings to our dictionary.

Create the device.

::

    >>> cg = fm.sm.collectorgroups.all()[0]
    >>> config = fm.sm.dp.get('juniper_srx').template()
    >>> config['name'] = 'Conan'
    >>> config['description'] = 'A test of the API'
    >>> config['managementIp'] = '10.2.2.2'
    >>> config['collectorGroupId'] = cg.id
    >>> config['collectorGroupName'] = cg.name
    >>> config['extendedSettingsJson']['password'] = 'abc12345'
    >>> dev = fm.sm.devices.create(config)
    >>> dev
    <Device(Conan)>


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "firemon-api",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "firemon,api,development",
    "author": "Luke Johannsen",
    "author_email": "luke.johannsen@firemon.com",
    "download_url": "https://files.pythonhosted.org/packages/cf/03/98eac79e45f96aa11b0c931d460bc0cc4005a8d61c8d2cc3680cee54d4dd/firemon-api-0.3.4.tar.gz",
    "platform": null,
    "description": "FireMon-API\n===========\n\nThis project is for wrapper for the Firemon APIs (Security Manager, etc).\n\nThe User Guide available on `Read the Docs <https://firemon-api.readthedocs.io/>` \n\nCurrent Philosophy\n------------------\n\nThe ``firemon-api`` is an attempt to make a Pythonic wrapper to the FireMon SIP APIs (Security Manager, etc...).\n\nThe intent is to hopefully speed up development of projects. There is no intent to do a 1-to-1 reference of all\nthe potential API calls. If that is desired you may try to use the dynamically built functions created using\nthe ``get_api()``. Or read the ``/api-doc`` of your FireMon product and make use of the ``request()`` function for\nthe individually created application objects.\n\n**Request Example**::\n\n   >>> fm.sm.request(key=\"device\", use_domain=True).get()\n   [{'id': 27, 'domainId': 1, 'name': 'PA-VM 11.0.1', 'managementIp': <snip...>]\n\nThere is currently no intention to follow any version of the FireMon products and so there may\nbe instances where a function worked in one version but no longer in another though this generally is not a \nproblem.\n\nInstallation of FireMon API\n---------------------------\n\nInstall ``firemon-api`` into a Python ``venv``.\n\n.. code-block:: console\n\n    ~$ python3 -m venv ~/virtualenvs/fmapi\n    ~$ source ~/virtualenvs/fmapi/bin/activate\n    (fmapi) ~$ pip install firemon-api\n    Collecting firemon-api\n    ...\n\n\nUsage\n-----\n\nImport module. Disable unverfied https certificate warnings. Switch https verification off.\n\n::\n\n    >>> import firemon_api as fmapi\n    >>> fmapi.disable_warnings()\n    >>> fm = fmapi.api('saffron', verify=False).auth('firemon', 'firemon')\n    >>> fm\n    <Firemon(url='https://saffron', version='10.0.0')>\n    >>> for dev in fm.sm.devices.all():\n    ...   print(dev.name)\n    ...\n    asa-2961.lab.firemon.com\n    ASA5505-8-3-2\n    ciscoASA8dot2\n    CSM-2\n    vSRX-3\n\n\nCreate a new Device. Newer versions of Firemon require we specify which Collector Group and \nID to use. Grab the first Collector Group. \n\nUse all the default information from the device pack for our device.\n\nAdd in some required information and other settings to our dictionary.\n\nCreate the device.\n\n::\n\n    >>> cg = fm.sm.collectorgroups.all()[0]\n    >>> config = fm.sm.dp.get('juniper_srx').template()\n    >>> config['name'] = 'Conan'\n    >>> config['description'] = 'A test of the API'\n    >>> config['managementIp'] = '10.2.2.2'\n    >>> config['collectorGroupId'] = cg.id\n    >>> config['collectorGroupName'] = cg.name\n    >>> config['extendedSettingsJson']['password'] = 'abc12345'\n    >>> dev = fm.sm.devices.create(config)\n    >>> dev\n    <Device(Conan)>\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python Wrapper for Firemon APIs",
    "version": "0.3.4",
    "project_urls": {
        "Documentation": "https://firemon-api.readthedocs.io/en/latest/",
        "Source": "https://github.com/lukejohannsen/firemon-api"
    },
    "split_keywords": [
        "firemon",
        "api",
        "development"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f797f5483d3bc189f693996377e702231c32d86f07dc2aa3cf612bfc5f2d919a",
                "md5": "d71470ef4be9a14c8541394ca78672a1",
                "sha256": "64376d9a140b40b046ec42177b9280a211f565c64406f2d480cdddff7a3e8aa9"
            },
            "downloads": -1,
            "filename": "firemon_api-0.3.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d71470ef4be9a14c8541394ca78672a1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 79167,
            "upload_time": "2023-11-22T14:50:35",
            "upload_time_iso_8601": "2023-11-22T14:50:35.795861Z",
            "url": "https://files.pythonhosted.org/packages/f7/97/f5483d3bc189f693996377e702231c32d86f07dc2aa3cf612bfc5f2d919a/firemon_api-0.3.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cf0398eac79e45f96aa11b0c931d460bc0cc4005a8d61c8d2cc3680cee54d4dd",
                "md5": "56f227d3289db875d92e3d032b830833",
                "sha256": "b8ecec0e21ce347a7d83a96f0c3784ecb7925c2fe265de52d2753c2c4cfbb06f"
            },
            "downloads": -1,
            "filename": "firemon-api-0.3.4.tar.gz",
            "has_sig": false,
            "md5_digest": "56f227d3289db875d92e3d032b830833",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 66697,
            "upload_time": "2023-11-22T14:50:37",
            "upload_time_iso_8601": "2023-11-22T14:50:37.030781Z",
            "url": "https://files.pythonhosted.org/packages/cf/03/98eac79e45f96aa11b0c931d460bc0cc4005a8d61c8d2cc3680cee54d4dd/firemon-api-0.3.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-22 14:50:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lukejohannsen",
    "github_project": "firemon-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "firemon-api"
}
        
Elapsed time: 0.13990s