Files
PrimAITE/docs/source/simulation_components/system/software.rst

66 lines
1.8 KiB
ReStructuredText
Raw Normal View History

.. only:: comment
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
Software
========
2023-11-27 11:38:03 +00:00
-------------
Base Software
-------------
2023-11-27 11:38:03 +00:00
All software which inherits ``IOSoftware`` installed on a node will not work unless the node has been turned on.
2023-11-27 11:38:03 +00:00
See :ref:`Node Start up and Shut down`
2023-11-27 11:38:03 +00:00
.. code-block:: python
from primaite.simulator.network.hardware.base import Node
from primaite.simulator.network.hardware.node_operating_state import NodeOperatingState
from primaite.simulator.system.services.service import ServiceOperatingState
from primaite.simulator.system.services.web_server.web_server import WebServer
node = Node(hostname="pc_a", start_up_duration=0, shut_down_duration=0)
node.power_on()
assert node.operating_state is NodeOperatingState.ON
node.software_manager.install(WebServer)
web_server: WebServer = node.software_manager.software.get("WebServer")
2023-11-27 11:38:03 +00:00
assert web_server.operating_state is ServiceOperatingState.RUNNING # service is immediately ran after install
node.power_off()
assert node.operating_state is NodeOperatingState.OFF
assert web_server.operating_state is ServiceOperatingState.STOPPED # service stops when node is powered off
node.power_on()
assert node.operating_state is NodeOperatingState.ON
assert web_server.operating_state is ServiceOperatingState.RUNNING # service turned back on when node is powered on
.. _List of Applications:
2023-11-27 11:38:03 +00:00
Applications
############
These are a list of applications that are currently available in PrimAITE:
.. include:: list_of_applications.rst
.. _List of Services:
Services
########
These are a list of services that are currently available in PrimAITE:
.. include:: list_of_services.rst
.. _List of Processes:
Processes
#########
`To be implemented`