Exemplo n.º 1
0
		public object Post (DtoNode req)
		{
			Scheduler.AddNode (req.address, req.port);
			return new HttpResult {StatusCode = HttpStatusCode.Created};/*
			if (Scheduler.aGetNodes ().Contains (req)) {
				Console.WriteLine ("Taki już jest");
				return new HttpResult { StatusCode = HttpStatusCode.Conflict };
			}
			else {
				Scheduler.AddNode (req.address, req.port);
				return new HttpResult {StatusCode = HttpStatusCode.Created};
			}*/
		}
Exemplo n.º 2
0
		public object Delete (DtoNode req) 
		{
			string[] temp = req.id.Split ('_');
			Scheduler.RemoveNode (temp[0], int.Parse(temp[1]));
			return new HttpResult { StatusCode = HttpStatusCode.OK };/*
			if (Scheduler.aGetNodes ().Find(p => p.id == req.id) != null) {
				Scheduler.RemoveNode (req.address, req.port);
				return new HttpResult { StatusCode = HttpStatusCode.OK };
			}
			else {
				Console.WriteLine ("Nie ma takiego");
				return new HttpResult {StatusCode = HttpStatusCode.Conflict};
			}*/
		}
Exemplo n.º 3
0
		public object Get (DtoNode req)
		{
			return new DtoNodeResponse (Scheduler.aGetNodes());
		}