add_alias ( name = example_alias_name, description = example_alias_description, alias_type = example_alias_type ) print ( json. print ( "ADD ALIAS" ) add_output = alias. dumps ( list_output )) # Add a new alias to the Opnsense device # This will return an object that represents the new alias. PORT # List all the aliases print ( "LIST ALIASES" ) list_output = alias. alias_controller # The values for the example alias example_alias_name = "foo_bar" example_alias_description = "This is the description for foo_bar" example_alias_type = AliasType. A Python library for the Opnsense API Getting Started Supported Controllers and ServicesĮxample Script import json from opnsense_api import Opnsense from opnsense_api.util import AliasType # Create an instance of the Opnsense class opnsense = Opnsense ( api_key = "my_opnsense_api_key", api_secret = "my_opnsense_api_secret", host = "192.168.1.1", ca_path = "/path/to/opnsense/ca/cert_bundle.pem" ) # Get the alias controller alias = opnsense.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |