com.baidubce.services.bmr
Class BmrClient

java.lang.Object
  extended by com.baidubce.AbstractBceClient
      extended by com.baidubce.services.bmr.BmrClient

public class BmrClient
extends AbstractBceClient

Provides the client for accessing the Baidu MapReduce service.


Field Summary
 
Fields inherited from class com.baidubce.AbstractBceClient
config, DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING, DEFAULT_SERVICE_DOMAIN, URL_PREFIX
 
Constructor Summary
BmrClient()
          Constructs a new client to invoke service methods on BMR.
BmrClient(BceClientConfiguration clientConfiguration)
          Constructs a new BMR client using the client configuration to access BMR.
 
Method Summary
 void addEip(EipRequest request)
          add an EIP of the master node of a cluster
 AddStepsResponse addSteps(AddStepsRequest request)
          Add steps to a BMR cluster.
 void bindEip(EipBindRequest request)
          bind EIP for the bmr instance of a cluster
 void cancelSteps(GetStepRequest request)
           
 CreateClusterResponse createCluster(CreateClusterRequest request)
          Create a cluster with the specified options.
 CreateClusterResponse createclusterByTemplate(CreateClusterByTemplateRequest request)
          create a cluster by a template
 ScheduleCreateResponse createSchedulePlan(CreateSchedulePlanRequest request)
          create a scheduleplan
 CreateTemplateResponse createTemplate(CreateTemplateRequest request)
          create a Template
 void deleteEip(EipRequest request)
          Delete the master of a cluster 's EIP
 ScheduleResultResponse deleteSchedulePlan(SchedulePlanRequest request)
          delete scheduleplan id
 NormalResponse deleteTemplate(TemplateIdRequest request)
          delete template by id
 CluseterDetailInfoResponse getCluseterDetail(GetClusterRequest request)
          get a cluster's detail
 GetClusterResponse getCluster(GetClusterRequest request)
          Describe the detail information of the target cluster.
 GetClusterResponse getCluster(String clusterId)
          Describe the detail information of the target cluster.
 AmbariResponse getClusterAmbariPassword(String clusterId)
          Describe the Ambari Password information of the target cluster.
 SchedulePlanDetailResponse getSchedulePlanDetail(SchedulePlanRequest request)
          get a schedulePlan's detail
 GetStepResponse getStep(GetStepRequest request)
          Describe the detail information of the target step.
 GetStepResponse getStep(String clusterId, String stepId)
          Describe the detail information of the target step.
 TemplateInfoResponse getTemplateInfo(TemplateIdRequest request)
          get the TemplateInfo
 ListClusterHostsResponse listClusterHosts(String clusterId)
          List host info for a cluster
 ListClustersResponse listClusters()
          List BMR clusters owned by the authenticated user.
 ListClustersResponse listClusters(int maxKeys)
          List BMR clusters owned by the authenticated user.
 ListClustersResponse listClusters(ListClustersRequest request)
          List BMR clusters owned by the authenticated user.
 ListClustersResponse listClusters(String marker, int maxKeys)
          List BMR clusters owned by the authenticated user.
 ListHistorySchedulePlanResponse listHistory(SchedulePlanRequest request)
          list history steps of a shcduleplan
 ListInstanceGroupsResponse listInstanceGroups(ListInstanceGroupsRequest request)
          List the instance groups of the target BMR cluster.
 ListInstanceGroupsResponse listInstanceGroups(String clusterId)
          List the instance groups of the target BMR cluster.
 ListInstancesResponse listInstances(ListInstancesRequest request)
          List the instances belonging to the target instance group in the BMR cluster.
 ListInstancesResponse listInstances(String clusterId, String instanceGroupId)
          List the instances belonging to the target instance in the BMR cluster.
 SchedulePlanDetailListResponse listSchedulePlanDetail(ListScheduleDetailRequest request)
          list the detail of a schedulePlan
 ListStepsResponse listSteps(ListStepsRequest request)
          List all the steps of the target BMR cluster.
 ListStepsResponse listSteps(String clusterId)
          List all the steps of the target BMR cluster.
 ListStepsResponse listSteps(String clusterId, int maxKeys)
          List all the steps of the target BMR cluster.
 ListStepsResponse listSteps(String clusterId, String marker, int maxKeys)
          List all the steps of the target BMR cluster.
 TemplateListResponse listTemplate(TemplateListRequest request)
          list all of template of an user
 void modifyInstanceGroups(ModifyInstanceGroupsRequest request)
          Modify the instance groups of the target cluster.
 NormalResponse renameCluster(RenameCluseterRequest request)
          rename a cluster's name
 TemplateClusterResponse saveTemplateByCluster(TemplateClusterRequest request)
          save a template by clusterID
 ScheduleResultResponse startSchedulePlan(SchedulePlanRequest request)
          start a scheduleplan
 ScheduleResultResponse stopSchedulePlan(SchedulePlanRequest request)
          stip scheduleplan
 void terminateCluster(String clusterId)
          Terminate a BMR cluster and release all the virtual machine instances.
 void terminateCluster(TerminateClusterRequest request)
          Terminate a BMR cluster and release all the virtual machine instances.
 void unBindEip(EipUnBindRequest request)
          unbind EIP for the bmr instance of a cluster
 ScheduleResultResponse updateSchedulePlan(UpdateSchedulePlanRequest request)
          update a schedulePlan
 
Methods inherited from class com.baidubce.AbstractBceClient
computeServiceId, getClient, getEndpoint, getServiceId, invokeHttpClient, isRegionSupported, setClient, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BmrClient

public BmrClient()
Constructs a new client to invoke service methods on BMR.


BmrClient

public BmrClient(BceClientConfiguration clientConfiguration)
Constructs a new BMR client using the client configuration to access BMR.

Parameters:
clientConfiguration - The BCE client configuration options.
Method Detail

listClusters

public ListClustersResponse listClusters(ListClustersRequest request)
List BMR clusters owned by the authenticated user. Users must authenticate with a valid BCE Access Key ID, and the response contains all the BMR clusters owned by the user.

Parameters:
request - The request containing valid query parameters.
Returns:
The response containing a list of the BMR clusters owned by the authenticated sender of the request.

listClusters

public ListClustersResponse listClusters()
List BMR clusters owned by the authenticated user.

Returns:
The response containing a list of the BMR clusters owned by the authenticated sender of the request.

listClusters

public ListClustersResponse listClusters(int maxKeys)
List BMR clusters owned by the authenticated user.

Parameters:
maxKeys - The maximum number of clusters returned.
Returns:
The response containing a list of the BMR clusters owned by the authenticated sender of the request. And the size of list is limited below maxKeys.

listClusters

public ListClustersResponse listClusters(String marker,
                                         int maxKeys)
List BMR clusters owned by the authenticated user.

Parameters:
marker - The start record of clusters.
maxKeys - The maximum number of clusters returned.
Returns:
The response containing a list of the BMR clusters owned by the authenticated sender of the request. The clusters' records start from the marker and the size of list is limited below maxKeys.

getCluster

public GetClusterResponse getCluster(GetClusterRequest request)
Describe the detail information of the target cluster.

Parameters:
request - The request object containing the ID of the target cluster.
Returns:
response containing the detail information of the target cluster.

getClusterAmbariPassword

public AmbariResponse getClusterAmbariPassword(String clusterId)
Describe the Ambari Password information of the target cluster.

Parameters:
clusterId - ID of the target cluster.
Returns:
response containing the Ambari Password information of the target cluster.

saveTemplateByCluster

public TemplateClusterResponse saveTemplateByCluster(TemplateClusterRequest request)
save a template by clusterID

Parameters:
request - The request object containing the ID of the target cluster
Returns:
response containing the ID of the new template

getCluster

public GetClusterResponse getCluster(String clusterId)
Describe the detail information of the target cluster.

Parameters:
clusterId - The ID of the target cluster.
Returns:
The response containing the detail information of the target cluster.

createCluster

public CreateClusterResponse createCluster(CreateClusterRequest request)
Create a cluster with the specified options.

Parameters:
request - The request containing all options for creating a BMR cluster.
Returns:
The response containing the ID of the newly created cluster.

createTemplate

public CreateTemplateResponse createTemplate(CreateTemplateRequest request)
create a Template

Parameters:
request - the request contains all of a cluster's config
Returns:
a new TemplateId

getCluseterDetail

public CluseterDetailInfoResponse getCluseterDetail(GetClusterRequest request)
get a cluster's detail

Parameters:
request - a cluster's id
Returns:
get a cluster's config

createclusterByTemplate

public CreateClusterResponse createclusterByTemplate(CreateClusterByTemplateRequest request)
create a cluster by a template

Parameters:
request - a template,a loguril,an adminPasswod
Returns:
the cluster's Id

modifyInstanceGroups

public void modifyInstanceGroups(ModifyInstanceGroupsRequest request)
Modify the instance groups of the target cluster.

Parameters:
request - The request containing the ID of BMR cluster and the instance groups to be modified.

terminateCluster

public void terminateCluster(TerminateClusterRequest request)
Terminate a BMR cluster and release all the virtual machine instances.

Parameters:
request - The request containing the ID of the cluster to be terminated.

terminateCluster

public void terminateCluster(String clusterId)
Terminate a BMR cluster and release all the virtual machine instances.

Parameters:
clusterId - The ID of the cluster to be terminated.

listInstanceGroups

public ListInstanceGroupsResponse listInstanceGroups(ListInstanceGroupsRequest request)
List the instance groups of the target BMR cluster.

Parameters:
request - containing the ID of target BMR cluster.
Returns:
The response containing a list of InstanceGroup objects.

listInstanceGroups

public ListInstanceGroupsResponse listInstanceGroups(String clusterId)
List the instance groups of the target BMR cluster.

Parameters:
clusterId - the ID of target BMR cluster.
Returns:
The response containing a list of InstanceGroup objects.

listInstances

public ListInstancesResponse listInstances(ListInstancesRequest request)
List the instances belonging to the target instance group in the BMR cluster.

Parameters:
request - containing the ID of target BMR cluster and the ID of the instance group.
Returns:
The response containing a list of Instance objects.

listInstances

public ListInstancesResponse listInstances(String clusterId,
                                           String instanceGroupId)
List the instances belonging to the target instance in the BMR cluster.

Parameters:
clusterId - the ID of target BMR cluster.
instanceGroupId - the ID of target instance group.
Returns:
The response containing a list of Instance objects.

addSteps

public AddStepsResponse addSteps(AddStepsRequest request)
Add steps to a BMR cluster.

Parameters:
request - containing the ID of target BMR cluster and several steps to be added.
Returns:
The response containing a list of IDs of newly added steps.

cancelSteps

public void cancelSteps(GetStepRequest request)

listSteps

public ListStepsResponse listSteps(ListStepsRequest request)
List all the steps of the target BMR cluster.

Parameters:
request - The request containing the ID of target BMR cluster.
Returns:
The response containing the list of steps owned by the cluster.

listSteps

public ListStepsResponse listSteps(String clusterId)
List all the steps of the target BMR cluster.

Parameters:
clusterId - The ID of the target BMR cluster.
Returns:
The response containing the list of steps owned by the cluster.

listSteps

public ListStepsResponse listSteps(String clusterId,
                                   int maxKeys)
List all the steps of the target BMR cluster.

Parameters:
clusterId - The ID of the target BMR cluster.
maxKeys - The maximum number of steps returned.
Returns:
The response containing the list of steps owned by the cluster. And the size of list is limited below maxKeys.

listSteps

public ListStepsResponse listSteps(String clusterId,
                                   String marker,
                                   int maxKeys)
List all the steps of the target BMR cluster.

Parameters:
clusterId - The ID of the target BMR cluster.
marker - The start record of steps.
maxKeys - The maximum number of steps returned.
Returns:
The response containing a list of the BMR steps owned by the cluster. The steps' records start from the marker and the size of list is limited below maxKeys.

getStep

public GetStepResponse getStep(GetStepRequest request)
Describe the detail information of the target step.

The request is valid just if the step exists and the step is owned by the cluster

Parameters:
request - The request containing the ID of BMR cluster and the ID of step.
Returns:
The response containing the detail information of target step.

getStep

public GetStepResponse getStep(String clusterId,
                               String stepId)
Describe the detail information of the target step.

Parameters:
clusterId - The ID of the cluster which owns the step.
stepId - The ID of the target step.
Returns:
The response containing the detail information of the target step.

deleteEip

public void deleteEip(EipRequest request)
Delete the master of a cluster 's EIP

Parameters:
request - the cluster's ID

renameCluster

public NormalResponse renameCluster(RenameCluseterRequest request)
rename a cluster's name

Parameters:
request - contains cluster's ID and cluster's new name
Returns:
the success info

addEip

public void addEip(EipRequest request)
add an EIP of the master node of a cluster

Parameters:
request - contains instanceID and clusterID

getTemplateInfo

public TemplateInfoResponse getTemplateInfo(TemplateIdRequest request)
get the TemplateInfo

Parameters:
request - contains the templateID and adminPassword
Returns:
all of config message of the template

deleteTemplate

public NormalResponse deleteTemplate(TemplateIdRequest request)
delete template by id

Parameters:
request - contains templateid and adminPassword
Returns:
success message

listTemplate

public TemplateListResponse listTemplate(TemplateListRequest request)
list all of template of an user

Parameters:
request - contains the username
Returns:
template info list

createSchedulePlan

public ScheduleCreateResponse createSchedulePlan(CreateSchedulePlanRequest request)
create a scheduleplan

Parameters:
request - contains templateId ,steps,period,timeUnit
Returns:
a scheduleplanId

updateSchedulePlan

public ScheduleResultResponse updateSchedulePlan(UpdateSchedulePlanRequest request)
update a schedulePlan

Parameters:
request - contains scheduleplanId ,steps config,schedule message
Returns:
code, msg, success

deleteSchedulePlan

public ScheduleResultResponse deleteSchedulePlan(SchedulePlanRequest request)
delete scheduleplan id

Parameters:
request - contains schedulePlanId
Returns:
result

stopSchedulePlan

public ScheduleResultResponse stopSchedulePlan(SchedulePlanRequest request)
stip scheduleplan

Parameters:
request - contains scheduleplan id
Returns:
result

startSchedulePlan

public ScheduleResultResponse startSchedulePlan(SchedulePlanRequest request)
start a scheduleplan

Parameters:
request - scheduleplan's id
Returns:
result

getSchedulePlanDetail

public SchedulePlanDetailResponse getSchedulePlanDetail(SchedulePlanRequest request)
get a schedulePlan's detail

Parameters:
request - contains schedulePlanId
Returns:
the detail of a schedulePlan

listSchedulePlanDetail

public SchedulePlanDetailListResponse listSchedulePlanDetail(ListScheduleDetailRequest request)
list the detail of a schedulePlan

Parameters:
request - contains nothing
Returns:
the schedulePlan 's detail

listHistory

public ListHistorySchedulePlanResponse listHistory(SchedulePlanRequest request)
list history steps of a shcduleplan

Parameters:
request - contains shcadulePlanId
Returns:
history steps

bindEip

public void bindEip(EipBindRequest request)
bind EIP for the bmr instance of a cluster

Parameters:
request - bind request

unBindEip

public void unBindEip(EipUnBindRequest request)
unbind EIP for the bmr instance of a cluster

Parameters:
request - unbind request

listClusterHosts

public ListClusterHostsResponse listClusterHosts(String clusterId)
List host info for a cluster

Parameters:
clusterId - cluster uuid


Copyright © 2020. All rights reserved.