用于火力威胁防御的有用工具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全文
- 项目
标签: