Search in sources :

Example 1 with ApiServiceState

use of com.cloudera.api.swagger.model.ApiServiceState in project cloudbreak by hortonworks.

the class ClouderaManagerMgmtLaunchService method startManagementServices.

void startManagementServices(Stack stack, ApiClient apiClient) throws ApiException {
    MgmtServiceResourceApi mgmtServiceResourceApi = getMgmtServiceResourceApi(apiClient);
    ApiService mgmtService = getMgmtService(mgmtServiceResourceApi);
    Optional<ApiCommand> startCommand = Optional.empty();
    ApiServiceState serviceState = mgmtService.getServiceState();
    if (serviceState != ApiServiceState.STARTED && serviceState != ApiServiceState.STARTING) {
        startCommand = Optional.of(mgmtServiceResourceApi.startCommand());
    }
    startCommand.ifPresent(command -> startPolling(stack, apiClient, command));
}
Also used : ApiCommand(com.cloudera.api.swagger.model.ApiCommand) ApiServiceState(com.cloudera.api.swagger.model.ApiServiceState) ApiService(com.cloudera.api.swagger.model.ApiService) MgmtServiceResourceApi(com.cloudera.api.swagger.MgmtServiceResourceApi)

Aggregations

MgmtServiceResourceApi (com.cloudera.api.swagger.MgmtServiceResourceApi)1 ApiCommand (com.cloudera.api.swagger.model.ApiCommand)1 ApiService (com.cloudera.api.swagger.model.ApiService)1 ApiServiceState (com.cloudera.api.swagger.model.ApiServiceState)1