public void PreAllocateVolumes() { var values = new PreAllocateVolumesParams(1); var result = MasterWrapper.PreAllocateVolumes(values).GetAwaiter().GetResult(); Assert.AreEqual(values.Count, result.Count); }
/// <summary> /// Pre-Allocate volumes. /// </summary> /// <param name="values"></param> /// <returns></returns> public async Task <PreAllocateVolumesResult> PreAllocateVolumes(PreAllocateVolumesParams values) { CheckConnection(); var url = _connection.LeaderUrl + RequestPathStrategy.PreAllocateVolumes + values.ToUrlParams(); var request = new HttpRequestMessage( HttpMethod.Get, new Uri(url) ); var jsonResponse = await _connection.FetchJsonResultByRequest(request); var obj = JsonConvert.DeserializeObject <PreAllocateVolumesResult>(jsonResponse.Json, Settings.JsonSerializerSettings); return(obj); }