Skip to content

Commit 42639e0

Browse files
committed
added basic rst doc for s3 plugin. fixme: complete doc and example
1 parent 83b5ab4 commit 42639e0

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ The different modules are documented below:
3636
parser
3737
objects
3838
diff
39+
plugins_s3
3940

4041
Indices and tables
4142
==================

docs/plugins_s3.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
libnmap.plugins.s3.NmapS3Plugin
2+
===============================
3+
4+
Using libnmap.plugins.s3
5+
------------------------
6+
7+
This modules enables the user to directly use S3 buckets to store and retrieve NmapReports.
8+
9+
NmapS3Plugin methods
10+
--------------------
11+
12+
.. automodule:: libnmap.plugins.s3
13+
.. autoclass:: NmapS3Plugin
14+
:members:

libnmap/plugins/s3.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
class NmapS3Plugin(NmapBackendPlugin):
1515
"""
16-
This plugin save the reports on S3 and compatible
16+
This plugin save the reports on S3 and compatible.
17+
1718
This is now a beta version who use eucalyptus walrus
1819
"""
1920
def __init__(self, **kwargs):
@@ -46,11 +47,12 @@ def __init__(self, **kwargs):
4647
def insert(self, report):
4748
"""
4849
create a json string from an NmapReport instance
49-
and push it to S3 bucket
50+
and push it to S3 bucket.
51+
5052
:param NmapReport: obj to insert
5153
:rtype: string
5254
:return: str id
53-
TODO Add tagging option
55+
:todo: Add tagging option
5456
"""
5557
try:
5658
oid = ObjectId()
@@ -64,7 +66,9 @@ def insert(self, report):
6466
return str(oid)
6567

6668
def get(self, str_report_id=None):
67-
""" select a NmapReport by Id
69+
"""
70+
select a NmapReport by Id.
71+
6872
:param str: id
6973
:rtype: NmapReport
7074
:return: NmapReport object
@@ -84,7 +88,7 @@ def getall(self, dict_filter=None):
8488
"""
8589
:rtype: List of tuple
8690
:return: list of key/report
87-
TODO : add a filter capability
91+
:todo: add a filter capability
8892
"""
8993
nmapreportList = []
9094
for key in bucket_lister(self.bucket):
@@ -97,6 +101,7 @@ def getall(self, dict_filter=None):
97101
def delete(self, report_id=None):
98102
"""
99103
delete an obj from the backend
104+
100105
:param str: id
101106
:return: dict document with result or None
102107
"""

0 commit comments

Comments
 (0)