[6983] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
[14185] | 3 | * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
[6983] | 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 |
|
---|
| 22 | using System;
|
---|
| 23 | using System.Collections.Generic;
|
---|
| 24 | using System.Net.Security;
|
---|
| 25 | using System.ServiceModel;
|
---|
| 26 | using HeuristicLab.Services.Hive.DataTransfer;
|
---|
| 27 |
|
---|
| 28 | namespace HeuristicLab.Services.Hive.ServiceContracts {
|
---|
| 29 |
|
---|
| 30 | [ServiceContract(ProtectionLevel = ProtectionLevel.EncryptAndSign)]
|
---|
| 31 | public interface IHiveService {
|
---|
| 32 | #region Task Methods
|
---|
[15628] | 33 |
|
---|
[6983] | 34 | [OperationContract]
|
---|
[15628] | 35 | Guid AddTask(Task task, TaskData taskData);
|
---|
[6983] | 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]
|
---|
[9219] | 47 | IEnumerable<LightweightTask> GetLightweightJobTasksWithoutStateLog(Guid jobId);
|
---|
| 48 |
|
---|
| 49 | [OperationContract]
|
---|
[6983] | 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]
|
---|
[15628] | 81 | Guid AddJob(Job jobDto, IEnumerable<Guid> resourceIds);
|
---|
[6983] | 82 |
|
---|
| 83 | [OperationContract]
|
---|
[15628] | 84 | void UpdateJob(Job jobDto, IEnumerable<Guid> resourceIds);
|
---|
[6983] | 85 |
|
---|
| 86 | [OperationContract]
|
---|
[15630] | 87 | void UpdateJobState(Guid JobId, JobState jobState);
|
---|
[15628] | 88 |
|
---|
| 89 | [OperationContract]
|
---|
| 90 | IEnumerable<AssignedJobResource> GetAssignedResourcesForJob(Guid jobId);
|
---|
[6983] | 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 |
|
---|
[12926] | 103 | // BackwardsCompatibility3.3
|
---|
| 104 | #region Backwards compatible code, remove with 3.4
|
---|
[6983] | 105 | [OperationContract]
|
---|
| 106 | bool IsAllowedPrivileged(); // current user may execute privileged task
|
---|
| 107 | #endregion
|
---|
[12926] | 108 | #endregion
|
---|
[6983] | 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 |
|
---|
[15379] | 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();
|
---|
[15577] | 153 |
|
---|
| 154 | [OperationContract]
|
---|
| 155 | IEnumerable<Project> GetProjectsForAdministration();
|
---|
[15913] | 156 |
|
---|
| 157 | [OperationContract]
|
---|
| 158 | IDictionary<Guid, HashSet<Guid>> GetProjectGenealogy();
|
---|
[15379] | 159 | #endregion
|
---|
| 160 |
|
---|
[15380] | 161 | #region ProjectPermission Methods
|
---|
[7916] | 162 | [OperationContract]
|
---|
[15577] | 163 | void SaveProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool reassign, bool cascading, bool reassignCascading);
|
---|
[7916] | 164 |
|
---|
[15715] | 165 | //[OperationContract]
|
---|
| 166 | //void GrantProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading);
|
---|
[7916] | 167 |
|
---|
[15715] | 168 | //[OperationContract]
|
---|
| 169 | //void RevokeProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading);
|
---|
[15577] | 170 |
|
---|
| 171 | [OperationContract]
|
---|
[15380] | 172 | IEnumerable<ProjectPermission> GetProjectPermissions(Guid projectId);
|
---|
[7916] | 173 | #endregion
|
---|
| 174 |
|
---|
[15411] | 175 | #region AssignedProjectResource Methods
|
---|
| 176 | [OperationContract]
|
---|
[15577] | 177 | void SaveProjectResourceAssignments(Guid projectId, List<Guid> resourceIds, bool reassign, bool cascading, bool reassignCascading);
|
---|
[15411] | 178 |
|
---|
[15715] | 179 | //[OperationContract]
|
---|
| 180 | //void AssignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading);
|
---|
[15411] | 181 |
|
---|
[15715] | 182 | //[OperationContract]
|
---|
| 183 | //void UnassignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading);
|
---|
[15577] | 184 |
|
---|
| 185 | [OperationContract]
|
---|
[15411] | 186 | IEnumerable<AssignedProjectResource> GetAssignedResourcesForProject(Guid projectId);
|
---|
[15628] | 187 |
|
---|
| 188 | [OperationContract]
|
---|
| 189 | IEnumerable<AssignedProjectResource> GetAssignedResourcesForProjectAdministration(Guid projectId);
|
---|
[15819] | 190 |
|
---|
| 191 | [OperationContract]
|
---|
| 192 | IEnumerable<AssignedProjectResource> GetAssignedResourcesForProjectsAdministration(IEnumerable<Guid> projectIds);
|
---|
[15411] | 193 | #endregion
|
---|
| 194 |
|
---|
[6983] | 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]
|
---|
[15658] | 212 | IEnumerable<Slave> GetSlavesForAdministration();
|
---|
| 213 |
|
---|
| 214 | [OperationContract]
|
---|
| 215 | IEnumerable<SlaveGroup> GetSlaveGroupsForAdministration();
|
---|
| 216 |
|
---|
| 217 | [OperationContract]
|
---|
[15913] | 218 | IDictionary<Guid, HashSet<Guid>> GetResourceGenealogy();
|
---|
| 219 |
|
---|
| 220 | [OperationContract]
|
---|
[6983] | 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]
|
---|
[12878] | 256 | void UpdateDowntime(Downtime downtimeDto);
|
---|
[6983] | 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);
|
---|
[15577] | 268 |
|
---|
| 269 | [OperationContract]
|
---|
| 270 | Dictionary<Guid, HashSet<Guid>> GetUserGroupTree();
|
---|
[15658] | 271 |
|
---|
| 272 | [OperationContract]
|
---|
| 273 | bool CheckAccessToAdminAreaGranted();
|
---|
[6983] | 274 | #endregion
|
---|
[9123] | 275 |
|
---|
| 276 | #region UserPriorities Methods
|
---|
| 277 | [OperationContract]
|
---|
| 278 | IEnumerable<UserPriority> GetUserPriorities();
|
---|
| 279 | #endregion
|
---|
[6983] | 280 | }
|
---|
| 281 | }
|
---|