Skip to content

Commit

Permalink
chg: Update tutorial for custom objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Sep 9, 2021
1 parent 37731af commit eafbb76
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
8 changes: 7 additions & 1 deletion docs/tutorial/FullOverview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -622,13 +622,19 @@
"outputs": [],
"source": [
"from pymisp.tools import GenericObjectGenerator\n",
"from uuid import uuid4\n",
"\n",
"attributeAsDict = [{'MyCoolAttribute': {'value': 'critical thing', 'type': 'text'}}, \n",
" {'MyCoolerAttribute': {'value': 'even worse', 'type': 'text'}}]\n",
"\n",
"\n",
"misp_object = GenericObjectGenerator('my-cool-template')\n",
"misp_object.generate_attributes(attributeAsDict)\n",
"# The parameters below are required if no template is provided.\n",
"misp_object.template_uuid = uuid4()\n",
"misp_object.templade_id = 1\n",
"misp_object.description = \"foo\"\n",
"setattr(misp_object, 'meta-category', 'bar')\n",
"\n",
"print(misp_object.to_json())"
]
Expand Down Expand Up @@ -1495,7 +1501,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.2"
"version": "3.9.5"
}
},
"nbformat": 4,
Expand Down
17 changes: 8 additions & 9 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eafbb76

Please sign in to comment.