用于火力威胁防御的有用工具onbox REST API

ftd-api的Python项目详细描述


美国石油学会

这个存储库专门用于在box REST API上进行火力威胁防御的有用工具

请注意,仅当此API不可由FMC访问时,才可管理此API。在

安装

从Pypi

{cd1}

使用

现在我们只是在“暴露”批量工具。在这个地方留神,好让更多的好东西来。在

批量工具

如果您已经安装了包,那么批量工具ftd_bulk_tool应该已经在您的路径中了。在

usage: ftd_bulk_tool [-h] [-c FILE_NAME] [-D] [-a ADDRESS] [-P PORT]
                    [-u USERNAME] [-p PASSWORD] [-l LOCATION]
                    [-f {CSV,JSON,YAML}] [--url URL] [-e] [-i ID_LIST]
                    [-n NAME_LIST] [-t TYPE_LIST]
                    {IMPORT,EXPORT,LIST_TYPES}

This tool provides a simple abstraction to handle bulk import/export tasks via
the Firepower Threat Defese REST API.

positional arguments:
{IMPORT,EXPORT,LIST_TYPES}
                        The various different modes in which the tool runs

optional arguments:
-h, --help            show this help message and exit
-c FILE_NAME, --config_file FILE_NAME
                        A properties file allowing you to specify any of the
                        tool's options. If the option is set in both places,
                        the command-line options will override the
                        configuration file. The format is key=value each on
                        it's own line. '#' comments are supported.
-D, --debug             Enable debug logging
-a ADDRESS, --address ADDRESS
                        FTD hostname or IP. Default: 'localhost'
-P PORT, --port PORT  FTD port. Default: 443
-u USERNAME, --username USERNAME
                        The username to login with. Default: 'Admin'
-p PASSWORD, --password PASSWORD
                        The password to login with. Default: 'Admin123'
-l LOCATION, --location LOCATION
                        Directory path for EXPORT mode. One or more file paths
                        (comma delimited) for IMPORT mode. Required by IMPORT,
                        and EXPORT modes
-f {CSV,JSON,YAML}, --format {CSV,JSON,YAML}
                        Specify the import or output format. Default: 'JSON'
--url URL               The URL you would like to export data from instead of
                        doing a full export. Only valid for EXPORT mode.
-e, --pending           Export only pending changes. Only valid for EXPORT
                        mode. Ignored if 'url' is supplied
-i ID_LIST, --id_list ID_LIST
                        A Comma-separated list of ID values to export or remove
                        from an import. This is essentially a filter by id
                        on the export or an exclusion filter on import. Valid
                        for IMPORT and EXPORT mode. Ignored if 'url' or 'pending'
                        are supplied.
-n NAME_LIST, --name_list NAME_LIST
                        A Comma-separated list of names to export or remove
                        from an import. This is essentially a filter by name
                        on the export or an exclusion filter on import. Valid
                        for IMPORT and EXPORT modes. Ignored if 'url' or 'pending'
                        are supplied.
-t TYPE_LIST, --type_list TYPE_LIST
                        A Comma-separated list of types to export or remove
                        from an import. This is essentially a filter by type
                        on the export or an exclusion filter on import. Valid
                        for IMPORT and EXPORT modes. Ignored if 'url' or 'pending'
                        are supplied.

贡献

开发环境

对于希望参与的人:Fork this repo,克隆Fork,然后执行以下命令:

^{pr2}$

这将构建源代码发行版,然后使用符号链接将其安装到您的开发系统上(而不是安装它的副本),这样当您修改代码时,它将立即生效。请注意,这将按照您希望的方式在virtualenv中工作

运行测试

请使用标准unittest库添加单元测试,并将它们放在顶层tests文件夹中。要从顶级目录运行测试,只需运行pytest。或者,您可以直接调用unittest python -m unittest tests/*.py,但pytest肯定更漂亮;)。在

请注意,pytest不是这个包的显式依赖项。因此,您可能希望安装它:pip install pytest

许可证

MIT许可证-参见许可证.TXT全文

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
添加组件后,java JTable为空   java将json发送到php并插入mysql,但返回null   java Spring引导JNDI CommonJ资源   从不同PC创建和合并后的Java servlet问题   java如何在使用findelements时从xpath获取文本   java使用spring boot使用gmail smtp发送电子邮件   java在不使用pojo、bean或getter和setter的情况下获取Json标题的Json数组   Java中的OpenFile对话框将null作为响应   JavaBuilder模式。扩展接口   java中无需替换的数据结构选取   java如何评价Encog中的预测神经网络   java如何在安卓中使用实际的HttpURLConnection进行单元测试?   java使用XML配置禁用WebSocket中的CSRF保护   java如何通过hibernate从多表查询中获取数据?   mysql如何在java中获取更新的行Id   java AEM/CQ组件单一组件/有限组件   java FFmpeg Javacv延迟问题   显示整数数组的java不起作用