mirror of
https://github.com/MISP/misp-galaxy.git
synced 2024-11-23 07:17:17 +00:00
24 lines
724 B
Python
24 lines
724 B
Python
|
import json
|
||
|
|
||
|
class Cluster():
|
||
|
def __init__(self, authors: str, category: str, description: str, name: str, source: str, type: str, uuid: str, values: list, internal_type: str):
|
||
|
self.authors = authors
|
||
|
self.category = category
|
||
|
self.description = description
|
||
|
self.name = name
|
||
|
self.source = source
|
||
|
self.type = type
|
||
|
self.uuid = uuid
|
||
|
self.values = values
|
||
|
self.internal_type = internal_type
|
||
|
|
||
|
def add_value(self, value):
|
||
|
self.values.append(value)
|
||
|
|
||
|
def save_to_file(self, path):
|
||
|
with open(path, "w") as file:
|
||
|
file.write(json.dumps(self.__dict__, indent=4))
|
||
|
|
||
|
def get_config(self):
|
||
|
return self.__dict__
|