cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
549
Views
5
Helpful
0
Replies

FMC API questions-----API format

Ben Ss
Beginner
Beginner

Hi there

I am a beginner of FMC API. I have quick questions here, How can I use correct format of API, for example, If I want to set up a static ip address for G0/0 and G0/1, for the following example

1. Can I remove metadata and links

2: When I add static ip addres under G0/0, I keep getting an error with 'SyntaxError: Unexpected token :' .Do we have a method to check the format.

Thank you

 

 

content:

{
    "items": [
        {
            "metadata": {
                "timestamp"1646481989533,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            },
            "type""PhysicalInterface",
            "MTU"1500,
            "enabled"false,
            "name""GigabitEthernet0/0",
            "id""000C2950-7115-0ed3-0000-004294967494",
            "mode""NONE",
            "managementOnly"false,
            "ipv6": {
                "enableIPV6"false
            },
             "ipv4": {
               "static": {
                   "address""1.1.13.3",
                   "netmask""255.255.255.0"
                   },
            "enableSGTPropagate"false,
            "metadata": {
                "timestamp"1646481989533,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            }
        },
        {
            "metadata": {
                "timestamp"1646481988820,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            },
            "type""PhysicalInterface",
            "MTU"1500,
            "enabled"false,
            "name""GigabitEthernet0/1",
            "id""000C2950-7115-0ed3-0000-004294967495",
            "mode""NONE",
            "managementOnly"false,
            "ipv6": {
                "enableIPV6"false
            },
            "enableSGTPropagate"false,
            "metadata": {
                "timestamp"1646481988820,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            }
        },
        {
            "metadata": {
                "timestamp"1646481988820,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            },
            "type""PhysicalInterface",
            "MTU"1500,
            "enabled"false,
            "name""GigabitEthernet0/2",
            "id""000C2950-7115-0ed3-0000-004294967496",
            "mode""NONE",
            "managementOnly"false,
            "ipv6": {
                "enableIPV6"false
            },
            "enableSGTPropagate"false,
            "metadata": {
                "timestamp"1646481988820,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            }
        },
        {
            "metadata": {
                "timestamp"1646481988820,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            },
            "type""PhysicalInterface",
            "MTU"1500,
            "enabled"false,
            "name""GigabitEthernet0/3",
            "id""000C2950-7115-0ed3-0000-004294967497",
            "mode""NONE",
            "managementOnly"false,
            "ipv6": {
                "enableIPV6"false
            },
            "enableSGTPropagate"false,
            "metadata": {
                "timestamp"1646481988820,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            }
        },
        {
            "metadata": {
                "timestamp"1646481988820,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            },
            "type""PhysicalInterface",
            "MTU"1500,
            "enabled"false,
            "name""GigabitEthernet0/4",
            "id""000C2950-7115-0ed3-0000-004294967498",
            "mode""NONE",
            "managementOnly"false,
            "ipv6": {
                "enableIPV6"false
            },
            "enableSGTPropagate"false,
            "metadata": {
                "timestamp"1646481988820,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            }
        },
        {
            "metadata": {
                "timestamp"1646481988820,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            },
            "type""PhysicalInterface",
            "MTU"1500,
            "enabled"false,
            "name""GigabitEthernet0/5",
            "id""000C2950-7115-0ed3-0000-004294967499",
            "mode""NONE",
            "managementOnly"false,
            "ipv6": {
                "enableIPV6"false
            },
            "enableSGTPropagate"false,
            "metadata": {
                "timestamp"1646481988820,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            }
        },
        {
            "metadata": {
                "timestamp"1646481988820,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            },
            "type""PhysicalInterface",
            "MTU"1500,
            "enabled"false,
            "name""GigabitEthernet0/6",
            "id""000C2950-7115-0ed3-0000-004294967500",
            "mode""NONE",
            "managementOnly"false,
            "ipv6": {
                "enableIPV6"false
            },
            "enableSGTPropagate"false,
            "metadata": {
                "timestamp"1646481988820,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            }
        },
        {
            "metadata": {
                "timestamp"1646490269220,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            },
            "type""PhysicalInterface",
            "MTU"1500,
            "enabled"true,
            "name""GigabitEthernet0/7",
            "id""000C2950-7115-0ed3-0000-004294967501",
            "mode""NONE",
            "hardware": {
                "duplex""AUTO",
                "speed""AUTO"
            },
            "managementOnly"false,
            "securityZone": {
                "id""d62012e6-9c8f-11ec-8a8f-b1d3b55d6701",
                "type""SecurityZone"
            },
            "enableAntiSpoofing"false,
            "fragmentReassembly"false,
            "ipv6": {
                "enableIPV6"false,
                "enforceEUI64"false,
                "enableAutoConfig"false,
                "enableDHCPAddrConfig"false,
                "enableDHCPNonAddrConfig"false,
                "dadAttempts"1,
                "nsInterval"1000,
                "reachableTime"0,
                "enableRA"true,
                "raLifeTime"1800,
                "raInterval"200
            },
            "ipv4": {
                "static": {
                    "address""10.196.0.254",
                    "netmask""24"
                }
            },
            "enableSGTPropagate"false,
            "ifname""inside",
            "metadata": {
                "timestamp"1646490269220,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            }
        },
        {
            "metadata": {
                "timestamp"1646481988820,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            },
            "type""PhysicalInterface",
            "MTU"1500,
            "enabled"true,
            "name""Diagnostic0/0",
            "id""000C2950-7115-0ed3-0000-004294967502",
            "mode""NONE",
            "managementOnly"true,
            "ipv6": {
                "enableIPV6"false
            },
            "enableSGTPropagate"true,
            "ifname""diagnostic",
            "metadata": {
                "timestamp"1646481988820,
                "domain": {
                    "name""Global",
                    "id""e276abec-e0f2-11e3-8169-6d9ed49b625f",
                    "type""Domain"
                },
                "state""COMMITTED"
            }
        }
    ]
}
0 Replies 0
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers