source: branches/2839_HiveProjectManagement/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs @ 15913

Last change on this file since 15913 was 15913, checked in by jzenisek, 4 years ago

#2839: updated genealogy computation for hive job administrator

File size: 8.0 KB
Line 
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
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  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, IEnumerable<Guid> resourceIds);
82
83    [OperationContract]
84    void UpdateJob(Job jobDto, IEnumerable<Guid> resourceIds);
85
86    [OperationContract]
87    void UpdateJobState(Guid JobId, JobState jobState);
88
89    [OperationContract]
90    IEnumerable<AssignedJobResource> GetAssignedResourcesForJob(Guid jobId);
91    #endregion
92
93    #region JobPermission Methods
94    [OperationContract]
95    void GrantPermission(Guid jobId, Guid grantedUserId, Permission permission);
96
97    [OperationContract]
98    void RevokePermission(Guid hiveExperimentId, Guid grantedUserId);
99
100    [OperationContract]
101    IEnumerable<JobPermission> GetJobPermissions(Guid jobId);
102
103    // BackwardsCompatibility3.3
104    #region Backwards compatible code, remove with 3.4
105    [OperationContract]
106    bool IsAllowedPrivileged(); // current user may execute privileged task
107    #endregion
108    #endregion
109
110    #region Login Methods
111    [OperationContract]
112    void Hello(Slave slave);
113
114    [OperationContract]
115    void GoodBye(Guid slaveId);
116    #endregion
117
118    #region Heartbeat Methods
119    [OperationContract]
120    List<MessageContainer> Heartbeat(Heartbeat heartbeat);
121    #endregion
122
123    #region Plugin Methods
124    [OperationContract]
125    Plugin GetPlugin(Guid pluginId);
126
127    [OperationContract]
128    [FaultContract(typeof(PluginAlreadyExistsFault))]
129    Guid AddPlugin(Plugin plugin, List<PluginData> pluginData);
130
131    [OperationContract]
132    IEnumerable<Plugin> GetPlugins();
133
134    [OperationContract]
135    IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds);
136    #endregion
137
138    #region Project Methods
139    [OperationContract]
140    Guid AddProject(Project projectDto);
141
142    [OperationContract]
143    void UpdateProject(Project projectDto);
144
145    [OperationContract]
146    void DeleteProject(Guid projectId);
147
148    [OperationContract]
149    Project GetProject(Guid projectId);
150
151    [OperationContract]
152    IEnumerable<Project> GetProjects();
153
154    [OperationContract]
155    IEnumerable<Project> GetProjectsForAdministration();
156
157    [OperationContract]
158    IDictionary<Guid, HashSet<Guid>> GetProjectGenealogy();
159    #endregion
160
161    #region ProjectPermission Methods
162    [OperationContract]
163    void SaveProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool reassign, bool cascading, bool reassignCascading);
164
165    //[OperationContract]
166    //void GrantProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading);
167
168    //[OperationContract]
169    //void RevokeProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading);
170
171    [OperationContract]
172    IEnumerable<ProjectPermission> GetProjectPermissions(Guid projectId);
173    #endregion
174
175    #region AssignedProjectResource Methods
176    [OperationContract]
177    void SaveProjectResourceAssignments(Guid projectId, List<Guid> resourceIds, bool reassign, bool cascading, bool reassignCascading);
178
179    //[OperationContract]
180    //void AssignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading);
181
182    //[OperationContract]
183    //void UnassignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading);
184
185    [OperationContract]
186    IEnumerable<AssignedProjectResource> GetAssignedResourcesForProject(Guid projectId);
187
188    [OperationContract]
189    IEnumerable<AssignedProjectResource> GetAssignedResourcesForProjectAdministration(Guid projectId);
190
191    [OperationContract]
192    IEnumerable<AssignedProjectResource> GetAssignedResourcesForProjectsAdministration(IEnumerable<Guid> projectIds);
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    IDictionary<Guid, HashSet<Guid>> GetResourceGenealogy();
219
220    [OperationContract]
221    void UpdateSlave(Slave slave);
222
223    [OperationContract]
224    void UpdateSlaveGroup(SlaveGroup slaveGroup);
225
226    [OperationContract]
227    void DeleteSlave(Guid slaveId);
228
229    [OperationContract]
230    void DeleteSlaveGroup(Guid slaveGroupId);
231
232    [OperationContract]
233    void AddResourceToGroup(Guid slaveGroupId, Guid resourceId);
234
235    [OperationContract]
236    void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId);
237
238    [OperationContract]
239    Guid GetResourceId(string resourceName);
240
241    [OperationContract]
242    void TriggerEventManager(bool force);
243
244    [OperationContract]
245    int GetNewHeartbeatInterval(Guid slaveId);
246    #endregion
247
248    #region Downtime Methods
249    [OperationContract]
250    Guid AddDowntime(Downtime downtime);
251
252    [OperationContract]
253    void DeleteDowntime(Guid downtimeId);
254
255    [OperationContract]
256    void UpdateDowntime(Downtime downtimeDto);
257
258    [OperationContract]
259    IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId);
260    #endregion
261
262    #region User Methods
263    [OperationContract]
264    string GetUsernameByUserId(Guid userId);
265
266    [OperationContract]
267    Guid GetUserIdByUsername(string username);
268
269    [OperationContract]
270    Dictionary<Guid, HashSet<Guid>> GetUserGroupTree();
271
272    [OperationContract]
273    bool CheckAccessToAdminAreaGranted();
274    #endregion
275
276    #region UserPriorities Methods
277    [OperationContract]
278    IEnumerable<UserPriority> GetUserPriorities();
279    #endregion
280  }
281}
Note: See TracBrowser for help on using the repository browser.