<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cisco FMX API 6.6.0 - adding member to existing object group in Network Security</title>
    <link>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4298726#M1078843</link>
    <description>&lt;P&gt;The &lt;A href="http://www.ciscoprep.com/p/300-420-designing-cisco-enterprise.html" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Firepower Management Center&lt;/STRONG&gt;&lt;/A&gt; REST API allows a third-party application, such as Firewall Platform Management solutions (FPMs) to read and write NGFW and NGIPS policies and configuration information without needing to go through the Firepower Management Center's (FMC) user interface.&lt;/P&gt;</description>
    <pubDate>Sat, 06 Mar 2021 03:30:57 GMT</pubDate>
    <dc:creator>ameliascotts80938</dc:creator>
    <dc:date>2021-03-06T03:30:57Z</dc:date>
    <item>
      <title>Cisco FMX API 6.6.0 - adding member to existing object group</title>
      <link>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4294748#M1078647</link>
      <description>&lt;P&gt;I am running FMC 6.6.0 API, adding a new member to an object group it wipes out all other existing member!&lt;/P&gt;&lt;P&gt;Would anyone know how to use PUT just to add a member and keep what exists?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2021 18:45:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4294748#M1078647</guid>
      <dc:creator>chinhpham@ems.att.com</dc:creator>
      <dc:date>2021-02-20T18:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco FMX API 6.6.0 - adding member to existing object group</title>
      <link>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4294831#M1078658</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The goal is to read actual members and add the new one to the list and then do the PUT rest api to update.&lt;/P&gt;
&lt;P&gt;Below a quick and dirty code allowing that just as example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;import requests
import csv
import json
from requests.auth import HTTPBasicAuth

address = "fmc.test.com"
username = "username"
password = "password"
api_uri = "/api/fmc_platform/v1/auth/generatetoken"
url = "https://" + address + api_uri
&lt;BR /&gt;// Group-ID of your NetworkGroupObject. I set it up manually but you want to make an API call to look at it dynamically
group_id = "003082AX-24CE-0ed1-0000-003489118828"
actual_members = []
response = requests.request("POST", url, verify=False, auth=HTTPBasicAuth(username, password))

accesstoken = response.headers["X-auth-access-token"]
domain_uuid = response.headers["DOMAIN_UUID"]

urlgetgrp = "https://" + address + "/api/fmc_config/v1/domain/" + domain_uuid + "/object/networkgroups/" + group_id
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
headers['X-auth-access-token'] = accesstoken&lt;BR /&gt;&lt;BR /&gt;// Retrieve group info
response = requests.request("GET", urlgetgrp, headers=headers, verify=False)
// save actual members of group into a list variable&lt;BR /&gt;actual_members = json.loads(response.text)['objects']
idgrp = json.loads(response.text)['id']
namegrp = json.loads(response.text)['name']
typegrp = json.loads(response.text)['type']&lt;BR /&gt;&lt;BR /&gt;// add new member into the list already filled with actual group members. Here I put manually the new host but you can also take that info from an external source and append it to the list variable&lt;BR /&gt;
actual_members.append({"name": "HOST_TEST2", "id": "005056AD-29CE-0ed3-0000-008589966946", "type": "Host"})
&lt;BR /&gt;// build URL and push the PUT to FMC&lt;BR /&gt;urlgrp_construct = "/api/fmc_config/v1/domain/" + domain_uuid + "/object/networkgroups/" + group_id
urlgrpput = "https://" + address + urlgrp_construct
payload = {"objects": actual_members, "id": idgrp, "name": namegrp, "type": typegrp}
response = requests.request("PUT", urlgrpput, headers=headers, data=(json.dumps(payload, indent = 4)), verify=False)
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 02:31:22 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4294831#M1078658</guid>
      <dc:creator>Francesco Molino</dc:creator>
      <dc:date>2021-02-21T02:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco FMX API 6.6.0 - adding member to existing object group</title>
      <link>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4295563#M1078699</link>
      <description>&lt;P&gt;Thanks Francesco, I believe your procedure will work. In my case the Group has 3000+ member (per customer request)&lt;/P&gt;&lt;P&gt;I try to find a way to add a few objects instead of retrieve and re add the whole group.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chinh&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 19:57:12 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4295563#M1078699</guid>
      <dc:creator>chinhpham@ems.att.com</dc:creator>
      <dc:date>2021-02-22T19:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco FMX API 6.6.0 - adding member to existing object group</title>
      <link>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4295567#M1078700</link>
      <description>&lt;P&gt;I will keep your script for re-adding the group. Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 19:58:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4295567#M1078700</guid>
      <dc:creator>chinhpham@ems.att.com</dc:creator>
      <dc:date>2021-02-22T19:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco FMX API 6.6.0 - adding member to existing object group</title>
      <link>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4297370#M1078790</link>
      <description>&lt;P&gt;I understand your point but with the actual APIs, there’s no options I’ve seen to just add a single host and keep what ever is in it.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 04:07:08 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4297370#M1078790</guid>
      <dc:creator>Francesco Molino</dc:creator>
      <dc:date>2021-02-25T04:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco FMX API 6.6.0 - adding member to existing object group</title>
      <link>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4297753#M1078804</link>
      <description>Thank you for your confirmation that in order to add one object we need to re add the other thousand.&lt;BR /&gt;Is there anyway we can ask Cisco to improve it on future releases?&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Feb 2021 16:10:08 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4297753#M1078804</guid>
      <dc:creator>chinhpham@ems.att.com</dc:creator>
      <dc:date>2021-02-25T16:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Cisco FMX API 6.6.0 - adding member to existing object group</title>
      <link>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4298726#M1078843</link>
      <description>&lt;P&gt;The &lt;A href="http://www.ciscoprep.com/p/300-420-designing-cisco-enterprise.html" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Firepower Management Center&lt;/STRONG&gt;&lt;/A&gt; REST API allows a third-party application, such as Firewall Platform Management solutions (FPMs) to read and write NGFW and NGIPS policies and configuration information without needing to go through the Firepower Management Center's (FMC) user interface.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 03:30:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/cisco-fmx-api-6-6-0-adding-member-to-existing-object-group/m-p/4298726#M1078843</guid>
      <dc:creator>ameliascotts80938</dc:creator>
      <dc:date>2021-03-06T03:30:57Z</dc:date>
    </item>
  </channel>
</rss>

