cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
540
Views
0
Helpful
1
Replies

FMC REST API Question

Wyatt Tegg
Level 1
Level 1

Hello,

I am trying to use the FMC REST API with Postman and would like to append addresses to a network group. So far all that I have found is how to edit the group. So I can add/remove/edit IP address, but have to make sure I take the whole body of that group and add it to my PUT request body, then add/remove/edit IP addresses in the literals. 

My end goal is to be able to make a POST request to grab my token, then make a simple small request of "literals" (IP addresses) that I would like to add. If there is something I'm doing wrong or a better way to do this please let me know. Any help is greatly appreciated!

Add IPs
PUT:  {{fmcIP}}/api/fmc_config/v1/domain/{{domainUUID}}/object/networkgroups/{{objectID}}
Body:
{
"links": {
"self": "{{fmcIP}}/api/fmc_config/v1/domain/{{domainUUID}}/object/networkgroups/{{objectID}}"
},
"type": "NetworkGroup",
"literals": [
{
"type": "Host",
"value": "IP"
},
{
"type": "Host",
"value": "IP"
},
..................
],
"overridable": false,
"description": "NetworkGroupDesc",
"name": "networkGroupName",
"id": "",
"metadata": {
"timestamp": ###########,
"lastUser": {
"name": "abcdefg"
},
"domain": {
"name": "Global",
"id": "{{domainUUID}},
"type": "Domain"
}
}
}

1 Reply 1

Wyatt Tegg
Level 1
Level 1

UPDATE: Just wanted to add that I am just trying to find a way to automate this a bit more so I don't have to always add the full body as shown above for adding new IPs. I just want to be able to put this into the Postman runner and it'll auto add the IPs. I've seen that you can have the body of the request query an external JSON source as well, so I was figuring maybe I could do that for grabbing the IPs. Then I wouldn't have to constantly add the IPs into the body manually for my other FMCs.

 

Thanks again!