/// <summary>
        /// 查询集群列表
        /// </summary>   
        /// <example>
        /// <para>ListClustersReqEx reqEx = new ListClustersReqEx();</para>
        /// <para>ListClustersResp resp = common.ListClusters("/service/sites/4D9D0815", reqEx);</para>
        /// </example>
        /// <param name="siteUri">【必选】站点Uri</param>
        /// <param name="reqEx">【可选】请求相关参数</param>
        /// <returns>查询结果</returns>
        public ListClustersResp ListClusters(string siteUri,ListClustersReqEx reqEx)
        {
            ListClustersResp resp = new ListClustersResp();

            StringBuilder url = new StringBuilder(siteUri + "/clusters?");
            #region
            if (null != reqEx)
            {
                url.Append(null == reqEx.tag ? "" : ("tag=" + reqEx.tag + "&"));
                url.Append(null == reqEx.name ? "" : ("name=" + reqEx.name + "&"));
                url.Append(null == reqEx.parentObjUrn ? "" : ("parentObjUrn=" + reqEx.parentObjUrn + "&"));

                if (null != reqEx.clusterUrns && reqEx.clusterUrns.Count > 0)
                {
                    foreach (string urn in reqEx.clusterUrns)
                    {
                        url.Append("clusterUrns=" + urn + "&");
                    }
                }
            }
            #endregion
            string result = RestClientUtil.sendRequest("GET", url.ToString(0, url.Length - 1), null, bean, "ListClusters");
            log.Info("ListClusters result : " + result);

            resp = JsonConvert.DeserializeObject<ListClustersResp>(result);

            return resp;
        }
示例#2
0
        // Token: 0x0600011D RID: 285 RVA: 0x0000368C File Offset: 0x0000188C
        public ListClustersResp ListClusters(string siteUri, ListClustersReqEx reqEx)
        {
            ListClustersResp listClustersResp = new ListClustersResp();
            StringBuilder    stringBuilder    = new StringBuilder(siteUri + "/clusters?");

            if (null != reqEx)
            {
                stringBuilder.Append((reqEx.tag == null) ? "" : ("tag=" + reqEx.tag + "&"));
                stringBuilder.Append((reqEx.name == null) ? "" : ("name=" + reqEx.name + "&"));
                stringBuilder.Append((reqEx.parentObjUrn == null) ? "" : ("parentObjUrn=" + reqEx.parentObjUrn + "&"));
                if (reqEx.clusterUrns != null && reqEx.clusterUrns.Count > 0)
                {
                    foreach (string str in reqEx.clusterUrns)
                    {
                        stringBuilder.Append("clusterUrns=" + str + "&");
                    }
                }
            }
            string text = RestClientUtil.sendRequest("GET", stringBuilder.ToString(0, stringBuilder.Length - 1), null, this.bean, "ListClusters");

            CommonResource.log.Info("ListClusters result : " + text);
            return(JsonConvert.DeserializeObject <ListClustersResp>(text));
        }