Giter Club home page Giter Club logo

Comments (3)

shibumi avatar shibumi commented on July 25, 2024

Mhh ok definitely not python related.. with python2.7 I get the type of same error.

from fp-ngfw-smc-python.

shibumi avatar shibumi commented on July 25, 2024

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.

shibumi avatar shibumi commented on July 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.