| Total Complexity | 2 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | """ |
||
| 11 | class NodeActionMessage(Message): |
||
| 12 | """ |
||
| 13 | Message type for requesting a node action made through the CLI application. |
||
| 14 | """ |
||
| 15 | MESSAGE_TYPE = 'controller:NodeActionMessage' |
||
| 16 | """ |
||
| 17 | The message type. |
||
| 18 | |||
| 19 | :type: str |
||
| 20 | """ |
||
| 21 | |||
| 22 | # ------------------------------------------------------------------------------------------------------------------ |
||
| 23 | def __init__(self, uri, act_id): |
||
| 24 | """ |
||
| 25 | Object constructor. |
||
| 26 | |||
| 27 | :param str uri: The URI of the node for which a action is requested. |
||
| 28 | :param int act_id: The ID of the requested action. |
||
| 29 | """ |
||
| 30 | Message.__init__(self, NodeActionMessage.MESSAGE_TYPE) |
||
| 31 | |||
| 32 | self.uri = uri |
||
| 33 | """ |
||
| 34 | The URI of the node for which a action is requested. |
||
| 35 | |||
| 36 | :type: str |
||
| 37 | """ |
||
| 38 | |||
| 39 | self.act_id = act_id |
||
| 40 | """ |
||
| 41 | The ID of the requested action. |
||
| 42 | |||
| 43 | :type: int |
||
| 44 | """ |
||
| 45 | |||
| 46 | # ------------------------------------------------------------------------------------------------------------------ |
||
| 47 | def send_message(self, end_point): |
||
| 48 | """ |
||
| 49 | Sends the message to an end point. |
||
| 50 | |||
| 51 | :param str end_point: The end point. |
||
| 52 | |||
| 53 | :rtype: None |
||
| 54 | """ |
||
| 55 | self.message_controller.send_message(end_point, self) |
||
| 56 | |||
| 58 |