Reply

Ansible nios call

New Member
Posts: 1
872     0

Hi everyone,

 

I'm trying to filter out some 'UNMANAGED' ip records as they are clogging our customers dhcp scopes. when i run:

 

hosts: "{{ lookup('nios', 'search', filter={'address': '10.150.3.216'},provider=nios_provider) }}"

 

I get below object back

 

ok: [CUSTOMER_HOST] => {
    "hosts": [
        {
            "_ref": "ipv4address/whatever:10.150.3.216",
            "ip_address": "10.150.3.216",
            "is_conflict": false,
            "mac_address": "",
            "names": [],
            "network": "10.150.3.0/24",
            "network_view": "default",
            "objects": [],
            "status": "USED",
            "types": [
                "UNMANAGED"
            ],
            "usage": []
        },
        
            "comment": "",
            "network": "10.150.3.0/24",
            "network_view": "default"
        }
    ]

 

Now i want to try and search for all records matching "types" : "UNMANAGED"  however this doesn't seem to exist as a filter..

 

Failed on object search with url https://CUSTOMER_HOST/wapi/v2.11.2/search?types=unmanaged&_max_results=1000: b'{ "Error": "AdmConProtoError: Unknown argument/field: \'types\'", \n  "code": "Client.Ibap.Proto", \n  "text": "Unknown argument/field: \'types\'"\n}'
Failed on object search with url https://CUSTOMER_HOST/wapi/v2.11.2/search?types=unmanaged&_max_results=1000&_proxy_search=GM: b'{ "Error": "AdmConProtoError: Unknown argument/field: \'types\'", \n  "code": "Client.Ibap.Proto", \n  "text": "Unknown argument/field: \'types\'"\n}'

i'm using WAPI version 2.11.2. Does someone know how to achieve this ?

 

Thank you,

 

Stef

 

Showing results for 
Search instead for 
Did you mean: 

Recommended for You