cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2413
Views
0
Helpful
7
Replies

POST multiple Objects into one API request

Orhan.T
Level 1
Level 1

Dear Support,

 

I would like to open a new case about this subject because I have to put over 1500 objects (url, network, host, range) into an FMC (v 6.2.2).

 

The goal is to migrate from an ASA cluster to a Firepower 9300 cluster. And for that, I use the API for extract the data from the ASA, formats it for the Firepower and use the Firepower API for inject the formatted objects

 

My problem is:

- All the examples that I found on the Cisco site show how to post a single object

- The limitation of 120 requests by minutes break my loop

- I'm unable to find a correct and a exact syntax of the JSON body that I need to insert into my API request for post some objects.

 

First of all I would like to know if it's definitely possible to insert some objects in the same API request.

If it's possible, can someone give me the simplest possible example in python language or the syntax in JSON that I have to insert in my python code. 

 

Tanks for all.

7 Replies 7

ronei.amorim
Level 1
Level 1

Hello Orhan,

 

I have same problem...

 

I put the JSON format in FMC's API to POST more then one object host and I get an error: JSON parse error 

 


{
"name": "Test108",
"value": "1.1.2.108",
"type": "Host",
"description" : "Teste"
},
{
"name": "Test109",
"value": "1.1.2.109",
"type": "Host",
"description" : "Teste"
}

I found a solution that consists of creating a dictionary that contains all the objects in JSON format and create a loop into this dictionary for post each elements

Hi Orhan,

Thanks for idea.

 

Well...  Do you create a script and a file using as argument of scritp?

like that?
script.py file.txt

 

 

I my case, I created a script that get all the objects and ACL stored in the ASA via the API and convert them into the FMC format and post it with the FMC API.

Very nice!!
I'm trying to convert SonicWall objects to Firepower...

But, I need treat this objects in the excel before...

 

I'm migrating one Checkpoint and one SonicWall to Firepower...

For the Checkpoint, I'm using the migration tool of site https://fwmig.cisco.com and after I convert ASA config to Firepower via FMC.

 

 

 

Hello Orhan,

 

I tried to do a loop...

 

file.txt

{"name":"Test110","value":"1.1.2.110","type":"Host","description":"Teste"}
{"name":"Test111","value":"1.1.2.111","type":"Host","description":"Teste"}

 

I did:

 

for i in `cat arq.txt`; do perl script.pl admin password $i; done

 

But I get Response code: 401

If I do filling the variable with content it's works fine:
my $data{"name":"Test112","value":"1.1.2.112","type":"Host","description":"Teste"}

 

Let me know if you have some help...

 

Best Regards!!

Hi Experts,

 

I am trying to import objects on to an FTD, are there any options to import multiple objects via the api-explorer apart from writing your own scripts? As of now only a single object appears to work

Review Cisco Networking products for a $25 gift card