pycti.entities.opencti_vocabulary ================================= .. py:module:: pycti.entities.opencti_vocabulary Classes ------- .. autoapisummary:: pycti.entities.opencti_vocabulary.Vocabulary Module Contents --------------- .. py:class:: Vocabulary(opencti) Main Vocabulary class for OpenCTI Manages vocabularies and controlled vocabularies in the OpenCTI platform. :param opencti: instance of :py:class:`~pycti.api.opencti_api_client.OpenCTIApiClient` :type opencti: OpenCTIApiClient Initialize the Vocabulary instance. :param opencti: OpenCTI API client instance :type opencti: OpenCTIApiClient .. py:attribute:: opencti .. py:attribute:: properties :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ id name category { key fields { key } } """ .. raw:: html
.. py:method:: generate_id(name, category) :staticmethod: Generate a STIX ID for a Vocabulary. :param name: the name of the Vocabulary :type name: str :param category: the category of the Vocabulary :type category: str :return: STIX ID for the Vocabulary :rtype: str .. py:method:: generate_id_from_data(data) :staticmethod: Generate a STIX ID from Vocabulary data. :param data: Dictionary containing 'name' and 'category' keys :type data: dict :return: STIX ID for the Vocabulary :rtype: str .. py:method:: list(**kwargs) List Vocabulary objects. :param filters: the filters to apply :type filters: dict :return: List of Vocabulary objects :rtype: list .. py:method:: read(**kwargs) Read a Vocabulary object. :param id: the id of the Vocabulary :type id: str :param filters: the filters to apply if no id provided :type filters: dict :return: Vocabulary object :rtype: dict or None .. py:method:: read_or_create_unchecked_with_cache(vocab, cache, field) Read or create a Vocabulary using a cache for optimization. :param vocab: the vocabulary name :type vocab: str :param cache: the cache dictionary :type cache: dict :param field: the field configuration containing 'required' and 'key' :type field: dict :return: Vocabulary object or None :rtype: dict or None .. py:method:: create(**kwargs) Create a Vocabulary object. :param stix_id: (optional) the STIX ID :type stix_id: str :param name: the name of the Vocabulary (required) :type name: str :param category: the category of the Vocabulary (required) :type category: str :param description: (optional) description :type description: str :param created: (optional) creation date :type created: str :param modified: (optional) modification date :type modified: str :param aliases: (optional) list of aliases :type aliases: list :param x_opencti_stix_ids: (optional) list of additional STIX IDs :type x_opencti_stix_ids: list :param update: (optional) whether to update if exists (default: False) :type update: bool :return: Vocabulary object :rtype: dict or None .. py:method:: read_or_create_unchecked(**kwargs) Read or create a Vocabulary. If the user has no rights to create the vocabulary, return None. :param name: the vocabulary name :type name: str :param required: whether the vocabulary is required :type required: bool :param category: the category of the vocabulary :type category: str :return: The available or created Vocabulary object :rtype: dict or None .. py:method:: update_field(**kwargs) Update a Vocabulary object field. :param id: the Vocabulary id :type id: str :param input: the input of the field :type input: list :return: The updated Vocabulary object :rtype: dict or None