1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2016 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 |
|
---|
22 | using System;
|
---|
23 | using System.Collections.Generic;
|
---|
24 | using System.Net.Security;
|
---|
25 | using System.ServiceModel;
|
---|
26 | using HeuristicLab.Services.Hive.DataTransfer;
|
---|
27 |
|
---|
28 | namespace HeuristicLab.Services.Hive.ServiceContracts {
|
---|
29 |
|
---|
30 | [ServiceContract(ProtectionLevel = ProtectionLevel.EncryptAndSign)]
|
---|
31 | public interface IHiveService {
|
---|
32 | #region Task Methods
|
---|
33 |
|
---|
34 | [OperationContract]
|
---|
35 | Guid AddTask(Task task, TaskData taskData);
|
---|
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 | Guid AddJob(Job jobDto, IEnumerable<Guid> resourceIds);
|
---|
85 |
|
---|
86 | //[OperationContract]
|
---|
87 | //void UpdateJob(Job jobDto);
|
---|
88 |
|
---|
89 | [OperationContract]
|
---|
90 | void UpdateJob(Job jobDto, IEnumerable<Guid> resourceIds);
|
---|
91 |
|
---|
92 | [OperationContract]
|
---|
93 | void UpdateJobState(Guid JobId, JobState jobState);
|
---|
94 |
|
---|
95 | [OperationContract]
|
---|
96 | IEnumerable<AssignedJobResource> GetAssignedResourcesForJob(Guid jobId);
|
---|
97 | #endregion
|
---|
98 |
|
---|
99 | #region JobPermission Methods
|
---|
100 | [OperationContract]
|
---|
101 | void GrantPermission(Guid jobId, Guid grantedUserId, Permission permission);
|
---|
102 |
|
---|
103 | [OperationContract]
|
---|
104 | void RevokePermission(Guid hiveExperimentId, Guid grantedUserId);
|
---|
105 |
|
---|
106 | [OperationContract]
|
---|
107 | IEnumerable<JobPermission> GetJobPermissions(Guid jobId);
|
---|
108 |
|
---|
109 | // BackwardsCompatibility3.3
|
---|
110 | #region Backwards compatible code, remove with 3.4
|
---|
111 | [OperationContract]
|
---|
112 | bool IsAllowedPrivileged(); // current user may execute privileged task
|
---|
113 | #endregion
|
---|
114 | #endregion
|
---|
115 |
|
---|
116 | #region Login Methods
|
---|
117 | [OperationContract]
|
---|
118 | void Hello(Slave slave);
|
---|
119 |
|
---|
120 | [OperationContract]
|
---|
121 | void GoodBye(Guid slaveId);
|
---|
122 | #endregion
|
---|
123 |
|
---|
124 | #region Heartbeat Methods
|
---|
125 | [OperationContract]
|
---|
126 | List<MessageContainer> Heartbeat(Heartbeat heartbeat);
|
---|
127 | #endregion
|
---|
128 |
|
---|
129 | #region Plugin Methods
|
---|
130 | [OperationContract]
|
---|
131 | Plugin GetPlugin(Guid pluginId);
|
---|
132 |
|
---|
133 | [OperationContract]
|
---|
134 | [FaultContract(typeof(PluginAlreadyExistsFault))]
|
---|
135 | Guid AddPlugin(Plugin plugin, List<PluginData> pluginData);
|
---|
136 |
|
---|
137 | [OperationContract]
|
---|
138 | IEnumerable<Plugin> GetPlugins();
|
---|
139 |
|
---|
140 | [OperationContract]
|
---|
141 | IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds);
|
---|
142 | #endregion
|
---|
143 |
|
---|
144 | #region Project Methods
|
---|
145 | [OperationContract]
|
---|
146 | Guid AddProject(Project projectDto);
|
---|
147 |
|
---|
148 | [OperationContract]
|
---|
149 | void UpdateProject(Project projectDto);
|
---|
150 |
|
---|
151 | [OperationContract]
|
---|
152 | void DeleteProject(Guid projectId);
|
---|
153 |
|
---|
154 | [OperationContract]
|
---|
155 | Project GetProject(Guid projectId);
|
---|
156 |
|
---|
157 | [OperationContract]
|
---|
158 | IEnumerable<Project> GetProjects();
|
---|
159 |
|
---|
160 | [OperationContract]
|
---|
161 | IEnumerable<Project> GetProjectsForAdministration();
|
---|
162 | #endregion
|
---|
163 |
|
---|
164 | #region ProjectPermission Methods
|
---|
165 | [OperationContract]
|
---|
166 | void SaveProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool reassign, bool cascading, bool reassignCascading);
|
---|
167 |
|
---|
168 | [OperationContract]
|
---|
169 | void GrantProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading);
|
---|
170 |
|
---|
171 | [OperationContract]
|
---|
172 | void RevokeProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading);
|
---|
173 |
|
---|
174 | [OperationContract]
|
---|
175 | IEnumerable<ProjectPermission> GetProjectPermissions(Guid projectId);
|
---|
176 | #endregion
|
---|
177 |
|
---|
178 | #region AssignedProjectResource Methods
|
---|
179 | [OperationContract]
|
---|
180 | void SaveProjectResourceAssignments(Guid projectId, List<Guid> resourceIds, bool reassign, bool cascading, bool reassignCascading);
|
---|
181 |
|
---|
182 | [OperationContract]
|
---|
183 | void AssignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading);
|
---|
184 |
|
---|
185 | [OperationContract]
|
---|
186 | void UnassignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading);
|
---|
187 |
|
---|
188 | [OperationContract]
|
---|
189 | IEnumerable<AssignedProjectResource> GetAssignedResourcesForProject(Guid projectId);
|
---|
190 |
|
---|
191 | [OperationContract]
|
---|
192 | IEnumerable<AssignedProjectResource> GetAssignedResourcesForProjectAdministration(Guid projectId);
|
---|
193 | #endregion
|
---|
194 |
|
---|
195 | #region Slave Methods
|
---|
196 | [OperationContract]
|
---|
197 | Guid AddSlave(Slave slave);
|
---|
198 |
|
---|
199 | [OperationContract]
|
---|
200 | Guid AddSlaveGroup(SlaveGroup slaveGroup);
|
---|
201 |
|
---|
202 | [OperationContract]
|
---|
203 | Slave GetSlave(Guid slaveId);
|
---|
204 |
|
---|
205 | [OperationContract]
|
---|
206 | IEnumerable<Slave> GetSlaves();
|
---|
207 |
|
---|
208 | [OperationContract]
|
---|
209 | IEnumerable<SlaveGroup> GetSlaveGroups();
|
---|
210 |
|
---|
211 | [OperationContract]
|
---|
212 | IEnumerable<Slave> GetSlavesForAdministration();
|
---|
213 |
|
---|
214 | [OperationContract]
|
---|
215 | IEnumerable<SlaveGroup> GetSlaveGroupsForAdministration();
|
---|
216 |
|
---|
217 | [OperationContract]
|
---|
218 | void UpdateSlave(Slave slave);
|
---|
219 |
|
---|
220 | [OperationContract]
|
---|
221 | void UpdateSlaveGroup(SlaveGroup slaveGroup);
|
---|
222 |
|
---|
223 | [OperationContract]
|
---|
224 | void DeleteSlave(Guid slaveId);
|
---|
225 |
|
---|
226 | [OperationContract]
|
---|
227 | void DeleteSlaveGroup(Guid slaveGroupId);
|
---|
228 |
|
---|
229 | [OperationContract]
|
---|
230 | void AddResourceToGroup(Guid slaveGroupId, Guid resourceId);
|
---|
231 |
|
---|
232 | [OperationContract]
|
---|
233 | void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId);
|
---|
234 |
|
---|
235 | [OperationContract]
|
---|
236 | Guid GetResourceId(string resourceName);
|
---|
237 |
|
---|
238 | [OperationContract]
|
---|
239 | void TriggerEventManager(bool force);
|
---|
240 |
|
---|
241 | [OperationContract]
|
---|
242 | int GetNewHeartbeatInterval(Guid slaveId);
|
---|
243 | #endregion
|
---|
244 |
|
---|
245 | #region Downtime Methods
|
---|
246 | [OperationContract]
|
---|
247 | Guid AddDowntime(Downtime downtime);
|
---|
248 |
|
---|
249 | [OperationContract]
|
---|
250 | void DeleteDowntime(Guid downtimeId);
|
---|
251 |
|
---|
252 | [OperationContract]
|
---|
253 | void UpdateDowntime(Downtime downtimeDto);
|
---|
254 |
|
---|
255 | [OperationContract]
|
---|
256 | IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId);
|
---|
257 | #endregion
|
---|
258 |
|
---|
259 | #region User Methods
|
---|
260 | [OperationContract]
|
---|
261 | string GetUsernameByUserId(Guid userId);
|
---|
262 |
|
---|
263 | [OperationContract]
|
---|
264 | Guid GetUserIdByUsername(string username);
|
---|
265 |
|
---|
266 | [OperationContract]
|
---|
267 | Dictionary<Guid, HashSet<Guid>> GetUserGroupTree();
|
---|
268 |
|
---|
269 | [OperationContract]
|
---|
270 | bool CheckAccessToAdminAreaGranted();
|
---|
271 | #endregion
|
---|
272 |
|
---|
273 | #region UserPriorities Methods
|
---|
274 | [OperationContract]
|
---|
275 | IEnumerable<UserPriority> GetUserPriorities();
|
---|
276 | #endregion
|
---|
277 | }
|
---|
278 | }
|
---|