コード例 #1
0
        public async Task <Operation> AddPermitted(RequesterAccessListBusinessModel vm)
        {
            return(await ExecuteAction(async() =>
            {
                var ip = await _cloudPlugin.GetNodeIP(vm.Account);

                var result = await Fetch.PostAsync(String.Format(ip + Resources.AddPermitted, vm.toAdd.account, vm.toAdd.PublicKey));
                var ResponseString = JsonStringNavigator.GetDeeper(result, "succeeded");
                if (!(ResponseString == "true"))
                {
                    throw new Exception("Fetch Failed");
                }
            }));
        }
コード例 #2
0
 public async Task <OperationResult <RequesterAccessListBusinessModel> > GetRequesterAccess(string node)
 {
     return(await ExecuteFunction <RequesterAccessListBusinessModel>(async() =>
     {
         var ip = await _cloudPlugin.GetNodeIP(node);
         var businessModel = new RequesterAccessListBusinessModel()
         {
             Account = node, Ip = ip
         };
         var reservedJson = await Fetch.GetAsync(ip + Resources.ReservedSeats);
         var reservedResponseString = JsonStringNavigator.GetDeeper(reservedJson, "response");
         businessModel.Reserved = JsonStringNavigator.GetValue <List <NodeAccType> >(reservedResponseString);
         return businessModel;
     }));
 }
コード例 #3
0
 public async Task <Operation> AddReservedSeat(RequesterAccessListBusinessModel vm)
 {
     return(await ExecuteAction(async() =>
     {
         var ip = await _cloudPlugin.GetNodeIP(vm.Account);
         var json = new List <NodeAccType>()
         {
             vm.toAdd
         };
         var body = JsonConvert.SerializeObject(json);
         var result = await Fetch.PostAsync(ip + Resources.AddReservedSeat, body);
         var ResponseString = JsonStringNavigator.GetDeeper(result, "succeeded");
         if (!(ResponseString == "true"))
         {
             throw new Exception("Fetch Failed");
         }
     }));
 }