Raritan / Server Technology Xerus™ PDU JSON-RPC API
OutletGroupManager.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright 2018 Raritan Inc. All rights reserved.
4  */
5 
6 #ifndef __PDUMODEL_OUTLETGROUPMANAGER_IDL__
7 #define __PDUMODEL_OUTLETGROUPMANAGER_IDL__
8 
9 #include <Outlet.idl>
10 #include <OutletGroup.idl>
11 
12 module pdumodel {
13 
14  /** Outlet group manager interface */
15  interface OutletGroupManager {
16  constant int ERR_INVALID_ARGUMENT = 1;
17  constant int ERR_NO_SUCH_ID = 2;
18  constant int ERR_MAX_GROUP_COUNT_REACHED = 3;
19 
20  /** Event: A new outlet group has been created */
21  valueobject GroupCreatedEvent extends event.UserEvent {
22  int id; ///< The ID under which the outlet group manager
23  ///< references this group; may be reused after
24  ///< a group is deleted.
25  int uniqueId; ///< Random ID uniquely identifying the new group
26  OutletGroup group; ///< The new group
27  OutletGroup.Settings settings; ///< The new group's settings
28  };
29 
30  /** Event: An outlet group has been deleted */
31  valueobject GroupDeletedEvent extends event.UserEvent {
32  int id; ///< The ID under which the outlet group manager
33  ///< referenced the group
34  int uniqueId; ///< Random unique ID of the deleted group
35  OutletGroup.Settings settings; ///< Last group settings before deletion
36  };
37 
38  /**
39  * Create a new outlet group.
40  *
41  * @param name New group name
42  * @param members List of member outlets
43  * @param group Result: Reference to newly created group; null in case of error
44  *
45  * @return 0 if OK
46  * @return 1 if any parameters are invalid
47  * @return 3 if the maximum number of groups has been reached
48  */
49  int createGroup(in string name, in vector<Outlet> members, out OutletGroup group);
50 
51  /**
52  * Retrieve the list of outlet groups.
53  *
54  * @return Map of outlet groups, indexed by group ID
55  */
56  map<int, OutletGroup> getAllGroups();
57 
58  /**
59  * Retrieve a specific outlet group.
60  *
61  * @param id The ID of the requested group
62  * @param group Result: requested outlet group; null if not found
63  *
64  * @return 0 if OK
65  * @return 2 if no group with the given ID exists
66  */
67  int getGroup(in int id, out OutletGroup group);
68 
69  /**
70  * Delete an outlet group.
71  *
72  * @param id The ID of the group to delete
73  *
74  * @return 0 if OK
75  * @return 2 if no group with the given ID exists
76  */
77  int deleteGroup(in int id);
78  };
79 }
80 
81 #endif
Outlet group manager interface.
Definition: OutletGroupManager.idl:15
int deleteGroup(in int id)
Delete an outlet group.
map< int, OutletGroup > getAllGroups()
Retrieve the list of outlet groups.
int createGroup(in string name, in vector< Outlet > members, out OutletGroup group)
Create a new outlet group.
int getGroup(in int id, out OutletGroup group)
Retrieve a specific outlet group.
Outlet group interface.
Definition: OutletGroup.idl:15
PDU Model.
Definition: Ade.idl:12
Event: A new outlet group has been created.
Definition: OutletGroupManager.idl:21
int uniqueId
Random ID uniquely identifying the new group.
Definition: OutletGroupManager.idl:25
int id
The ID under which the outlet group manager references this group; may be reused after a group is del...
Definition: OutletGroupManager.idl:22
OutletGroup::Settings settings
The new group's settings.
Definition: OutletGroupManager.idl:27
OutletGroup group
The new group.
Definition: OutletGroupManager.idl:26
Event: An outlet group has been deleted.
Definition: OutletGroupManager.idl:31
int uniqueId
Random unique ID of the deleted group.
Definition: OutletGroupManager.idl:34
int id
The ID under which the outlet group manager referenced the group.
Definition: OutletGroupManager.idl:32
OutletGroup::Settings settings
Last group settings before deletion.
Definition: OutletGroupManager.idl:35
Outlet group settings.
Definition: OutletGroup.idl:27