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 | //[OperationContract]
|
---|
34 | //Guid AddTask(Task task, TaskData taskData, IEnumerable<Guid> resourceIds);
|
---|
35 |
|
---|
36 | [OperationContract]
|
---|
37 | Guid AddTask(Task task, TaskData taskData);
|
---|
38 |
|
---|
39 | [OperationContract]
|
---|
40 | Guid AddChildTask(Guid parentTaskId, Task task, TaskData taskData);
|
---|
41 |
|
---|
42 | [OperationContract]
|
---|
43 | Task GetTask(Guid taskId);
|
---|
44 |
|
---|
45 | [OperationContract]
|
---|
46 | IEnumerable<LightweightTask> GetLightweightJobTasks(Guid jobId);
|
---|
47 |
|
---|
48 | [OperationContract]
|
---|
49 | IEnumerable<LightweightTask> GetLightweightJobTasksWithoutStateLog(Guid jobId);
|
---|
50 |
|
---|
51 | [OperationContract]
|
---|
52 | TaskData GetTaskData(Guid taskId);
|
---|
53 |
|
---|
54 | [OperationContract]
|
---|
55 | void UpdateTask(Task taskDto);
|
---|
56 |
|
---|
57 | [OperationContract]
|
---|
58 | void UpdateTaskData(Task taskDto, TaskData taskDataDto);
|
---|
59 |
|
---|
60 | [OperationContract]
|
---|
61 | Task UpdateTaskState(Guid taskId, TaskState taskState, Guid? slaveId, Guid? userId, string exception);
|
---|
62 | #endregion
|
---|
63 |
|
---|
64 | #region Task Control Methods
|
---|
65 | [OperationContract]
|
---|
66 | void StopTask(Guid taskId);
|
---|
67 |
|
---|
68 | [OperationContract]
|
---|
69 | void PauseTask(Guid taskId);
|
---|
70 |
|
---|
71 | [OperationContract]
|
---|
72 | void RestartTask(Guid taskId);
|
---|
73 | #endregion
|
---|
74 |
|
---|
75 | #region Job Methods
|
---|
76 | [OperationContract]
|
---|
77 | Job GetJob(Guid id);
|
---|
78 |
|
---|
79 | [OperationContract]
|
---|
80 | IEnumerable<Job> GetJobs();
|
---|
81 |
|
---|
82 | //[OperationContract]
|
---|
83 | //Guid AddJob(Job jobDto);
|
---|
84 |
|
---|
85 | [OperationContract]
|
---|
86 | Guid AddJob(Job jobDto, IEnumerable<Guid> resourceIds);
|
---|
87 |
|
---|
88 | //[OperationContract]
|
---|
89 | //void UpdateJob(Job jobDto);
|
---|
90 |
|
---|
91 | [OperationContract]
|
---|
92 | void UpdateJob(Job jobDto, IEnumerable<Guid> resourceIds);
|
---|
93 |
|
---|
94 | [OperationContract]
|
---|
95 | void UpdateJobState(Guid JobId, JobState jobState);
|
---|
96 |
|
---|
97 | [OperationContract]
|
---|
98 | IEnumerable<AssignedJobResource> GetAssignedResourcesForJob(Guid jobId);
|
---|
99 | #endregion
|
---|
100 |
|
---|
101 | #region JobPermission Methods
|
---|
102 | [OperationContract]
|
---|
103 | void GrantPermission(Guid jobId, Guid grantedUserId, Permission permission);
|
---|
104 |
|
---|
105 | [OperationContract]
|
---|
106 | void RevokePermission(Guid hiveExperimentId, Guid grantedUserId);
|
---|
107 |
|
---|
108 | [OperationContract]
|
---|
109 | IEnumerable<JobPermission> GetJobPermissions(Guid jobId);
|
---|
110 |
|
---|
111 | // BackwardsCompatibility3.3
|
---|
112 | #region Backwards compatible code, remove with 3.4
|
---|
113 | [OperationContract]
|
---|
114 | bool IsAllowedPrivileged(); // current user may execute privileged task
|
---|
115 | #endregion
|
---|
116 | #endregion
|
---|
117 |
|
---|
118 | #region Login Methods
|
---|
119 | [OperationContract]
|
---|
120 | void Hello(Slave slave);
|
---|
121 |
|
---|
122 | [OperationContract]
|
---|
123 | void GoodBye(Guid slaveId);
|
---|
124 | #endregion
|
---|
125 |
|
---|
126 | #region Heartbeat Methods
|
---|
127 | [OperationContract]
|
---|
128 | List<MessageContainer> Heartbeat(Heartbeat heartbeat);
|
---|
129 | #endregion
|
---|
130 |
|
---|
131 | #region Plugin Methods
|
---|
132 | [OperationContract]
|
---|
133 | Plugin GetPlugin(Guid pluginId);
|
---|
134 |
|
---|
135 | [OperationContract]
|
---|
136 | [FaultContract(typeof(PluginAlreadyExistsFault))]
|
---|
137 | Guid AddPlugin(Plugin plugin, List<PluginData> pluginData);
|
---|
138 |
|
---|
139 | [OperationContract]
|
---|
140 | IEnumerable<Plugin> GetPlugins();
|
---|
141 |
|
---|
142 | [OperationContract]
|
---|
143 | IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds);
|
---|
144 | #endregion
|
---|
145 |
|
---|
146 | #region Project Methods
|
---|
147 | [OperationContract]
|
---|
148 | Guid AddProject(Project projectDto);
|
---|
149 |
|
---|
150 | [OperationContract]
|
---|
151 | void UpdateProject(Project projectDto);
|
---|
152 |
|
---|
153 | [OperationContract]
|
---|
154 | void DeleteProject(Guid projectId);
|
---|
155 |
|
---|
156 | [OperationContract]
|
---|
157 | Project GetProject(Guid projectId);
|
---|
158 |
|
---|
159 | [OperationContract]
|
---|
160 | IEnumerable<Project> GetProjects();
|
---|
161 |
|
---|
162 | [OperationContract]
|
---|
163 | IEnumerable<Project> GetProjectsForAdministration();
|
---|
164 | #endregion
|
---|
165 |
|
---|
166 | #region ProjectPermission Methods
|
---|
167 | [OperationContract]
|
---|
168 | void SaveProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool reassign, bool cascading, bool reassignCascading);
|
---|
169 |
|
---|
170 | [OperationContract]
|
---|
171 | void GrantProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading);
|
---|
172 |
|
---|
173 | [OperationContract]
|
---|
174 | void RevokeProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading);
|
---|
175 |
|
---|
176 | [OperationContract]
|
---|
177 | IEnumerable<ProjectPermission> GetProjectPermissions(Guid projectId);
|
---|
178 | #endregion
|
---|
179 |
|
---|
180 | #region AssignedProjectResource Methods
|
---|
181 | [OperationContract]
|
---|
182 | void SaveProjectResourceAssignments(Guid projectId, List<Guid> resourceIds, bool reassign, bool cascading, bool reassignCascading);
|
---|
183 |
|
---|
184 | [OperationContract]
|
---|
185 | void AssignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading);
|
---|
186 |
|
---|
187 | [OperationContract]
|
---|
188 | void UnassignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading);
|
---|
189 |
|
---|
190 | [OperationContract]
|
---|
191 | IEnumerable<AssignedProjectResource> GetAssignedResourcesForProject(Guid projectId);
|
---|
192 |
|
---|
193 | [OperationContract]
|
---|
194 | IEnumerable<AssignedProjectResource> GetAssignedResourcesForProjectAdministration(Guid projectId);
|
---|
195 | #endregion
|
---|
196 |
|
---|
197 | #region Slave Methods
|
---|
198 | [OperationContract]
|
---|
199 | Guid AddSlave(Slave slave);
|
---|
200 |
|
---|
201 | [OperationContract]
|
---|
202 | Guid AddSlaveGroup(SlaveGroup slaveGroup);
|
---|
203 |
|
---|
204 | [OperationContract]
|
---|
205 | Slave GetSlave(Guid slaveId);
|
---|
206 |
|
---|
207 | [OperationContract]
|
---|
208 | IEnumerable<Slave> GetSlaves();
|
---|
209 |
|
---|
210 | [OperationContract]
|
---|
211 | IEnumerable<SlaveGroup> GetSlaveGroups();
|
---|
212 |
|
---|
213 | [OperationContract]
|
---|
214 | void UpdateSlave(Slave slave);
|
---|
215 |
|
---|
216 | [OperationContract]
|
---|
217 | void UpdateSlaveGroup(SlaveGroup slaveGroup);
|
---|
218 |
|
---|
219 | [OperationContract]
|
---|
220 | void DeleteSlave(Guid slaveId);
|
---|
221 |
|
---|
222 | [OperationContract]
|
---|
223 | void DeleteSlaveGroup(Guid slaveGroupId);
|
---|
224 |
|
---|
225 | [OperationContract]
|
---|
226 | void AddResourceToGroup(Guid slaveGroupId, Guid resourceId);
|
---|
227 |
|
---|
228 | [OperationContract]
|
---|
229 | void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId);
|
---|
230 |
|
---|
231 | [OperationContract]
|
---|
232 | Guid GetResourceId(string resourceName);
|
---|
233 |
|
---|
234 | [OperationContract]
|
---|
235 | void TriggerEventManager(bool force);
|
---|
236 |
|
---|
237 | [OperationContract]
|
---|
238 | int GetNewHeartbeatInterval(Guid slaveId);
|
---|
239 | #endregion
|
---|
240 |
|
---|
241 | #region Downtime Methods
|
---|
242 | [OperationContract]
|
---|
243 | Guid AddDowntime(Downtime downtime);
|
---|
244 |
|
---|
245 | [OperationContract]
|
---|
246 | void DeleteDowntime(Guid downtimeId);
|
---|
247 |
|
---|
248 | [OperationContract]
|
---|
249 | void UpdateDowntime(Downtime downtimeDto);
|
---|
250 |
|
---|
251 | [OperationContract]
|
---|
252 | IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId);
|
---|
253 | #endregion
|
---|
254 |
|
---|
255 | #region User Methods
|
---|
256 | [OperationContract]
|
---|
257 | string GetUsernameByUserId(Guid userId);
|
---|
258 |
|
---|
259 | [OperationContract]
|
---|
260 | Guid GetUserIdByUsername(string username);
|
---|
261 |
|
---|
262 | [OperationContract]
|
---|
263 | Dictionary<Guid, HashSet<Guid>> GetUserGroupTree();
|
---|
264 | #endregion
|
---|
265 |
|
---|
266 | #region UserPriorities Methods
|
---|
267 | [OperationContract]
|
---|
268 | IEnumerable<UserPriority> GetUserPriorities();
|
---|
269 | #endregion
|
---|
270 | }
|
---|
271 | }
|
---|