Comments (3)
Mhh ok definitely not python related.. with python2.7 I get the type of same error.
from fp-ngfw-smc-python.
Oh and when I try to use a list of strings.. aka: action=['discard']
I get this:
Action specified is not valid for this 'smc.api.exceptions.CreateRuleFailed: Action specified is not valid for this rule type; action: ['discard']
Response status: 202
Response headers:
'Content-Length': '0'
'Date': 'Wed, 01 Jul 2020 10:14:37 GMT'
Response content:
http://192.168.10.73:8082 "GET /6.7/elements?filter=avency-blockctl&filter_context=sub_ipv4_fw_policy&exact_match=True HTTP/1.1" 200 None
Request method: GET
Request URL: http://192.168.10.73:8082/6.7/elements?filter=avency-blockctl&filter_context=sub_ipv4_fw_policy&exact_match=True
Request headers:
'User-Agent': 'python-requests/2.24.0'
'Accept-Encoding': 'gzip, deflate'
'Accept': '*/*'
'Connection': 'keep-alive'
'Content-Type': 'application/json'
'Cookie': 'JSESSIONID=9FA8DAA33162ABCD39740596EB522F99'
Request body:
None
Response status: 200
Response headers:
'ETag': '"ZjRiODgxZGJkNGQzZWJmZTEzMzU3Y2MwYTI3ZTgwYmU="'
'Content-Type': 'application/json'
'Transfer-Encoding': 'chunked'
'Date': 'Wed, 01 Jul 2020 10:14:37 GMT'
Response content:
{"result":[{"href":"http://192.168.10.73:8082/6.7/elements/sub_ipv4_fw_policy/46","name":"avency-blockctl","type":"sub_ipv4_fw_policy"}]}
http://192.168.10.73:8082 "GET /6.7/elements/sub_ipv4_fw_policy/46 HTTP/1.1" 200 None
Request method: GET
Request URL: http://192.168.10.73:8082/6.7/elements/sub_ipv4_fw_policy/46
Request headers:
'User-Agent': 'python-requests/2.24.0'
'Accept-Encoding': 'gzip, deflate'
'Accept': '*/*'
'Connection': 'keep-alive'
'Content-Type': 'application/json'
'Cookie': 'JSESSIONID=9FA8DAA33162ABCD39740596EB522F99'
Request body:
None
Response status: 200
Response headers:
'Cache-Control': 'no-transform, max-age=0'
'ETag': '"NDY5NzExNTkzNTI1MjgwNDQ0"'
'Content-Type': 'application/json'
'Transfer-Encoding': 'chunked'
'Date': 'Wed, 01 Jul 2020 10:14:37 GMT'
Response content:
{"key":46,"link":[{"href":"http://192.168.10.73:8082/6.7/elements/sub_ipv4_fw_policy/46","rel":"self","type":"sub_ipv4_fw_policy"},{"href":"http://192.168.10.73:8082/6.7/elements/sub_ipv4_fw_policy/46/export","rel":"export"},{"href":"http://192.168.10.73:8082/6.7/elements/sub_ipv4_fw_policy/46/history","rel":"history"},{"href":"http://192.168.10.73:8082/6.7/elements/sub_ipv4_fw_policy/46/search_category_tags_from_element","rel":"search_category_tags_from_element"},{"href":"http://192.168.10.73:8082/6.7/elements/sub_ipv4_fw_policy/46/duplicate","rel":"duplicate"},{"href":"http://192.168.10.73:8082/6.7/elements/sub_ipv4_fw_policy/46/force_unlock","rel":"force_unlock"},{"href":"http://192.168.10.73:8082/6.7/elements/sub_ipv4_fw_policy/46/search_rule","rel":"search_rule"},{"href":"http://192.168.10.73:8082/6.7/elements/sub_ipv4_fw_policy/46/open","rel":"open"},{"href":"http://192.168.10.73:8082/6.7/elements/sub_ipv4_fw_policy/46/save","rel":"save"},{"href":"http://192.168.10.73:8082/6.7/elements/sub_ipv4_fw_policy/46/fw_ipv4_access_rule","rel":"fw_ipv4_access_rules","type":"fw_ipv4_access_rule"}],"name":"avency-blockctl","read_only":false,"system":false,"system_key":-1}
http://192.168.10.73:8082 "GET /6.7/elements?filter=freevpn.gg&filter_context=ip_list&exact_match=True HTTP/1.1" 200 None
Request method: GET
Request URL: http://192.168.10.73:8082/6.7/elements?filter=freevpn.gg&filter_context=ip_list&exact_match=True
Request headers:
'User-Agent': 'python-requests/2.24.0'
'Accept-Encoding': 'gzip, deflate'
'Accept': '*/*'
'Connection': 'keep-alive'
'Content-Type': 'application/json'
'Cookie': 'JSESSIONID=9FA8DAA33162ABCD39740596EB522F99'
Request body:
None
Response status: 200
Response headers:
'ETag': '"NTQ4NDk5OWViNDVlZTdhYTY4ODliODFlOGU2MzdjMTY="'
'Content-Type': 'application/json'
'Transfer-Encoding': 'chunked'
'Date': 'Wed, 01 Jul 2020 10:14:37 GMT'
Response content:
{"result":[{"href":"http://192.168.10.73:8082/6.7/elements/ip_list/23139","name":"freevpn.gg","type":"ip_list"}]}
Traceback (most recent call last):
File "avency-blockctl.py", line 154, in <module>
Blockctl()
File "avency-blockctl.py", line 146, in __init__
self.apply_blacklists(config, args)
File "avency-blockctl.py", line 126, in apply_blacklists
policy.fw_ipv4_access_rules.create(name=bl['name'], services='any', sources='any', destinations=[smc.elements.network.IPList(bl['name'])], action=['discard'], comment=bl['comment'])
File "/home/chris/.virtualenvs/avency-blockctl/lib/python3.8/site-packages/smc/policy/rule.py", line 523, in create
raise CreateRuleFailed('Action specified is not valid for this '
smc.api.exceptions.CreateRuleFailed: Action specified is not valid for this rule type; action: ['discard']
http://192.168.10.73:8082 "PUT /6.7/logout HTTP/1.1" 204 0
from fp-ngfw-smc-python.
Hi,
Looks like this is this issue here: gabstopper/smc-python#54
I am going to close this issue:
Fixed with using gabstopper/smc-python and develop branch.
It would be cool if you guys could set a new version soon and make this repository the official one. Right now I feel like jumping between two repositories.
from fp-ngfw-smc-python.
Related Issues (20)
- VPN Gateway expiration date HOT 3
- 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
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.