Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PersistenceOverhaul/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs @ 16685

Last change on this file since 16685 was 14712, checked in by gkronber, 8 years ago

#2520 added GUIDs for (almost) all interface types (probably still too many) also added newlines at end of all files

File size: 6.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.Net.Security;
25using System.ServiceModel;
26using HeuristicLab.Services.Hive.DataTransfer;
27
28namespace HeuristicLab.Services.Hive.ServiceContracts {
29
30  [ServiceContract(ProtectionLevel = ProtectionLevel.EncryptAndSign)]
31  [HeuristicLab.Persistence.Default.CompositeSerializers.Storable.StorableType("F653D7E0-F01D-421E-BA83-1B7A3643A9D0")]
32  public interface IHiveService {
33    #region Task Methods
34    [OperationContract]
35    Guid AddTask(Task task, TaskData taskData, IEnumerable<Guid> resourceIds);
36
37    [OperationContract]
38    Guid AddChildTask(Guid parentTaskId, Task task, TaskData taskData);
39
40    [OperationContract]
41    Task GetTask(Guid taskId);
42
43    [OperationContract]
44    IEnumerable<LightweightTask> GetLightweightJobTasks(Guid jobId);
45
46    [OperationContract]
47    IEnumerable<LightweightTask> GetLightweightJobTasksWithoutStateLog(Guid jobId);
48
49    [OperationContract]
50    TaskData GetTaskData(Guid taskId);
51
52    [OperationContract]
53    void UpdateTask(Task taskDto);
54
55    [OperationContract]
56    void UpdateTaskData(Task taskDto, TaskData taskDataDto);
57
58    [OperationContract]
59    Task UpdateTaskState(Guid taskId, TaskState taskState, Guid? slaveId, Guid? userId, string exception);
60    #endregion
61
62    #region Task Control Methods
63    [OperationContract]
64    void StopTask(Guid taskId);
65
66    [OperationContract]
67    void PauseTask(Guid taskId);
68
69    [OperationContract]
70    void RestartTask(Guid taskId);
71    #endregion
72
73    #region Job Methods
74    [OperationContract]
75    Job GetJob(Guid id);
76
77    [OperationContract]
78    IEnumerable<Job> GetJobs();
79
80    [OperationContract]
81    Guid AddJob(Job jobDto);
82
83    [OperationContract]
84    void UpdateJob(Job jobDto);
85
86    [OperationContract]
87    void DeleteJob(Guid JobId);
88    #endregion
89
90    #region JobPermission Methods
91    [OperationContract]
92    void GrantPermission(Guid jobId, Guid grantedUserId, Permission permission);
93
94    [OperationContract]
95    void RevokePermission(Guid hiveExperimentId, Guid grantedUserId);
96
97    [OperationContract]
98    IEnumerable<JobPermission> GetJobPermissions(Guid jobId);
99
100    // BackwardsCompatibility3.3
101    #region Backwards compatible code, remove with 3.4
102    [OperationContract]
103    bool IsAllowedPrivileged(); // current user may execute privileged task
104    #endregion
105    #endregion
106
107    #region Login Methods
108    [OperationContract]
109    void Hello(Slave slave);
110
111    [OperationContract]
112    void GoodBye(Guid slaveId);
113    #endregion
114
115    #region Heartbeat Methods
116    [OperationContract]
117    List<MessageContainer> Heartbeat(Heartbeat heartbeat);
118    #endregion
119
120    #region Plugin Methods
121    [OperationContract]
122    Plugin GetPlugin(Guid pluginId);
123
124    [OperationContract]
125    [FaultContract(typeof(PluginAlreadyExistsFault))]
126    Guid AddPlugin(Plugin plugin, List<PluginData> pluginData);
127
128    [OperationContract]
129    IEnumerable<Plugin> GetPlugins();
130
131    [OperationContract]
132    IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds);
133    #endregion
134
135    #region ResourcePermission Methods
136    [OperationContract]
137    void GrantResourcePermissions(Guid resourceId, Guid[] grantedUserIds);
138
139    [OperationContract]
140    void RevokeResourcePermissions(Guid resourceId, Guid[] grantedUserIds);
141
142    [OperationContract]
143    IEnumerable<ResourcePermission> GetResourcePermissions(Guid resourceId);
144    #endregion
145
146    #region Slave Methods
147    [OperationContract]
148    Guid AddSlave(Slave slave);
149
150    [OperationContract]
151    Guid AddSlaveGroup(SlaveGroup slaveGroup);
152
153    [OperationContract]
154    Slave GetSlave(Guid slaveId);
155
156    [OperationContract]
157    IEnumerable<Slave> GetSlaves();
158
159    [OperationContract]
160    IEnumerable<SlaveGroup> GetSlaveGroups();
161
162    [OperationContract]
163    void UpdateSlave(Slave slave);
164
165    [OperationContract]
166    void UpdateSlaveGroup(SlaveGroup slaveGroup);
167
168    [OperationContract]
169    void DeleteSlave(Guid slaveId);
170
171    [OperationContract]
172    void DeleteSlaveGroup(Guid slaveGroupId);
173
174    [OperationContract]
175    void AddResourceToGroup(Guid slaveGroupId, Guid resourceId);
176
177    [OperationContract]
178    void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId);
179
180    [OperationContract]
181    Guid GetResourceId(string resourceName);
182
183    [OperationContract]
184    void TriggerEventManager(bool force);
185
186    [OperationContract]
187    int GetNewHeartbeatInterval(Guid slaveId);
188    #endregion
189
190    #region Downtime Methods
191    [OperationContract]
192    Guid AddDowntime(Downtime downtime);
193
194    [OperationContract]
195    void DeleteDowntime(Guid downtimeId);
196
197    [OperationContract]
198    void UpdateDowntime(Downtime downtimeDto);
199
200    [OperationContract]
201    IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId);
202    #endregion
203
204    #region User Methods
205    [OperationContract]
206    string GetUsernameByUserId(Guid userId);
207
208    [OperationContract]
209    Guid GetUserIdByUsername(string username);
210    #endregion
211
212    #region UserPriorities Methods
213    [OperationContract]
214    IEnumerable<UserPriority> GetUserPriorities();
215    #endregion
216  }
217}
Note: See TracBrowser for help on using the repository browser.