How to use the fmcapi.api_objects.apiclasstemplate.APIClassTemplate function in fmcapi

To help you get started, we’ve selected a few fmcapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github daxm / fmcapi / fmcapi / api_objects / policy_services / prefilterpolicies.py View on Github external
"""PreFilter Policies Class."""

from fmcapi.api_objects.apiclasstemplate import APIClassTemplate
import logging
import warnings


class PreFilterPolicies(APIClassTemplate):
    """The PreFilterPolicies Object in the FMC."""

    VALID_JSON_DATA = ["id", "name", "type", "description", "defaultAction"]
    VALID_FOR_KWARGS = VALID_JSON_DATA + []
    URL_SUFFIX = "/policy/prefilterpolicies"
    VALID_CHARACTERS_FOR_NAME = """[.\w\d_\- ]"""
    REQUIRED_FOR_POST = ["name"]
    DEFAULT_ACTION_OPTIONS = ["ANALYZE_TUNNELS", "BOCK_TUNNELS"]
    FIRST_SUPPORTED_FMC_VERSION = "6.5"

    def __init__(self, fmc, **kwargs):
        """
        Initialize PreFilterPolicies object.

        Set self.type to "PreFilterPolicy" and parse the kwargs.
github daxm / fmcapi / fmcapi / api_objects / device_group_services / devicegrouprecords.py View on Github external
"""DeviceGroupRecords class."""

from fmcapi.api_objects.apiclasstemplate import APIClassTemplate
from fmcapi.api_objects.device_services.devicerecords import DeviceRecords
from fmcapi.api_objects.device_ha_pair_services.ftddevicehapairs import FTDDeviceHAPairs
import logging
import warnings


class DeviceGroupRecords(APIClassTemplate):
    """The DeviceGroupRecords Object in the FMC."""

    VALID_JSON_DATA = ["id", "name", "members"]
    VALID_FOR_KWARGS = VALID_JSON_DATA + []
    URL_SUFFIX = "/devicegroups/devicegrouprecords"

    def __init__(self, fmc, **kwargs):
        """
        Initialize DeviceGroupRecords object.

        Set self.type to "DeviceGroup" and parse the kwargs.

        :param fmc (object): FMC object
        :param **kwargs: Any other values passed during instantiation.
        :return: None
        """
github daxm / fmcapi / fmcapi / api_objects / object_services / networks.py View on Github external
"""Networks Class."""

from fmcapi.api_objects.apiclasstemplate import APIClassTemplate
from fmcapi.api_objects.helper_functions import *
import logging
import warnings


class Networks(APIClassTemplate):
    """The Networks Object in the FMC."""

    VALID_JSON_DATA = ["id", "name", "value", "description"]
    VALID_FOR_KWARGS = VALID_JSON_DATA + []
    URL_SUFFIX = "/object/networks"
    REQUIRED_FOR_POST = ["name", "value"]

    def __init__(self, fmc, **kwargs):
        """
        Initialize Networks object.

        :param fmc: (object) FMC object
        :param kwargs: Any other values passed during instantiation.
        :return: None
        """
        super().__init__(fmc, **kwargs)
github daxm / fmcapi / fmcapi / api_objects / object_services / fqdns.py View on Github external
"""FQDNs Class."""

from fmcapi.api_objects.apiclasstemplate import APIClassTemplate
import logging


class FQDNS(APIClassTemplate):
    """The FQDNS Object in the FMC."""

    VALID_JSON_DATA = [
        "id",
        "name",
        "type",
        "overridableTargetId",
        "value",
        "dnsResolution",
        "overrides",
        "overridable",
    ]
    VALID_FOR_KWARGS = VALID_JSON_DATA + []
    URL_SUFFIX = "/object/fqdns"
    VALID_FOR_DNS_RESOLUTION = ["IPV4_ONLY", "IPV6_ONLY", "IPV4_AND_IPV6"]
    VALID_CHARACTERS_FOR_NAME = """[.\w\d_\- ]"""
github daxm / fmcapi / fmcapi / api_objects / object_services / siurlfeeds.py View on Github external
"""SI URL Feeds Class."""

from fmcapi.api_objects.apiclasstemplate import APIClassTemplate
import logging


class SIUrlFeeds(APIClassTemplate):
    """The SIUrlFeeds Object in the FMC."""

    VALID_JSON_DATA = [
        "id",
        "name",
        "type",
        "checksumURL",
        "feedURL",
        "updateFrequency",
        "overrides",
        "overridable",
    ]
    VALID_FOR_KWARGS = VALID_JSON_DATA + []
    URL_SUFFIX = "/object/siurlfeeds"

    def __init__(self, fmc, **kwargs):
github daxm / fmcapi / fmcapi / api_objects / policy_services / prefilterrules.py View on Github external
from fmcapi.api_objects.apiclasstemplate import APIClassTemplate
from fmcapi.api_objects.policy_services.prefilterpolicies import PreFilterPolicies
from fmcapi.api_objects.object_services.securityzones import SecurityZones
from fmcapi.api_objects.helper_functions import get_networkaddress_type
from fmcapi.api_objects.object_services.fqdns import FQDNS
from fmcapi.api_objects.object_services.networkgroups import NetworkGroups
from fmcapi.api_objects.object_services.networkaddresses import NetworkAddresses
from fmcapi.api_objects.object_services.protocolportobjects import ProtocolPortObjects
from fmcapi.api_objects.object_services.portobjectgroups import PortObjectGroups
from fmcapi.api_objects.object_services.vlangrouptags import VlanTags, VlanGroupTags
import logging


class PreFilterRules(APIClassTemplate):
    """
    The PreFilterRules object in the FMC
    """

    VALID_JSON_DATA = [
        "id",
        "name",
        "action",
        "sourceNetworks",
        "destinationNetworks",
        "sourceInterfaces",
        "destinationInterfaces",
        "sourcePorts",
        "destinationPorts",
        "vlanTags",
        "ruleType",
github daxm / fmcapi / fmcapi / api_objects / object_services / siurllists.py View on Github external
"""SI URL Lists Class."""

from fmcapi.api_objects.apiclasstemplate import APIClassTemplate
import logging


class SIUrlLists(APIClassTemplate):
    """The SIUrlLists Object in the FMC."""

    VALID_JSON_DATA = ["id", "name", "type", "overrides", "overridable"]
    VALID_FOR_KWARGS = VALID_JSON_DATA + []
    URL_SUFFIX = "/object/siurllists"

    def __init__(self, fmc, **kwargs):
        """
        Initialize SIUrlLists object.

        :param fmc: (object) FMC object
        :param kwargs: Any other values passed during instantiation.
        :return: None
        """
        super().__init__(fmc, **kwargs)
        logging.debug("In __init__() for SIUrlLists class.")
github daxm / fmcapi / fmcapi / api_objects / object_services / ranges.py View on Github external
"""Ranges Class."""

from fmcapi.api_objects.apiclasstemplate import APIClassTemplate
from fmcapi.api_objects.helper_functions import *
import logging
import warnings


class Ranges(APIClassTemplate):
    """The Ranges Object in the FMC."""

    VALID_JSON_DATA = ["id", "name", "value", "description"]
    VALID_FOR_KWARGS = VALID_JSON_DATA + []
    URL_SUFFIX = "/object/ranges"
    REQUIRED_FOR_POST = ["name", "value"]

    def __init__(self, fmc, **kwargs):
        """
        Initialize Ranges object.

        :param fmc: (object) FMC object
        :param kwargs: Any other values passed during instantiation.
        :return: None
        """
        super().__init__(fmc, **kwargs)
github daxm / fmcapi / fmcapi / api_objects / object_services / interfacegroups.py View on Github external
"""Interface Groups Class."""

from fmcapi.api_objects.apiclasstemplate import APIClassTemplate
from fmcapi.api_objects.device_services.physicalinterfaces import PhysicalInterfaces
import logging
import warnings


class InterfaceGroups(APIClassTemplate):
    """The InterfaceGroups Object in the FMC."""

    VALID_JSON_DATA = ["id", "name", "description", "interfaceMode", "interfaces"]
    VALID_FOR_KWARGS = VALID_JSON_DATA + []
    URL_SUFFIX = "/object/interfacegroups"
    REQUIRED_FOR_POST = ["name", "interfaceMode"]
    REQUIRED_FOR_PUT = ["id"]
    FILTER_BY_NAME = True

    def __init__(self, fmc, **kwargs):
        """
        Initialize InterfaceGroups object.

        Set self.type to "InterfaceGroup" and parse the kwargs.

        :param fmc: (object) FMC object
github daxm / fmcapi / fmcapi / api_objects / policy_services / manualnatrules.py View on Github external
"""Manual NAT Rules Class."""

from fmcapi.api_objects.apiclasstemplate import APIClassTemplate
from .ftdnatpolicies import FTDNatPolicies
from fmcapi.api_objects.object_services.networkaddresses import NetworkAddresses
from fmcapi.api_objects.object_services.networkgroups import NetworkGroups
from fmcapi.api_objects.object_services.portobjectgroups import PortObjectGroups
from fmcapi.api_objects.object_services.protocolportobjects import ProtocolPortObjects
from fmcapi.api_objects.object_services.interfaceobjects import InterfaceObjects
import logging


class ManualNatRules(APIClassTemplate):
    # Host,Network,NetworkGroup objects
    """The ManualNatRules Object in the FMC."""

    VALID_JSON_DATA = [
        "id",
        "name",
        "type",
        "originalSource",
        "originalDestination",
        "translatedSource",
        "translatedDestination",
        "interfaceInTranslatedSource",
        "interfaceInOriginalDestination",
        "natType",
        "interfaceIpv6",
        "fallThrough",