閱讀214 返回首頁    go windows


獲取集群信息__SDK接口說明_Java版SDK_批量計算-阿裏雲

getCluster

方法說明:

通過指定的集群ID來獲取集群信息。

參數說明:

參數 類型 說明
clusterId String 集群ID

返回值說明:

  • 成功後返回一個GetClusterResponse實例,可以通過這個實例的 getCluster()方法,拿到Cluster對象。

  • 如果失敗,拋出異常: ClientException。

代碼示例:

  1. try{
  2. GetClusterResponse response = client.getCluster("cls-6vilcufsfd31i010");
  3. //成功
  4. Cluster cluster = response.getCluster();
  5. String state = cluster.getState();
  6. //assertEquals('Active', state); //集群狀態。僅支持"Active"和"Deleting"。
  7. }catch(ClientException e){
  8. e.printStackTrace();
  9. //失敗
  10. }

最後更新:2016-11-23 16:04:16

  上一篇:go 刪除鏡像__SDK接口說明_Java版SDK_批量計算-阿裏雲
  下一篇:go 獲取集群列表__SDK接口說明_Java版SDK_批量計算-阿裏雲