Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Filter for networkgroup #81

Open
larsrei opened this issue Jan 9, 2025 · 1 comment
Open

Support Filter for networkgroup #81

larsrei opened this issue Jan 9, 2025 · 1 comment

Comments

@larsrei
Copy link

larsrei commented Jan 9, 2025

Hi,

we using the feature for searching unused object in the firepower management. With the time a lot of hosts, networks and groups are unused.
I automate this with fireREST and it works for hosts and networks. But not for networkgroups because the support filters a missing. The API is enabled for this features.

Is there a special reason from your side for not activating the feature for networkgroup?

I try follow and it works for me.
file: fireREST/fmc/object/networkgroup/init.py

from fireREST import utils
from fireREST.defaults import API_RELEASE_610
from fireREST.fmc import Resource, Connection
from fireREST.fmc.object.networkgroup.override import Override


class NetworkGroup(Resource):
    PATH = '/object/networkgroups/{uuid}'
    MINIMUM_VERSION_REQUIRED_CREATE = API_RELEASE_610
    MINIMUM_VERSION_REQUIRED_GET = API_RELEASE_610
    MINIMUM_VERSION_REQUIRED_UPDATE = API_RELEASE_610
    MINIMUM_VERSION_REQUIRED_DELETE = API_RELEASE_610
    SUPPORTED_FILTERS = ['name_or_value', 'unused_only']
    SUPPORTED_PARAMS = ['override_target_id']

    def __init__(self, conn: Connection):
        super().__init__(conn)
        self.override = Override(conn)

    @utils.support_params
    def get(self, uuid=None, name=None, name_or_value=None, unused_only=None, override_target_id=None, params=None):
        return super().get(uuid=uuid, name=name, params=params)
@kaisero
Copy link
Owner

kaisero commented Jan 22, 2025

I've left Cisco 2.5 years ago. Theoretically there have been people who tried to pick up the project but no changes have been made since then. If you create a PR I can merge it and get is upstream for you, but do not expect any additional development on this project (atleast by me).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants