com.baidubce.services.bmr.model
Class CreateClusterRequest

java.lang.Object
  extended by com.baidubce.model.AbstractBceRequest
      extended by com.baidubce.services.bmr.model.CreateClusterRequest

public class CreateClusterRequest
extends AbstractBceRequest

Provides options for creating a BMR cluster.

The essential options are imageType, imageVersion, instanceGroups, and the optional ones are clientToken, name, autoTerminate, logUri, applications and steps.


Constructor Summary
CreateClusterRequest()
           
 
Method Summary
 String getAdminPassword()
           
 List<ApplicationConfig> getApplications()
           
 boolean getAutoTerminate()
           
 String getAvailabilityZone()
           
 String getClientToken()
           
 String getImageType()
           
 String getImageVersion()
           
 List<InstanceGroupConfig> getInstanceGroups()
           
 String getLogUri()
           
 String getName()
           
 boolean getSafeModeEnabled()
           
 String getSecurityGroup()
           
 boolean getServiceHaEnabled()
           
 List<StepConfig> getSteps()
           
 String getSubnetId()
           
 String getTemplateType()
           
 String getVpcId()
           
 void setAdminPassword(String adminPassword)
           
 void setApplications(List<ApplicationConfig> applications)
           
 void setAutoTerminate(boolean autoTerminate)
           
 void setAvailabilityZone(String availabilityZone)
           
 void setClientToken(String clientToken)
           
 void setImageType(String imageType)
           
 void setImageVersion(String imageVersion)
           
 void setInstanceGroups(List<InstanceGroupConfig> instanceGroups)
           
 void setLogUri(String logUri)
           
 void setName(String name)
           
 void setSafeModeEnabled(boolean safeModeEnabled)
           
 void setSecurityGroup(String securityGroup)
           
 void setServiceHaEnabled(boolean serviceHaEnabled)
           
 void setSteps(List<StepConfig> steps)
           
 void setSubnetId(String subnetId)
           
 void setTemplateType(String templateType)
           
 void setVpcId(String vpcId)
           
 CreateClusterRequest withAdminPassword(String adminPassword)
          Configure request adminPassword for the request.
 CreateClusterRequest withApplication(ApplicationConfig application)
          Configure optional application for the cluster.
 CreateClusterRequest withAutoTerminate(boolean autoTerminate)
          Configure auto-terminate property for the cluster.
 CreateClusterRequest withAvailabilityZone(String availabilityZone)
          Configure request availabilityZone of creating cluster.
 CreateClusterRequest withClientToken(String clientToken)
          Configure optional client token for the request.
 CreateClusterRequest withImageType(String imageType)
          Configure the image type for the cluster.
 CreateClusterRequest withImageVersion(String imageVersion)
          Configure image version for the cluster.
 CreateClusterRequest withInstanceGroup(InstanceGroupConfig instanceGroup)
          Configure the instance group for the cluster.
 CreateClusterRequest withLogUri(String logUri)
          Configure optional BOS uri for logs of steps.
 CreateClusterRequest withName(String name)
          Configure optional name of the cluster.If not set, then the name of the cluster will be "my-cluster" by default.
 CreateClusterRequest withRequestCredentials(BceCredentials credentials)
          Configure request credential for the request.
 CreateClusterRequest withSafeModeEnabled(boolean safeModeEnabled)
          Configure optional safe mode enable of the cluster.
 CreateClusterRequest withSecurityGroup(String securityGroup)
          Configure request security group for the request.
 CreateClusterRequest withServiceHaEnabled(boolean serviceHaEnabled)
          Configure optional service HA enable of the cluster.
 CreateClusterRequest withStep(StepConfig step)
          Configure optional step for the cluster.
 CreateClusterRequest withSteps(List<StepConfig> steps)
          Configure the steps to be added.
 CreateClusterRequest withSubnetId(String subnetId)
          Configure request subnet name for the request.
 CreateClusterRequest withTemplateType(String templateType)
          Configure request templateType for the request.
 CreateClusterRequest withVpcId(String vpcId)
          Configure request vpc network name for the request.
 
Methods inherited from class com.baidubce.model.AbstractBceRequest
getRequestCredentials, setRequestCredentials
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateClusterRequest

public CreateClusterRequest()
Method Detail

getTemplateType

public String getTemplateType()

setTemplateType

public void setTemplateType(String templateType)

getImageType

public String getImageType()

setImageType

public void setImageType(String imageType)

getImageVersion

public String getImageVersion()

setImageVersion

public void setImageVersion(String imageVersion)

getClientToken

public String getClientToken()

setClientToken

public void setClientToken(String clientToken)

getAutoTerminate

public boolean getAutoTerminate()

setAutoTerminate

public void setAutoTerminate(boolean autoTerminate)

getLogUri

public String getLogUri()

setLogUri

public void setLogUri(String logUri)

getName

public String getName()

setName

public void setName(String name)

getServiceHaEnabled

public boolean getServiceHaEnabled()

setServiceHaEnabled

public void setServiceHaEnabled(boolean serviceHaEnabled)

getSafeModeEnabled

public boolean getSafeModeEnabled()

setSafeModeEnabled

public void setSafeModeEnabled(boolean safeModeEnabled)

getInstanceGroups

public List<InstanceGroupConfig> getInstanceGroups()

setInstanceGroups

public void setInstanceGroups(List<InstanceGroupConfig> instanceGroups)

getApplications

public List<ApplicationConfig> getApplications()

setApplications

public void setApplications(List<ApplicationConfig> applications)

getSteps

public List<StepConfig> getSteps()

setSteps

public void setSteps(List<StepConfig> steps)

getAdminPassword

public String getAdminPassword()

setAdminPassword

public void setAdminPassword(String adminPassword)

getSecurityGroup

public String getSecurityGroup()

setSecurityGroup

public void setSecurityGroup(String securityGroup)

getVpcId

public String getVpcId()

setVpcId

public void setVpcId(String vpcId)

getSubnetId

public String getSubnetId()

setSubnetId

public void setSubnetId(String subnetId)

getAvailabilityZone

public String getAvailabilityZone()

setAvailabilityZone

public void setAvailabilityZone(String availabilityZone)

withImageType

public CreateClusterRequest withImageType(String imageType)
Configure the image type for the cluster.

Parameters:
imageType - The image type for cluster's instances.
Returns:
CreateClusterRequest

withImageVersion

public CreateClusterRequest withImageVersion(String imageVersion)
Configure image version for the cluster.

Parameters:
imageVersion - The image version for the cluster's instance.
Returns:
CreateClusterRequest

withAutoTerminate

public CreateClusterRequest withAutoTerminate(boolean autoTerminate)
Configure auto-terminate property for the cluster. If set the autoTerminate as true, then the cluster will be terminated when all the steps are done. And the autoTerminate is true by default.

Parameters:
autoTerminate - true if the cluster should be auto terminated.
Returns:
CreateClusterRequest

withLogUri

public CreateClusterRequest withLogUri(String logUri)
Configure optional BOS uri for logs of steps. If the uri is not set, then the logs for the cluster and steps are not saved in the BOS.

Parameters:
logUri - The valid BOS uri for the logs.
Returns:
CreateClusterRequest

withName

public CreateClusterRequest withName(String name)
Configure optional name of the cluster.If not set, then the name of the cluster will be "my-cluster" by default.

Parameters:
name - The name for the cluster.
Returns:
CreateClusterRequest

withServiceHaEnabled

public CreateClusterRequest withServiceHaEnabled(boolean serviceHaEnabled)
Configure optional service HA enable of the cluster. If true will create a ha cluster, default is false.

Parameters:
serviceHaEnabled - true if the serivce ha enable, default is false.
Returns:
CreateClusterRequest

withSafeModeEnabled

public CreateClusterRequest withSafeModeEnabled(boolean safeModeEnabled)
Configure optional safe mode enable of the cluster. If true will create a cluster running as safe mode, default is false.

Parameters:
safeModeEnabled - true if the safe mode enable, default is false.
Returns:
CreateClusterRequest

withInstanceGroup

public CreateClusterRequest withInstanceGroup(InstanceGroupConfig instanceGroup)
Configure the instance group for the cluster.

Parameters:
instanceGroup - An InstanceGroupConfig instance.
Returns:
CreateClusterRequest

withApplication

public CreateClusterRequest withApplication(ApplicationConfig application)
Configure optional application for the cluster. BMR provides applications such as Hive、Pig、HBase for the cluster.

Parameters:
application - An ApplicationConfig instance.
Returns:
CreateClusterRequest

withStep

public CreateClusterRequest withStep(StepConfig step)
Configure optional step for the cluster. The step will be scheduled and executed after the cluster is ACTIVE. And the step also can be added to the cluster by sending AddStepsRequest.

Parameters:
step - a StepConfig instance to be added.
Returns:
CreateClusterRequest

withSteps

public CreateClusterRequest withSteps(List<StepConfig> steps)
Configure the steps to be added. This method will replace the CreateClusterRequest instance's steps by the @param steps totally, thus it should be invoked ahead of withStep method if both of them are used for the same CreateClusterRequest instance.

Parameters:
steps - a List of StepConfig instances to be added.
Returns:
CreateClusterRequest

withClientToken

public CreateClusterRequest withClientToken(String clientToken)
Configure optional client token for the request. The request will be idempotent if client token is provided.

Parameters:
clientToken - An ASCII string whose length is less than 64.
Returns:
CreateClusterRequest

withRequestCredentials

public CreateClusterRequest withRequestCredentials(BceCredentials credentials)
Configure request credential for the request.

Specified by:
withRequestCredentials in class AbstractBceRequest
Parameters:
credentials - a valid instance of BceCredentials.
Returns:
CreateClusterRequest

withAdminPassword

public CreateClusterRequest withAdminPassword(String adminPassword)
Configure request adminPassword for the request.

Parameters:
adminPassword - an password for cluster for example bmrtest@123
Returns:
CreateClusterRequest

withVpcId

public CreateClusterRequest withVpcId(String vpcId)
Configure request vpc network name for the request.

Parameters:
vpcId - vpcId for create cluster
Returns:
CreateClusterRequest

withSubnetId

public CreateClusterRequest withSubnetId(String subnetId)
Configure request subnet name for the request.

Parameters:
subnetId - subnetId for cluster
Returns:
CreateClusterRequest

withAvailabilityZone

public CreateClusterRequest withAvailabilityZone(String availabilityZone)
Configure request availabilityZone of creating cluster.

Parameters:
availabilityZone - cluster availabilityZone
Returns:
CreateClusterRequest

withSecurityGroup

public CreateClusterRequest withSecurityGroup(String securityGroup)
Configure request security group for the request.

Parameters:
securityGroup - securityGroup for cluster
Returns:
CreateClusterRequest

withTemplateType

public CreateClusterRequest withTemplateType(String templateType)
Configure request templateType for the request.

Parameters:
templateType - templateType for cluster
Returns:
CreateClusterRequest


Copyright © 2020. All rights reserved.