Ejemplo n.º 1
0
 public async Task Execute()
 {
     try
     {
         await TargetUrl
         .AppendPathSegment(MemberId)
         .DeleteAsync();
     }
     catch (FlurlHttpException e)
     {
         throw e.ProcessException();
     }
 }
Ejemplo n.º 2
0
        public async Task <IClusterMember> Execute()
        {
            var values = new FormBodyBuilder()
                         .Add(Constants.Etcd.Parameter_PeerURLs, Uris.Select(x => x.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped)).ToArray())
                         .Build();

            try
            {
                return(await TargetUrl
                       .AppendPathSegment(MemberId)
                       .PutJsonAsync(values)
                       .ReceiveJson <ClusterMember>());
            }
            catch (FlurlHttpException e)
            {
                throw e.ProcessException();
            }
        }