Beispiel #1
0
        /// <summary>
        /// 查询Kafka集群元数据信息
        /// </summary>
        public async Task <ShowClusterResponse> ShowClusterAsync(ShowClusterRequest showClusterRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("instance_id", showClusterRequest.InstanceId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/instances/{instance_id}/management/cluster", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", showClusterRequest);
            HttpResponseMessage response = await DoHttpRequestAsync("GET", request);

            return(JsonUtils.DeSerialize <ShowClusterResponse>(response));
        }
        /// <summary>
        /// 获取指定的集群
        /// </summary>
        public ShowClusterResponse ShowCluster(ShowClusterRequest showClusterRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("cluster_id", showClusterRequest.ClusterId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/api/v3/projects/{project_id}/clusters/{cluster_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", showClusterRequest);
            HttpResponseMessage response = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ShowClusterResponse>(response));
        }