source: branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs @ 15644

Last change on this file since 15644 was 15644, checked in by jzenisek, 3 years ago

#2839 removed AssignedTaskResource entity

File size: 7.6 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);
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    void UpdateSlave(Slave slave);
213
214    [OperationContract]
215    void UpdateSlaveGroup(SlaveGroup slaveGroup);
216
217    [OperationContract]
218    void DeleteSlave(Guid slaveId);
219
220    [OperationContract]
221    void DeleteSlaveGroup(Guid slaveGroupId);
222
223    [OperationContract]
224    void AddResourceToGroup(Guid slaveGroupId, Guid resourceId);
225
226    [OperationContract]
227    void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId);
228
229    [OperationContract]
230    Guid GetResourceId(string resourceName);
231
232    [OperationContract]
233    void TriggerEventManager(bool force);
234
235    [OperationContract]
236    int GetNewHeartbeatInterval(Guid slaveId);
237    #endregion
238
239    #region Downtime Methods
240    [OperationContract]
241    Guid AddDowntime(Downtime downtime);
242
243    [OperationContract]
244    void DeleteDowntime(Guid downtimeId);
245
246    [OperationContract]
247    void UpdateDowntime(Downtime downtimeDto);
248
249    [OperationContract]
250    IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId);
251    #endregion
252
253    #region User Methods
254    [OperationContract]
255    string GetUsernameByUserId(Guid userId);
256
257    [OperationContract]
258    Guid GetUserIdByUsername(string username);
259
260    [OperationContract]
261    Dictionary<Guid, HashSet<Guid>> GetUserGroupTree();
262    #endregion
263
264    #region UserPriorities Methods
265    [OperationContract]
266    IEnumerable<UserPriority> GetUserPriorities();
267    #endregion
268  }
269}
Note: See TracBrowser for help on using the repository browser.