marksull / fmcapi

A Python package designed to help users of Cisco's FMC interface with its API.
BSD 3-Clause "New" or "Revised" License
81 stars 57 forks source link

Documentation To Modify Existing objects #53

Closed rlc9090gmail closed 4 years ago

rlc9090gmail commented 4 years ago

Is your feature request related to a problem? Please describe. I can't fine any documentation about using fmcapi to modify existing objects. I am trying to modify a network group object to add more ip addresses to it. I would also like to modify existing rules to add destination ports or destination addresses

Describe the solution you'd like I would like update documentation with some examples of modifying objects.

daxm commented 4 years ago

While composing this answer I notice there isn't a "unit-test" for NetworkGroups. I'll work on getting one built.

(Note: The following is pseudo-code. I just typed it here and didn't actually run it as a program.) Try something like this to get the current object:

net_group = fmcapi.NetworkGroups(fmc=fmc1, name="Existing Name")
net_group.get()

Then make whatever additions/subtractions/modifications needed:

net_group.named_networks(action="add", name="blah")
net_group.unnamed_networks(action="remove", value="1.1.1.0/24")

Then push back into FMC:

net_group.post()
daxm commented 4 years ago

Did this work for you?

rcsnow commented 4 years ago

I have not had a chance to try it yet. I will update when I have. Thanks for the pauedo code.

daxm commented 4 years ago

status?

rlc9090gmail commented 4 years ago

Have not had the opportunity yet. We are experiencing other non api related issues with 6.5.

rlc9090gmail commented 4 years ago

This can closed.