2018-08-03 16:15:08 +00:00
|
|
|
Actions and states
|
|
|
|
##################
|
|
|
|
|
|
|
|
Actions are events performed to devices, changing their **state**.
|
|
|
|
Actions can have attributes defining
|
|
|
|
**where** it happened, **who** performed them, **when**, etc.
|
|
|
|
Actions are stored in a log for each device. An exemplifying action
|
|
|
|
can be ``Repair``, which dictates that a device has been repaired,
|
|
|
|
after this action, the device is in the ``repaired`` state.
|
|
|
|
|
|
|
|
Actions and states affect devices in different ways or **dimensions**.
|
|
|
|
For example, ``Repair`` affects the **physical** dimension of a device,
|
|
|
|
and ``Sell`` the **political** dimension of a device. A device
|
|
|
|
can be in several states at the same time, one per dimension; ie. a
|
|
|
|
device can be ``repaired`` (physical) and ``reserved`` (political),
|
|
|
|
but not ``repaired`` and ``disposed`` at the same time.
|
|
|
|
|
|
|
|
Devicehub actions inherit from `schema actions
|
|
|
|
<http://schema.org/Action>`_, are written in Pascal case and using
|
|
|
|
a verb in infinitive. Some verbs represent the willingness or
|
|
|
|
assignment to perform an action; ``ToRepair`` states that the device
|
|
|
|
is going to be / must be repaired, whereas ``Repair`` states
|
|
|
|
that the reparation happened. The former actions have the preposition
|
|
|
|
*To* prefixing the verb.
|
|
|
|
|
|
|
|
In the following section we define the actions and states.
|
|
|
|
To see how to perform actions to the Devicehub API head
|
|
|
|
to the `Swagger docs
|
|
|
|
<https://app.swaggerhub.com/apis/ereuse/devicehub/0.2>`_.
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 4
|
|
|
|
|
|
|
|
actions
|
|
|
|
|
|
|
|
.. uml:: actions.puml
|
|
|
|
|
|
|
|
|
|
|
|
Physical Actions
|
|
|
|
****************
|
2018-11-12 17:15:24 +00:00
|
|
|
The following actions describe and react on the
|
|
|
|
:class:`ereuse_devicehub.resources.device.states.Physical` condition
|
2018-08-03 16:15:08 +00:00
|
|
|
of the devices.
|
|
|
|
|
2018-11-27 10:49:40 +00:00
|
|
|
ToPrepare and Prepare
|
2018-08-03 16:15:08 +00:00
|
|
|
==================
|
2018-11-27 10:49:40 +00:00
|
|
|
Prepare
|
|
|
|
-------
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Prepare
|
2018-11-27 10:49:40 +00:00
|
|
|
ToPrepare
|
|
|
|
---------
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.ToPrepare
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
ToRepair, Repair
|
|
|
|
================
|
2018-11-27 10:49:40 +00:00
|
|
|
Repair
|
|
|
|
------
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Repair
|
2018-11-27 10:49:40 +00:00
|
|
|
ToRepair
|
|
|
|
--------
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.ToRepair
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
ReadyToUse
|
|
|
|
==========
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.ReadyToUse
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
Live
|
|
|
|
====
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Live
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
DisposeWaste, Recover
|
|
|
|
=====================
|
|
|
|
``RecyclingCenter`` users have two extra special events:
|
|
|
|
- ``DisposeWaste``: The device has been disposed in an unspecified
|
|
|
|
manner.
|
|
|
|
- ``Recover``: The device has been scrapped and its materials have
|
|
|
|
been recovered under a new product.
|
|
|
|
|
|
|
|
See `ToDisposeProduct, DisposeProduct`_.
|
|
|
|
|
2018-11-12 17:15:24 +00:00
|
|
|
.. todo:: Events not developed yet.
|
|
|
|
|
2018-08-03 16:15:08 +00:00
|
|
|
Association actions
|
|
|
|
*******************
|
|
|
|
Actions that change the associations users have with devices;
|
|
|
|
ie. the **owners**, **usufructuarees**, **reservees**,
|
|
|
|
and **physical possessors**.
|
|
|
|
|
|
|
|
There are three sub-dimensions: **trade**, **transfer**,
|
|
|
|
and **organize** actions.
|
|
|
|
|
|
|
|
.. uml:: association-events.puml
|
|
|
|
|
2018-11-27 10:49:40 +00:00
|
|
|
Trade
|
|
|
|
=====
|
|
|
|
|
|
|
|
.. todo Not fully developed.
|
|
|
|
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Trade
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
Sell
|
|
|
|
----
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Sell
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
Donate
|
|
|
|
------
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Donate
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
Rent
|
|
|
|
----
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Rent
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
CancelTrade
|
|
|
|
-----------
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.CancelTrade
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
ToDisposeProduct, DisposeProduct
|
2018-11-12 17:15:24 +00:00
|
|
|
--------------------------------
|
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.DisposeProduct
|
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.ToDisposeProduct
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
Transfer actions
|
|
|
|
================
|
|
|
|
The act of transferring/moving devices from one place to another.
|
|
|
|
|
|
|
|
Receive
|
|
|
|
-------
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Receive
|
|
|
|
.. autoclass:: ereuse_devicehub.resources.enums.ReceiverRole
|
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
.. autoattribute:: ereuse_devicehub.resources.device.models.Device.physical_possessor
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
Organize actions
|
|
|
|
================
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Organize
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
Reserve, CancelReservation
|
2018-11-12 17:15:24 +00:00
|
|
|
-------------------------
|
|
|
|
Not fully developed.
|
2018-08-03 16:15:08 +00:00
|
|
|
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Reserve
|
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.CancelReservation
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
Assign, Accept, Reject
|
|
|
|
----------------------
|
2018-11-12 17:15:24 +00:00
|
|
|
Not developed.
|
|
|
|
|
2018-08-03 16:15:08 +00:00
|
|
|
``Assign`` allocates devices to an user. The purpose or meaning
|
|
|
|
of the association is defined by the users.
|
|
|
|
|
|
|
|
``Accept`` and ``Reject`` allow users to accept and reject the
|
|
|
|
assignments.
|
|
|
|
|
|
|
|
.. todo:: shall we add ``Deassign`` or make ``Assign``
|
|
|
|
always define all active users?
|
2018-11-12 17:15:24 +00:00
|
|
|
Assign won't be developed until further notice.
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
Internal state actions
|
|
|
|
**********************
|
|
|
|
Actions providing metadata about devices that don't usually change
|
|
|
|
their state.
|
|
|
|
|
|
|
|
Snapshot
|
|
|
|
========
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Snapshot
|
|
|
|
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
Add, Remove
|
|
|
|
===========
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Add
|
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Remove
|
2018-08-03 16:15:08 +00:00
|
|
|
|
2018-11-17 16:03:03 +00:00
|
|
|
Erase
|
|
|
|
=====
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.EraseBasic
|
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.EraseSectors
|
2018-11-17 16:03:03 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.enums.ErasureStandards
|
|
|
|
:members:
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.ErasePhysical
|
2018-11-17 16:03:03 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.enums.PhysicalErasureMethod
|
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
Install
|
|
|
|
=======
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Install
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
Test
|
|
|
|
====
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Test
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
TestDataStorage
|
|
|
|
---------------
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.TestDataStorage
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
StressTest
|
|
|
|
----------
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.StressTest
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
Benchmark
|
|
|
|
=========
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Benchmark
|
|
|
|
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
BenchmarkDataStorage
|
|
|
|
--------------------
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.BenchmarkDataStorage
|
|
|
|
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
BenchmarkWithRate
|
|
|
|
-----------------
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.BenchmarkWithRate
|
|
|
|
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
BenchmarkProcessor
|
|
|
|
------------------
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.BenchmarkProcessor
|
|
|
|
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
BenchmarkProcessorSysbench
|
|
|
|
--------------------------
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.BenchmarkProcessorSysbench
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
|
2018-11-12 17:15:24 +00:00
|
|
|
BenchmarkRamSysbench
|
|
|
|
--------------------
|
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.BenchmarkRamSysbench
|
|
|
|
|
2018-08-03 16:15:08 +00:00
|
|
|
Rate
|
|
|
|
====
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Rate
|
2018-08-03 16:15:08 +00:00
|
|
|
|
2018-11-17 16:03:03 +00:00
|
|
|
The following are the values the appearance, performance, and
|
|
|
|
functionality grade can have:
|
|
|
|
|
|
|
|
.. autoclass:: ereuse_devicehub.resources.enums.AppearanceRange
|
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
.. autoclass:: ereuse_devicehub.resources.enums.FunctionalityRange
|
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
.. autoclass:: ereuse_devicehub.resources.enums.RatingRange
|
|
|
|
|
2018-08-03 16:15:08 +00:00
|
|
|
Price
|
|
|
|
=====
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Price
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
Migrate
|
|
|
|
=======
|
2018-11-12 17:15:24 +00:00
|
|
|
Not done.
|
2018-08-03 16:15:08 +00:00
|
|
|
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.event.models.Migrate
|
2018-08-03 16:15:08 +00:00
|
|
|
|
2018-11-17 16:03:03 +00:00
|
|
|
Locate
|
|
|
|
======
|
|
|
|
todo
|
|
|
|
.. todo !!
|
|
|
|
|
|
|
|
|
2018-08-03 16:15:08 +00:00
|
|
|
States
|
|
|
|
******
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.device.states.State
|
2018-08-03 16:15:08 +00:00
|
|
|
|
|
|
|
.. uml:: states.puml
|
|
|
|
|
2018-11-12 17:15:24 +00:00
|
|
|
.. autoclass:: ereuse_devicehub.resources.device.states.Trading
|
|
|
|
:members:
|
|
|
|
:undoc-members:
|
|
|
|
.. autoclass:: ereuse_devicehub.resources.device.states.Physical
|
|
|
|
:members:
|
|
|
|
:undoc-members:
|