Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs @ 6743

Last change on this file since 6743 was 6743, checked in by ascheibe, 13 years ago

#1233

  • fixed a bug in the Slave UI
  • finished renaming Webservice and Dao methods to be consistent with Job/Task naming
  • some cosmetic changes and project dependencies cleanups
File size: 6.1 KB
RevLine 
[6431]1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2011 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;
[4593]23using System.Collections.Generic;
[5375]24using System.Net.Security;
[4593]25using System.ServiceModel;
[6717]26using HeuristicLab.Services.Hive.DataTransfer;
[4593]27
[6717]28namespace HeuristicLab.Services.Hive.ServiceContracts {
[4629]29
30  [ServiceContract(ProtectionLevel = ProtectionLevel.EncryptAndSign)]
[4593]31  public interface IHiveService {
32
[6725]33    #region Task Methods
[4593]34    [OperationContract]
[6743]35    Guid AddTask(Task task, TaskData taskData, IEnumerable<Guid> resourceIds);
[4598]36
[4593]37    [OperationContract]
[6743]38    Guid AddChildTask(Guid parentTaskId, Task task, TaskData taskData);
[4598]39
[6717]40    [OperationContract]
[6743]41    Task GetTask(Guid taskId);
[4598]42
[6717]43    [OperationContract]
[6743]44    IEnumerable<Task> GetTasks();
[4598]45
[6717]46    [OperationContract]
[6743]47    IEnumerable<LightweightTask> GetLightweightTasks(IEnumerable<Guid> taskIds);
[4598]48
[6717]49    [OperationContract]
[6743]50    IEnumerable<LightweightTask> GetLightweightChildTasks(Guid? parentTaskId, bool recursive, bool includeParent);
[4598]51
[6717]52    [OperationContract]
[6743]53    IEnumerable<LightweightTask> GetLightweightJobTasks(Guid jobId);
[6006]54
55    [OperationContract]
[6743]56    TaskData GetTaskData(Guid taskId);
[4598]57
[4593]58    [OperationContract]
[6743]59    void UpdateTask(Task taskDto);
[5602]60
[5511]61    [OperationContract]
[6743]62    void UpdateTaskData(Task taskDto, TaskData taskDataDto);
[4598]63
[4593]64    [OperationContract]
[6743]65    void DeleteTask(Guid taskId);
[5106]66
67    [OperationContract]
[6743]68    void DeleteChildTasks(Guid parentTaskId);
[5636]69
70    [OperationContract]
[6743]71    Task UpdateTaskState(Guid taskId, TaskState taskState, Guid? slaveId, Guid? userId, string exception);
[4598]72    #endregion
73
[6743]74    #region Task Control Methods
[4593]75    [OperationContract]
[6743]76    void StopTask(Guid taskId);
[4598]77
78    [OperationContract]
[6743]79    void PauseTask(Guid taskId);
[5779]80
81    [OperationContract]
[6743]82    void RestartTask(Guid taskId);
[4593]83    #endregion
84
[6725]85    #region Job Methods
[4629]86    [OperationContract]
[6743]87    Job GetJob(Guid id);
[4629]88
[4593]89    /// <summary>
[6743]90    /// Returns all task for the current user
[4593]91    /// </summary>
92    [OperationContract]
[6743]93    IEnumerable<Job> GetJobs();
[4598]94
[5602]95    /// <summary>
[6743]96    /// Returns all task in the hive (only for admins)
[5602]97    /// </summary>
98    /// <returns></returns>
[4593]99    [OperationContract]
[6743]100    IEnumerable<Job> GetAllJobs();
[5602]101
102    [OperationContract]
[6743]103    Guid AddJob(Job jobDto);
[4629]104
105    [OperationContract]
[6743]106    void UpdateJob(Job jobDto);
[4598]107
[4593]108    [OperationContract]
[6743]109    void DeleteJob(Guid JobId);
[4593]110    #endregion
111
[6743]112    #region JobPermission Methods
[6463]113    [OperationContract]
[6743]114    void GrantPermission(Guid jobId, Guid grantedUserId, Permission permission);
[6463]115
116    [OperationContract]
[6457]117    void RevokePermission(Guid hiveExperimentId, Guid grantedUserId);
[6463]118
119    [OperationContract]
[6743]120    IEnumerable<JobPermission> GetJobPermissions(Guid jobId);
[6479]121
122    [OperationContract]
[6743]123    bool IsAllowedPrivileged(); // current user may execute privileged task
[6457]124    #endregion
125
[4593]126    #region Login Methods
[5053]127    [OperationContract]
[5405]128    void Hello(Slave slave);
[5053]129
130    [OperationContract]
[5375]131    void GoodBye(Guid slaveId);
[4593]132    #endregion
133
134    #region Heartbeat Methods
135    [OperationContract]
[5053]136    List<MessageContainer> Heartbeat(Heartbeat heartbeat);
[4593]137    #endregion
138
139    #region Plugin Methods
140    [OperationContract]
[6000]141    Plugin GetPlugin(Guid pluginId);
[6743]142
[6000]143    [OperationContract]
[6452]144    Plugin GetPluginByHash(byte[] hash);
[6743]145
[6452]146    [OperationContract]
[6000]147    [FaultContract(typeof(PluginAlreadyExistsFault))]
[4905]148    Guid AddPlugin(Plugin plugin, List<PluginData> pluginData);
[6743]149
[4593]150    [OperationContract]
[5053]151    IEnumerable<Plugin> GetPlugins();
[6743]152
[4593]153    [OperationContract]
[5053]154    IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds);
[6743]155
[6452]156    [OperationContract]
157    void DeletePlugin(Guid pluginId);
[4593]158    #endregion
[5375]159
[4593]160    #region Slave Methods
161    [OperationContract]
[4649]162    Guid AddSlave(Slave slave);
163
164    [OperationContract]
[4598]165    Guid AddSlaveGroup(SlaveGroup slaveGroup);
166
[4593]167    [OperationContract]
[5106]168    Slave GetSlave(Guid slaveId);
169
170    [OperationContract]
171    SlaveGroup GetSlaveGroup(Guid slaveGroupId);
172
173    [OperationContract]
[4598]174    IEnumerable<Slave> GetSlaves();
[5106]175
[4593]176    [OperationContract]
[4598]177    IEnumerable<SlaveGroup> GetSlaveGroups();
178
[4593]179    [OperationContract]
[5106]180    void UpdateSlave(Slave slave);
[4598]181
[4593]182    [OperationContract]
[5106]183    void UpdateSlaveGroup(SlaveGroup slaveGroup);
[4598]184
[4593]185    [OperationContract]
[5106]186    void DeleteSlave(Guid slaveId);
187
188    [OperationContract]
189    void DeleteSlaveGroup(Guid slaveGroupId);
190
191    [OperationContract]
192    void AddResourceToGroup(Guid slaveGroupId, Guid resourceId);
193
194    [OperationContract]
[4598]195    void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId);
[4629]196
[5458]197    [OperationContract]
198    Guid GetResourceId(string resourceName);
199
[5593]200    [OperationContract]
[6743]201    IEnumerable<Task> GetTasksByResourceId(Guid resourceId);
[6267]202
203    [OperationContract]
[6698]204    void TriggerEventManager(bool force);
[4593]205    #endregion
[5101]206
[6452]207    #region Downtime Methods
[5633]208    [OperationContract]
[6452]209    Guid AddDowntime(Downtime downtime);
[5633]210
211    [OperationContract]
[6452]212    void DeleteDowntime(Guid downtimeId);
[5633]213
214    [OperationContract]
[6452]215    void UpdateDowntime(Downtime downtime);
[5633]216
217    [OperationContract]
[6452]218    IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId);
[5633]219    #endregion
[6457]220
[6463]221    #region User Methods
222    [OperationContract]
223    string GetUsernameByUserId(Guid userId);
224
225    [OperationContract]
226    Guid GetUserIdByUsername(string username);
227    #endregion
[4593]228  }
229}
Note: See TracBrowser for help on using the repository browser.