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 |
|
---|
22 | using System;
|
---|
23 | using System.Collections.Generic;
|
---|
24 | using System.Net.Security;
|
---|
25 | using System.ServiceModel;
|
---|
26 | using HeuristicLab.Services.Hive.Common.DataTransfer;
|
---|
27 |
|
---|
28 | namespace HeuristicLab.Services.Hive.Common.ServiceContracts {
|
---|
29 |
|
---|
30 | [ServiceContract(ProtectionLevel = ProtectionLevel.EncryptAndSign)]
|
---|
31 | public interface IHiveService {
|
---|
32 |
|
---|
33 | #region Job Methods
|
---|
34 | [OperationContract]
|
---|
35 | Guid AddJob(Job job, JobData jobData, IEnumerable<Guid> resourceIds);
|
---|
36 |
|
---|
37 | [OperationContract]
|
---|
38 | Guid AddChildJob(Guid parentJobId, Job job, JobData jobData);
|
---|
39 |
|
---|
40 | [OperationContract]
|
---|
41 | Job GetJob(Guid jobId);
|
---|
42 |
|
---|
43 | [OperationContract]
|
---|
44 | IEnumerable<Job> GetJobs();
|
---|
45 |
|
---|
46 | [OperationContract]
|
---|
47 | IEnumerable<LightweightJob> GetLightweightJobs(IEnumerable<Guid> jobIds);
|
---|
48 |
|
---|
49 | [OperationContract]
|
---|
50 | IEnumerable<LightweightJob> GetLightweightChildJobs(Guid? parentJobId, bool recursive, bool includeParent);
|
---|
51 |
|
---|
52 | [OperationContract]
|
---|
53 | IEnumerable<LightweightJob> GetLightweightExperimentJobs(Guid experimentId);
|
---|
54 |
|
---|
55 | [OperationContract]
|
---|
56 | JobData GetJobData(Guid jobId);
|
---|
57 |
|
---|
58 | [OperationContract]
|
---|
59 | void UpdateJob(Job jobDto);
|
---|
60 |
|
---|
61 | [OperationContract]
|
---|
62 | void UpdateJobData(Job jobDto, JobData jobDataDto);
|
---|
63 |
|
---|
64 | [OperationContract]
|
---|
65 | void DeleteJob(Guid jobId);
|
---|
66 |
|
---|
67 | [OperationContract]
|
---|
68 | void DeleteChildJobs(Guid parentJobId);
|
---|
69 |
|
---|
70 | [OperationContract]
|
---|
71 | Job UpdateJobState(Guid jobId, JobState jobState, Guid? slaveId, Guid? userId, string exception);
|
---|
72 | #endregion
|
---|
73 |
|
---|
74 | #region Job Control Methods
|
---|
75 | [OperationContract]
|
---|
76 | void StopJob(Guid jobId);
|
---|
77 |
|
---|
78 | [OperationContract]
|
---|
79 | void PauseJob(Guid jobId);
|
---|
80 |
|
---|
81 | [OperationContract]
|
---|
82 | void RestartJob(Guid jobId);
|
---|
83 | #endregion
|
---|
84 |
|
---|
85 | #region HiveExperiment Methods
|
---|
86 | [OperationContract]
|
---|
87 | HiveExperiment GetHiveExperiment(Guid id);
|
---|
88 |
|
---|
89 | /// <summary>
|
---|
90 | /// Returns all experiments for the current user
|
---|
91 | /// </summary>
|
---|
92 | [OperationContract]
|
---|
93 | IEnumerable<HiveExperiment> GetHiveExperiments();
|
---|
94 |
|
---|
95 | /// <summary>
|
---|
96 | /// Returns all experiments in the hive (only for admins)
|
---|
97 | /// </summary>
|
---|
98 | /// <returns></returns>
|
---|
99 | [OperationContract]
|
---|
100 | IEnumerable<HiveExperiment> GetAllHiveExperiments();
|
---|
101 |
|
---|
102 | [OperationContract]
|
---|
103 | Guid AddHiveExperiment(HiveExperiment hiveExperimentDto);
|
---|
104 |
|
---|
105 | [OperationContract]
|
---|
106 | void UpdateHiveExperiment(HiveExperiment hiveExperimentDto);
|
---|
107 |
|
---|
108 | [OperationContract]
|
---|
109 | void DeleteHiveExperiment(Guid hiveExperimentId);
|
---|
110 | #endregion
|
---|
111 |
|
---|
112 | #region Login Methods
|
---|
113 | [OperationContract]
|
---|
114 | void Hello(Slave slave);
|
---|
115 |
|
---|
116 | [OperationContract]
|
---|
117 | void GoodBye(Guid slaveId);
|
---|
118 | #endregion
|
---|
119 |
|
---|
120 | #region Heartbeat Methods
|
---|
121 | [OperationContract]
|
---|
122 | List<MessageContainer> Heartbeat(Heartbeat heartbeat);
|
---|
123 | #endregion
|
---|
124 |
|
---|
125 | #region Plugin Methods
|
---|
126 | [OperationContract]
|
---|
127 | Plugin GetPlugin(Guid pluginId);
|
---|
128 | [OperationContract]
|
---|
129 | Plugin GetPluginByHash(byte[] hash);
|
---|
130 | [OperationContract]
|
---|
131 | [FaultContract(typeof(PluginAlreadyExistsFault))]
|
---|
132 | Guid AddPlugin(Plugin plugin, List<PluginData> pluginData);
|
---|
133 | [OperationContract]
|
---|
134 | IEnumerable<Plugin> GetPlugins();
|
---|
135 | [OperationContract]
|
---|
136 | IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds);
|
---|
137 | [OperationContract]
|
---|
138 | void DeletePlugin(Guid pluginId);
|
---|
139 | #endregion
|
---|
140 |
|
---|
141 | #region Slave Methods
|
---|
142 | [OperationContract]
|
---|
143 | Guid AddSlave(Slave slave);
|
---|
144 |
|
---|
145 | [OperationContract]
|
---|
146 | Guid AddSlaveGroup(SlaveGroup slaveGroup);
|
---|
147 |
|
---|
148 | [OperationContract]
|
---|
149 | Slave GetSlave(Guid slaveId);
|
---|
150 |
|
---|
151 | [OperationContract]
|
---|
152 | SlaveGroup GetSlaveGroup(Guid slaveGroupId);
|
---|
153 |
|
---|
154 | [OperationContract]
|
---|
155 | IEnumerable<Slave> GetSlaves();
|
---|
156 |
|
---|
157 | [OperationContract]
|
---|
158 | IEnumerable<SlaveGroup> GetSlaveGroups();
|
---|
159 |
|
---|
160 | [OperationContract]
|
---|
161 | void UpdateSlave(Slave slave);
|
---|
162 |
|
---|
163 | [OperationContract]
|
---|
164 | void UpdateSlaveGroup(SlaveGroup slaveGroup);
|
---|
165 |
|
---|
166 | [OperationContract]
|
---|
167 | void DeleteSlave(Guid slaveId);
|
---|
168 |
|
---|
169 | [OperationContract]
|
---|
170 | void DeleteSlaveGroup(Guid slaveGroupId);
|
---|
171 |
|
---|
172 | [OperationContract]
|
---|
173 | void AddResourceToGroup(Guid slaveGroupId, Guid resourceId);
|
---|
174 |
|
---|
175 | [OperationContract]
|
---|
176 | void RemoveResourceFromGroup(Guid slaveGroupId, Guid resourceId);
|
---|
177 |
|
---|
178 | [OperationContract]
|
---|
179 | Guid GetResourceId(string resourceName);
|
---|
180 |
|
---|
181 | [OperationContract]
|
---|
182 | IEnumerable<Job> GetJobsByResourceId(Guid resourceId);
|
---|
183 |
|
---|
184 | [OperationContract]
|
---|
185 | void TriggerLifecycle(bool force);
|
---|
186 | #endregion
|
---|
187 |
|
---|
188 | #region Downtime Methods
|
---|
189 | [OperationContract]
|
---|
190 | Guid AddDowntime(Downtime downtime);
|
---|
191 |
|
---|
192 | [OperationContract]
|
---|
193 | void DeleteDowntime(Guid downtimeId);
|
---|
194 |
|
---|
195 | [OperationContract]
|
---|
196 | void UpdateDowntime(Downtime downtime);
|
---|
197 |
|
---|
198 | [OperationContract]
|
---|
199 | IEnumerable<Downtime> GetDowntimesForResource(Guid resourceId);
|
---|
200 | #endregion
|
---|
201 | }
|
---|
202 | }
|
---|