private Uri getPoolsUri(Uri bootstrapUri)
        {
            var bucketUri = ConfigHelper.CleanBootstrapUri(bootstrapUri);

            //GET /pools
            var json  = HttpHelper.Get(bucketUri);
            var pools = ClusterConfigParser.ParseNested <object[]>(json, "pools");
            var path  = (pools.First() as Dictionary <string, object>)["uri"] as string;

            return(UriHelper.Combine(getAuthority(bootstrapUri), path));
        }
        private Uri getBucketUri(IList <Uri> uris)
        {
            var bootstrapUri = uris.First();
            var poolsUri     = getPoolsUri(bootstrapUri);

            //GET /pools/default
            var json    = HttpHelper.Get(poolsUri);
            var buckets = ClusterConfigParser.ParseNested <Dictionary <string, object> >(json, "buckets");
            var path    = buckets["uri"] as string;

            var idx = -1;

            if ((idx = path.IndexOf("?")) != -1)
            {
                path = path.Substring(0, idx);
            }

            return(UriHelper.Combine(getAuthority(bootstrapUri), path));
        }