Skip to content

Commit

Permalink
devel/py-fireREST: Add new port
Browse files Browse the repository at this point in the history
This port provides an interface to Cisco Firepower Management Center
  • Loading branch information
dlangille committed Feb 15, 2024
1 parent 49a20d1 commit 0ec5a69
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions devel/Makefile
Expand Up @@ -4681,6 +4681,7 @@
SUBDIR += py-findlibs
SUBDIR += py-findpython
SUBDIR += py-fire
SUBDIR += py-fireREST
SUBDIR += py-first
SUBDIR += py-fixtures
SUBDIR += py-flake8
Expand Down
31 changes: 31 additions & 0 deletions devel/py-fireREST/Makefile
@@ -0,0 +1,31 @@
PORTNAME= fireREST
PORTVERSION= 1.1.0
CATEGORIES= devel python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}

MAINTAINER= dvl@FreeBSD.org
COMMENT= Interface with Cisco Firepower Management Center
WWW= https://github.com/kaisero/fireREST

LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE

TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest-runner>0:devel/py-pytest-runner@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}retry2>0:devel/py-retry2@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}simplejson>0:devel/py-simplejson@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}urllib3>0:net/py-urllib3@${PY_FLAVOR}

# Officially: 2.7, 3.5-3.8
USES= python:3.7+
USE_PYTHON= autoplist concurrent distutils

NO_ARCH= yes

post-extract:
${RM} -rf ${WRKSRC}/test

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions devel/py-fireREST/distinfo
@@ -0,0 +1,3 @@
TIMESTAMP = 1706649883
SHA256 (fireREST-1.1.0.tar.gz) = 24f89b1f3c269933ed33e8a859a29200220d4a3b3b109ea8b9a8f3817a32fb4b
SIZE (fireREST-1.1.0.tar.gz) = 65795
9 changes: 9 additions & 0 deletions devel/py-fireREST/files/patch-pyproject.toml
@@ -0,0 +1,9 @@
--- pyproject.toml.orig 2024-01-30 21:49:37 UTC
+++ pyproject.toml
@@ -13,5 +13,6 @@ exclude = '''
| buck-out
| build
| dist
+ | test
)/
'''
19 changes: 19 additions & 0 deletions devel/py-fireREST/pkg-descr
@@ -0,0 +1,19 @@
FireREST is a python library to interface with Cisco Firepower Management Center
REST API. The goal of FireREST is to provide a simple SDK to programmatically
interact with FMC.

Features

* Authentication and automatic session refresh / re-authentication
* Rate-limit detection and automatic backoff and retry behavior
* Automatic squashing of paginated api payloads
* Sanitization of api payloads for create and update operations (automatically
remove unsupported elements like links, metadata from payload)
* Detailed logging of api requests and responses
* API specific error handling using various custom exceptions for typical
errors (e.g. ResourceAlreadyExists, UnprocessAbleEntityError, ...)
* Support for resource lookup by name instead of uuid for all CRUD operations

Import api client

from fireREST import FMC

0 comments on commit 0ec5a69

Please sign in to comment.