From c90431fa4f28328fd969253378fd14acbb6f6c7c Mon Sep 17 00:00:00 2001 From: mcclem Date: Sun, 1 Oct 2023 22:35:16 +1300 Subject: [PATCH] Description added to objects & Remove port from required protocolportobject By removing port from required_for_post for protocolportobject allows creation of non tcp/udp objects (poor naming by cisco api?) Added descriptions to valid json data (requested by more than one of my clients) --- fmcapi/api_objects/object_services/fqdns.py | 1 + fmcapi/api_objects/object_services/icmpv4objects.py | 1 + fmcapi/api_objects/object_services/protocolportobjects.py | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fmcapi/api_objects/object_services/fqdns.py b/fmcapi/api_objects/object_services/fqdns.py index 0396565..eacd416 100644 --- a/fmcapi/api_objects/object_services/fqdns.py +++ b/fmcapi/api_objects/object_services/fqdns.py @@ -10,6 +10,7 @@ class FQDNS(APIClassTemplate): VALID_JSON_DATA = [ "id", "name", + 'description', "type", "overridableTargetId", "value", diff --git a/fmcapi/api_objects/object_services/icmpv4objects.py b/fmcapi/api_objects/object_services/icmpv4objects.py index c59d734..cc695ba 100644 --- a/fmcapi/api_objects/object_services/icmpv4objects.py +++ b/fmcapi/api_objects/object_services/icmpv4objects.py @@ -10,6 +10,7 @@ class ICMPv4Objects(APIClassTemplate): VALID_JSON_DATA = [ "id", "name", + "description", "type", "overrideTargetId", "code", diff --git a/fmcapi/api_objects/object_services/protocolportobjects.py b/fmcapi/api_objects/object_services/protocolportobjects.py index 33a0d60..7328296 100644 --- a/fmcapi/api_objects/object_services/protocolportobjects.py +++ b/fmcapi/api_objects/object_services/protocolportobjects.py @@ -10,7 +10,7 @@ class ProtocolPortObjects(APIClassTemplate): VALID_JSON_DATA = ["id", "name", "description", "port", "protocol", "type"] VALID_FOR_KWARGS = VALID_JSON_DATA + [] URL_SUFFIX = "/object/protocolportobjects" - REQUIRED_FOR_POST = ["name", "port", "protocol"] + REQUIRED_FOR_POST = ["name", "protocol"] def __init__(self, fmc, **kwargs): """