Finding Templates API
reptor.api.TemplatesAPI.TemplatesAPI
API client for interacting with SysReptor finding templates.
Example
1 2 3 4 5 6 7 8 9 |
|
Source code in reptor/api/TemplatesAPI.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
get_template
get_template(template_id)
Gets a finding template by ID.
Parameters:
-
template_id
(str
) –Finding template ID
Returns:
-
FindingTemplate
–The FindingTemplate object with all its data
Example
1 |
|
Source code in reptor/api/TemplatesAPI.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
search
search(search_term='')
Searches through the templates using a search term.
Parameters:
-
search_term
(str
, default:''
) –Term to search in finding templates. Defaults to empty string which returns all templates.
Returns:
-
List[FindingTemplate]
–List of templates matching the search criteria
Example
1 |
|
Source code in reptor/api/TemplatesAPI.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
upload_template
upload_template(template)
Uploads a new Finding Template.
Parameters:
-
template
(FindingTemplate
) –The template model data to upload
Returns:
-
Optional[FindingTemplate]
–The uploaded template with server-assigned ID, or None if a template with the same title already exists
Example
1 2 3 4 |
|
Source code in reptor/api/TemplatesAPI.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
delete_template
delete_template(template_id)
Deletes a finding template by ID.
Parameters:
-
template_id
(str
) –Finding template ID
Returns:
-
None
–
Example
1 |
|
Source code in reptor/api/TemplatesAPI.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|
export
export(template_id)
Exports a template in archive format (tar.gz).
Parameters:
-
template_id
(str
) –Finding template ID
Returns:
-
bytes
–The template archive content as bytes
Example
1 2 3 |
|
Source code in reptor/api/TemplatesAPI.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
get_templates_by_tag
get_templates_by_tag(tag)
Retrieves templates that contain a specific tag.
Parameters:
-
tag
(str
) –The tag to search for in template tags
Returns:
-
List[FindingTemplate]
–List of templates that contain the specified tag
Example
1 2 |
|
Source code in reptor/api/TemplatesAPI.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|