Join the Conversation

To sign in, use your existing MySonicWall account. To create a free MySonicWall account click "Register".

Sonicwall API 6.5.4 -- Add Network Address Objects to Group

Hello everyone,

I have a group of address-objects consisting of blocked IPs that I keep increasing using the api. However, I would like to also add some network address object to the same group and even if I get a success using the API, nothing changes.

Here's how I have an object:

data = {

'address_object': {

ip_type: {

'name': name,

'zone': zone,

'host': {

'ip': ip

}

}

}

}

datalist = {

'address_objects': [

data['address_object']

]

}

--> Post request to /address-objects/ipv4 to register the object (commit...)

Then I create an object group containing the name of the address I just created:

address_group = {

'address_group':{

ip_type:{

'name': 'BLOCKED IPS',

'address_object':{

ip_type:[

{

'name':name

}

]

}

}

}

}

--> PUT request to /address-groups/ipv4/name/BLOCKED%20IPS with data = address_group


This works perfectly for single ip (host) address-objects but here's the only thing that I change for a network:

data = {

'address_object': {

ip_type:{

'name': name,

'zone': zone,

'network': {

'subnet': '100.100.100.0',

'mask': '/24'

}

}

}

}

Following the exact same path, the network object is added to the address-objects but is not added to my existing group despite receiving success True.


Did anyone came across something similar?

Thanks for your time !

Category: Developer Hub
Reply
Sign In or Register to comment.