Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs @ 15354

Last change on this file since 15354 was 14186, checked in by swagner, 8 years ago

#2526: Updated year of copyrights in license headers

File size: 5.9 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    [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    // BackwardsCompatibility3.3
100    #region Backwards compatible code, remove with 3.4
101    [OperationContract]
102    bool IsAllowedPrivileged(); // current user may execute privileged task
103    #endregion
104    #endregion
105
106    #region Login Methods
107    [OperationContract]
108    void Hello(Slave slave);
109
110    [OperationContract]
111    void GoodBye(Guid slaveId);
112    #endregion
113
114    #region Heartbeat Methods
115    [OperationContract]
116    List<MessageContainer> Heartbeat(Heartbeat heartbeat);
117    #endregion
118
119    #region Plugin Methods
120    [OperationContract]
121    Plugin GetPlugin(Guid pluginId);
122
123    [OperationContract]
124    [FaultContract(typeof(PluginAlreadyExistsFault))]
125    Guid AddPlugin(Plugin plugin, List<PluginData> pluginData);
126
127    [OperationContract]
128    IEnumerable<Plugin> GetPlugins();
129
130    [OperationContract]
131    IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds);
132    #endregion
133
134    #region ResourcePermission Methods
135    [OperationContract]
136    void GrantResourcePermissions(Guid resourceId, Guid[] grantedUserIds);
137
138    [OperationContract]
139    void RevokeResourcePermissions(Guid resourceId, Guid[] grantedUserIds);
140
141    [OperationContract]
142    IEnumerable<ResourcePermission> GetResourcePermissions(Guid resourceId);
143    #endregion
144
145    #region Slave Methods
146    [OperationContract]
147    Guid AddSlave(Slave slave);
148
149    [OperationContract]
150    Guid AddSlaveGroup(SlaveGroup slaveGroup);
151
152    [OperationContract]
153    Slave GetSlave(Guid slaveId);
154
155    [OperationContract]
156    IEnumerable<Slave> GetSlaves();
157
158    [OperationContract]
159    IEnumerable<SlaveGroup> GetSlaveGroups();
160
161    [OperationContract]
162    void UpdateSlave(Slave slave);
163
164    [OperationContract]
165    void UpdateSlaveGroup(SlaveGroup slaveGroup);
166
167    [OperationContract]
168    void DeleteSlave(Guid slaveId);
169
170    [OperationContract]
171    void DeleteSlaveGroup(Guid slaveGroupId);
172
173    [OperationContract]
174    void AddResourceToGroup(Guid slaveGroupId, Guid resourceId);
175
176    [OperationContract]
177    void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId);
178
179    [OperationContract]
180    Guid GetResourceId(string resourceName);
181
182    [OperationContract]
183    void TriggerEventManager(bool force);
184
185    [OperationContract]
186    int GetNewHeartbeatInterval(Guid slaveId);
187    #endregion
188
189    #region Downtime Methods
190    [OperationContract]
191    Guid AddDowntime(Downtime downtime);
192
193    [OperationContract]
194    void DeleteDowntime(Guid downtimeId);
195
196    [OperationContract]
197    void UpdateDowntime(Downtime downtimeDto);
198
199    [OperationContract]
200    IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId);
201    #endregion
202
203    #region User Methods
204    [OperationContract]
205    string GetUsernameByUserId(Guid userId);
206
207    [OperationContract]
208    Guid GetUserIdByUsername(string username);
209    #endregion
210
211    #region UserPriorities Methods
212    [OperationContract]
213    IEnumerable<UserPriority> GetUserPriorities();
214    #endregion
215  }
216}
Note: See TracBrowser for help on using the repository browser.