MCPcopy Create free account
hub / github.com/STIXProject/python-stix / add_observable

Method add_observable

stix/core/stix_package.py:129–139  ·  view source on GitHub ↗

Adds an ``Observable`` object to the :attr:`observables` collection. If `observable` is not an ``Observable`` instance, an effort will be made to convert it to one.

(self, observable)

Source from the content-addressed store, hash-verified

127 self.campaigns.append(campaign)
128
129 def add_observable(self, observable):
130 """Adds an ``Observable`` object to the :attr:`observables` collection.
131
132 If `observable` is not an ``Observable`` instance, an effort will be
133 made to convert it to one.
134
135 """
136 if not self.observables:
137 self.observables = Observables(observables=observable)
138 else:
139 self.observables.add(observable)
140
141 def add_incident(self, incident):
142 """Adds an :class:`.Incident` object to the :attr:`incidents`

Callers 1

addMethod · 0.95

Calls 1

addMethod · 0.45

Tested by

no test coverage detected