Comments (3)
Hello,
Can you give more details about what it is not working please?
Thanks in advance.
BR,
/Greg.
from fp-ngfw-smc-python.
Hi Greg,
Sure i can
Currently the problem exists while calling the methods described in the Group API Reference.
The easiest example would be:
GROUPOBJECT.empty_members()
The following exception arises:
Traceback (most recent call last): File "SCRIPTNAME.py", line 36, in <module> GROUPNAME.empty_members() File "/usr/local/lib/python3.6/site-packages/smc/elements/group.py", line 100, in empty_members self.update(element=[]) File "/usr/local/lib/python3.6/site-packages/smc/base/model.py", line 456, in update if self.data.get('system', False): File "/usr/local/lib/python3.6/site-packages/smc/base/decorators.py", line 77, in __get__ value = obj.__dict__[self.func.__name__] = self.func(obj) File "/usr/local/lib/python3.6/site-packages/smc/base/model.py", line 368, in data return LoadElement(self.href) File "/usr/local/lib/python3.6/site-packages/smc/base/model.py", line 281, in __get__ filter_context=instance.typeof) File "/usr/local/lib/python3.6/site-packages/smc/api/common.py", line 151, in fetch_meta_by_name 'exact_match': exact_match}).read() File "/usr/local/lib/python3.6/site-packages/smc/api/common.py", line 75, in read return self._make_request(method='GET') File "/usr/local/lib/python3.6/site-packages/smc/api/common.py", line 101, in _make_request raise err File "/usr/local/lib/python3.6/site-packages/smc/api/common.py", line 86, in _make_request self.href = session.entry_points.get('elements') File "/usr/local/lib/python3.6/site-packages/smc/api/session.py", line 302, in entry_points raise SMCConnectionError('No entry points found, it is likely ' smc.api.exceptions.SMCConnectionError: No entry points found, it is likely there is no valid login session.
If you need any more information feel free to ask.
Thanks for your help
Alrexxar
from fp-ngfw-smc-python.
Hello Alrexxar,
I could use correctly group functionalities using SMC 6.9 and tested with ServiceGroup element.
Used empty_members() method and it is also working for me.
Could you try following test script:
"""
Example script to show how to use group
"""
Python Base Import
import sys
Python SMC Import
from smc import session
from smc.elements.group import ServiceGroup
from smc.elements.service import UDPService
if name == 'main':
URLSMC='http://localhost:8082'
APIKEYSMC='HuphG4Uwg4dN6TyvorTR0001'
try:
session.login(url=URLSMC, api_key=APIKEYSMC, verify=False, timeout=120)
except BaseException as exception_retournee:
sys.exit(-1)
print("session OK")
try:
udp_service1 = UDPService.create("test udpservice1", 500)
udp_service2 = UDPService.create("test udpservice2", 600)
service_group = ServiceGroup.create("test service group", [udp_service1, udp_service2])
service_group = ServiceGroup("test service group")
elements = service_group.obtain_members()
print("members="+str(elements))
print("call empty members")
service_group.empty_members()
elements = service_group.obtain_members()
print("members="+str(elements))
finally:
service_group.delete()
udp_service1.delete()
udp_service2.delete()
for me results are:
session OK
members=[UDPService(name=test udpservice1), UDPService(name=test udpservice2)]
call empty members
members=[]
Process finished with exit code 0
from fp-ngfw-smc-python.
Related Issues (20)
- Lock an smc element HOT 1
- Create users with password in InternalDomain HOT 11
- Wrong version number in "smc/__version__" HOT 1
- certificate verification warnings using the INI file for session creation HOT 2
- add an IP configuration on a tunnel interface without IP HOT 1
- ServerBackupTask fails HOT 2
- Viewing an Alias' references does not show the element referenced in the Alias, only the address. HOT 1
- Setting standby mode on a TunnelInterface HOT 5
- AttributeError when importing smc module HOT 9
- smc_monitoring: SessionNotFound HOT 13
- AttributeError: 'NoneType' object has no attribute 'href' HOT 4
- session.login: Failed to get username HOT 4
- role 'Manage Administrator' mandatory for read only API clients HOT 1
- How add Exceptions on Phase-1ID in Engine Endpoints HOT 1
- How change tunnel Mode in PolicyVPN HOT 3
- Error with 'interface_id' from InternalEndpoint element HOT 10
- Search a firewall policy similarly to "Search Rules" function in SMC GUI HOT 1
- Route-Based VPN Creation Error HOT 7
- multiples sessions HOT 2
- engine.routing_monitoring Error HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fp-ngfw-smc-python.