## com.baidubce.services.bmr.model
Class CreateClusterRequest

    java.lang.Object
      com.baidubce.model.AbstractBceRequest
          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
`List<ApplicationConfig>` `getApplications()`
`boolean` `getAutoTerminate()`
`String` `getClientToken()`
`String` `getImageType()`
`String` `getImageVersion()`
`List<InstanceGroupConfig>` `getInstanceGroups()`
`String` `getLogUri()`
`String` `getName()`
`List<StepConfig>` `getSteps()`
`void` `setApplications(List<ApplicationConfig> applications)`
`void` `setAutoTerminate(boolean autoTerminate)`
`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` `setSteps(List<StepConfig> steps)`
`CreateClusterRequest` `withApplication(ApplicationConfig application)` Configure optional application for the cluster.
`CreateClusterRequest` `withAutoTerminate(boolean autoTerminate)` Configure auto-terminate property for the 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` `withStep(StepConfig step)` Configure optional step for the cluster.
`CreateClusterRequest` `withSteps(List<StepConfig> steps)` Configure the steps to be added.

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

### 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)

### 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)

### 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` -
  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

### 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

Copyright © 2016. All rights reserved.