fortinet-ansible-dev / ansible-galaxy-fortios-collection

GNU General Public License v3.0
84 stars 47 forks source link

How to disable/enable default value in VIP object #279

Closed fgazelot closed 1 month ago

fgazelot commented 8 months ago

Hello,

Feel free to say me if i had missed something in the documentation.

I want create VIP with peer-device-mapping and this code work well :


    "firewall_vip": {
        "comment": "Created by Ansible 'fortimanager_create_objects': test script",
        "dynamic_mapping": [
            {
                "_scope": [
                    {
                        "name": "fw01",
                        "vdom": "root"
                    }
                ],
                "color": "13",
                "extip": "1.1.1.1",
                "mappedip": "1.1.1.2",
                "service": null
            },
            {
                "_scope": [
                    {
                        "name": "fw02",
                        "vdom": "root"
                    }
                ],
                "color": "22",
                "extip": "2.2.2.2",
                "mappedip": "2.2.2.1",
                "service": null
            }
        ],
        "mappedip": "0.0.0.1",
        "name": "vip_local_pnld-dnat-test"
    }
}

However, in my case, i dont need default value and with API i think it's this 'key' to enable/disable that :

{
    "_if_no_default": 1,                <------------------------ THIS KEY
    "portforward": 0,
    "arp-reply": 1,
    "src-filter": null,
    "status": 1,
    "extintf": null,
    "extip": "0.0.0.0",
    "mappedip": "0.0.0.1",
    "ipv6-mappedip": "::",
    "srcintf-filter": null,
    "service": null,
    "extport": null,
    "mappedport": null,
    "ipv6-mappedport": "0",
    "add-nat46-route": 1,
    "color": 0,
    "comment": "Created by Ansible 'fortimanager_create_objects': test script",
    "dns-mapping-ttl": 0,
    "extaddr": [],
    "gratuitous-arp-interval": 0,
    "http-cookie-age": 60,
    "http-cookie-domain": null,
    "http-cookie-domain-from-host": 0,
    "http-cookie-generation": 0,
    "http-cookie-path": null,
    "http-cookie-share": 1,
    "http-ip-header": 0,
    "http-ip-header-name": null,
    "http-multiplex": 0,
    "http-redirect": 0,
    "https-cookie-secure": 0,
    "id": 0,
    "ldb-method": 0,
    "max-embryonic-connections": 1000,
    "monitor": [],
    "name": "vip_local_pnld-dnat-test",
    "nat-source-vip": 0,
    "nat44": 1,
    "nat46": 0,
    "outlook-web-access": 0,
    "persistence": 1,
    "portmapping-type": 0,
    "protocol": 1,
    "server-type": 0,
    .
    .
    .
    "type": 0,
    "uuid": "24f112e4-7fb5-51ee-5509-c9b99bbd7b41",
    "weblogic-server": 0,
    "websphere-server": 0
}

Do you have any idea to diable default value for a VIP ?

Kind regards, FGazelot

fgazelot commented 7 months ago

Hello,

Any idea for doing this ?

Kind regards, FGazelot

JieX19 commented 7 months ago

Hi @fgazelot

The parameter "_if_no_default" is not a supported parameter for this API, it's some metadata returned from the backend. The backend usually returns the metadata to debug or track the requests.

May I know what default value you want to disable?

JieX19 commented 3 months ago

Hi @fgazelot

I'm following up on the status of this ticket. Are there any remaining questions or concerns regarding the default_value?

Thanks, Jie