source: trunk/sources/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs @ 12878

Last change on this file since 12878 was 12878, checked in by ascheibe, 6 years ago

#2388 merged hive statistics branch into trunk

File size: 5.8 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  public interface IHiveService {
32    #region Task Methods
33    [OperationContract]
34    Guid AddTask(Task task, TaskData taskData, IEnumerable<Guid> resourceIds);
35
36    [OperationContract]
37    Guid AddChildTask(Guid parentTaskId, Task task, TaskData taskData);
38
39    [OperationContract]
40    Task GetTask(Guid taskId);
41
42    [OperationContract]
43    IEnumerable<LightweightTask> GetLightweightJobTasks(Guid jobId);
44
45    [OperationContract]
46    IEnumerable<LightweightTask> GetLightweightJobTasksWithoutStateLog(Guid jobId);
47
48    [OperationContract]
49    TaskData GetTaskData(Guid taskId);
50
51    [OperationContract]
52    void UpdateTask(Task taskDto);
53
54    [OperationContract]
55    void UpdateTaskData(Task taskDto, TaskData taskDataDto);
56
57    [OperationContract]
58    Task UpdateTaskState(Guid taskId, TaskState taskState, Guid? slaveId, Guid? userId, string exception);
59    #endregion
60
61    #region Task Control Methods
62    [OperationContract]
63    void StopTask(Guid taskId);
64
65    [OperationContract]
66    void PauseTask(Guid taskId);
67
68    [OperationContract]
69    void RestartTask(Guid taskId);
70    #endregion
71
72    #region Job Methods
73    [OperationContract]
74    Job GetJob(Guid id);
75
76    [OperationContract]
77    IEnumerable<Job> GetJobs();
78
79    [OperationContract]
80    Guid AddJob(Job jobDto);
81
82    [OperationContract]
83    void UpdateJob(Job jobDto);
84
85    [OperationContract]
86    void DeleteJob(Guid JobId);
87    #endregion
88
89    #region JobPermission Methods
90    [OperationContract]
91    void GrantPermission(Guid jobId, Guid grantedUserId, Permission permission);
92
93    [OperationContract]
94    void RevokePermission(Guid hiveExperimentId, Guid grantedUserId);
95
96    [OperationContract]
97    IEnumerable<JobPermission> GetJobPermissions(Guid jobId);
98
99    [OperationContract]
100    bool IsAllowedPrivileged(); // current user may execute privileged task
101    #endregion
102
103    #region Login Methods
104    [OperationContract]
105    void Hello(Slave slave);
106
107    [OperationContract]
108    void GoodBye(Guid slaveId);
109    #endregion
110
111    #region Heartbeat Methods
112    [OperationContract]
113    List<MessageContainer> Heartbeat(Heartbeat heartbeat);
114    #endregion
115
116    #region Plugin Methods
117    [OperationContract]
118    Plugin GetPlugin(Guid pluginId);
119
120    [OperationContract]
121    [FaultContract(typeof(PluginAlreadyExistsFault))]
122    Guid AddPlugin(Plugin plugin, List<PluginData> pluginData);
123
124    [OperationContract]
125    IEnumerable<Plugin> GetPlugins();
126
127    [OperationContract]
128    IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds);
129    #endregion
130
131    #region ResourcePermission Methods
132    [OperationContract]
133    void GrantResourcePermissions(Guid resourceId, Guid[] grantedUserIds);
134
135    [OperationContract]
136    void RevokeResourcePermissions(Guid resourceId, Guid[] grantedUserIds);
137
138    [OperationContract]
139    IEnumerable<ResourcePermission> GetResourcePermissions(Guid resourceId);
140    #endregion
141
142    #region Slave Methods
143    [OperationContract]
144    Guid AddSlave(Slave slave);
145
146    [OperationContract]
147    Guid AddSlaveGroup(SlaveGroup slaveGroup);
148
149    [OperationContract]
150    Slave GetSlave(Guid slaveId);
151
152    [OperationContract]
153    IEnumerable<Slave> GetSlaves();
154
155    [OperationContract]
156    IEnumerable<SlaveGroup> GetSlaveGroups();
157
158    [OperationContract]
159    void UpdateSlave(Slave slave);
160
161    [OperationContract]
162    void UpdateSlaveGroup(SlaveGroup slaveGroup);
163
164    [OperationContract]
165    void DeleteSlave(Guid slaveId);
166
167    [OperationContract]
168    void DeleteSlaveGroup(Guid slaveGroupId);
169
170    [OperationContract]
171    void AddResourceToGroup(Guid slaveGroupId, Guid resourceId);
172
173    [OperationContract]
174    void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId);
175
176    [OperationContract]
177    Guid GetResourceId(string resourceName);
178
179    [OperationContract]
180    void TriggerEventManager(bool force);
181
182    [OperationContract]
183    int GetNewHeartbeatInterval(Guid slaveId);
184    #endregion
185
186    #region Downtime Methods
187    [OperationContract]
188    Guid AddDowntime(Downtime downtime);
189
190    [OperationContract]
191    void DeleteDowntime(Guid downtimeId);
192
193    [OperationContract]
194    void UpdateDowntime(Downtime downtimeDto);
195
196    [OperationContract]
197    IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId);
198    #endregion
199
200    #region User Methods
201    [OperationContract]
202    string GetUsernameByUserId(Guid userId);
203
204    [OperationContract]
205    Guid GetUserIdByUsername(string username);
206    #endregion
207
208    #region UserPriorities Methods
209    [OperationContract]
210    IEnumerable<UserPriority> GetUserPriorities();
211    #endregion
212  }
213}
Note: See TracBrowser for help on using the repository browser.