All Products
Search
Document Center

Batch Compute:updateCluster

Last Updated:May 11, 2018

Method description

Modifies some configurations of a cluster. For more information, see API Reference.

Parameter description

ClusterDescription instance

Response description

  • If the call succeeds, a UpdateClusterResponse instance is returned.

  • If a failure occurs, a ClientException is thrown.

Sample code

  1. try{
  2. ClusterDescription desc = new ClusterDescription();
  3. GroupDescription groupDesc = new GroupDescription();
  4. //The expected number of VMs can be modified. The value ranges from 0 to n.
  5. groupDesc.setDesiredVMCount(3);
  6. //The spot strategy can be modified.
  7. groupDesc.setSpotStrategy("SpotWithPriceLimit");
  8. groupDesc.setSpotPriceLimit(0.6f);
  9. desc.addGroup("group1", groupDesc);
  10. UpdateClusterResponse response = client.updateCluster(desc);
  11. //Succeeded
  12. }catch(ClientException e){
  13. e.printStackTrace();
  14. // Failed
  15. }