MgmtRolesResourceApi

All URIs are relative to /api/v57

Method HTTP request Description
createRoles POST /cm/service/roles Create new roles in the Cloudera Management Services.
deleteRole DELETE /cm/service/roles/{roleName} Delete a role from the Cloudera Management Services.
enterMaintenanceMode POST /cm/service/roles/{roleName}/commands/enterMaintenanceMode Put the Cloudera Management Service role into maintenance mode.
exitMaintenanceMode POST /cm/service/roles/{roleName}/commands/exitMaintenanceMode Take the Cloudera Management Service role out of maintenance mode.
getFullLog GET /cm/service/roles/{roleName}/logs/full Retrieves the log file for the role's main process.
getStacksLog GET /cm/service/roles/{roleName}/logs/stacks Retrieves the stacks log file, if any, for the role's main process.
getStacksLogsBundle GET /cm/service/roles/{roleName}/logs/stacksBundle Download a zip-compressed archive of role stacks logs.
getStandardError GET /cm/service/roles/{roleName}/logs/stderr Retrieves the role's standard error output.
getStandardOutput GET /cm/service/roles/{roleName}/logs/stdout Retrieves the role's standard output.
listActiveCommands GET /cm/service/roles/{roleName}/commands List active role commands.
readRole GET /cm/service/roles/{roleName} Retrieve detailed information about a Cloudera Management Services role.
readRoleConfig GET /cm/service/roles/{roleName}/config Retrieve the configuration of a specific Cloudera Management Services role.
readRoles GET /cm/service/roles List all roles of the Cloudera Management Services.
updateRoleConfig PUT /cm/service/roles/{roleName}/config Update the configuration of a Cloudera Management Services role.

createRoles

ApiRoleList createRoles(body)

Create new roles in the Cloudera Management Services.

Create new roles in the Cloudera Management Services.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.MgmtRolesResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

MgmtRolesResourceApi apiInstance = new MgmtRolesResourceApi();
ApiRoleList body = new ApiRoleList(); // ApiRoleList | Roles to create.
try {
    ApiRoleList result = apiInstance.createRoles(body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling MgmtRolesResourceApi#createRoles");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body ApiRoleList Roles to create. [optional]

Return type

ApiRoleList

Authorization

basic

HTTP request headers

deleteRole

ApiRole deleteRole(roleName)

Delete a role from the Cloudera Management Services.

Delete a role from the Cloudera Management Services.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.MgmtRolesResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

MgmtRolesResourceApi apiInstance = new MgmtRolesResourceApi();
String roleName = "roleName_example"; // String | The role name.
try {
    ApiRole result = apiInstance.deleteRole(roleName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling MgmtRolesResourceApi#deleteRole");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
roleName String The role name.

Return type

ApiRole

Authorization

basic

HTTP request headers

enterMaintenanceMode

ApiCommand enterMaintenanceMode(roleName)

Put the Cloudera Management Service role into maintenance mode.

Put the Cloudera Management Service role into maintenance mode.This is a synchronous command. The result is known immediately upon return.

Available since API v18.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.MgmtRolesResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

MgmtRolesResourceApi apiInstance = new MgmtRolesResourceApi();
String roleName = "roleName_example"; // String | The role name.
try {
    ApiCommand result = apiInstance.enterMaintenanceMode(roleName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling MgmtRolesResourceApi#enterMaintenanceMode");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
roleName String The role name.

Return type

ApiCommand

Authorization

basic

HTTP request headers

exitMaintenanceMode

ApiCommand exitMaintenanceMode(roleName)

Take the Cloudera Management Service role out of maintenance mode.

Take the Cloudera Management Service role out of maintenance mode. This is a synchronous command. The result is known immediately upon return.

Available since API v18.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.MgmtRolesResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

MgmtRolesResourceApi apiInstance = new MgmtRolesResourceApi();
String roleName = "roleName_example"; // String | The role name.
try {
    ApiCommand result = apiInstance.exitMaintenanceMode(roleName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling MgmtRolesResourceApi#exitMaintenanceMode");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
roleName String The role name.

Return type

ApiCommand

Authorization

basic

HTTP request headers

getFullLog

String getFullLog(roleName)

Retrieves the log file for the role's main process.

Retrieves the log file for the role's main process.

If the role is not started, this will be the log file associated with the last time the role was run.

Log files are returned as plain text (type "text/plain").

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.MgmtRolesResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

MgmtRolesResourceApi apiInstance = new MgmtRolesResourceApi();
String roleName = "roleName_example"; // String | The role to fetch logs from.
try {
    String result = apiInstance.getFullLog(roleName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling MgmtRolesResourceApi#getFullLog");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
roleName String The role to fetch logs from.

Return type

String

Authorization

basic

HTTP request headers

getStacksLog

String getStacksLog(roleName)

Retrieves the stacks log file, if any, for the role's main process.

Retrieves the stacks log file, if any, for the role's main process. Note that not all roles support periodic stacks collection. The log files are returned as plain text (type "text/plain").

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.MgmtRolesResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

MgmtRolesResourceApi apiInstance = new MgmtRolesResourceApi();
String roleName = "roleName_example"; // String | The role to fetch stacks logs from.
try {
    String result = apiInstance.getStacksLog(roleName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling MgmtRolesResourceApi#getStacksLog");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
roleName String The role to fetch stacks logs from.

Return type

String

Authorization

basic

HTTP request headers

getStacksLogsBundle

File getStacksLogsBundle(roleName)

Download a zip-compressed archive of role stacks logs.

Download a zip-compressed archive of role stacks logs. Note that not all roles support periodic stacks collection.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.MgmtRolesResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

MgmtRolesResourceApi apiInstance = new MgmtRolesResourceApi();
String roleName = "roleName_example"; // String | The role to fetch the stacks logs bundle from.
try {
    File result = apiInstance.getStacksLogsBundle(roleName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling MgmtRolesResourceApi#getStacksLogsBundle");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
roleName String The role to fetch the stacks logs bundle from.

Return type

File

Authorization

basic

HTTP request headers

getStandardError

String getStandardError(roleName)

Retrieves the role's standard error output.

Retrieves the role's standard error output.

If the role is not started, this will be the output associated with the last time the role was run.

Log files are returned as plain text (type "text/plain").

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.MgmtRolesResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

MgmtRolesResourceApi apiInstance = new MgmtRolesResourceApi();
String roleName = "roleName_example"; // String | The role to fetch stderr from.
try {
    String result = apiInstance.getStandardError(roleName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling MgmtRolesResourceApi#getStandardError");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
roleName String The role to fetch stderr from.

Return type

String

Authorization

basic

HTTP request headers

getStandardOutput

String getStandardOutput(roleName)

Retrieves the role's standard output.

Retrieves the role's standard output.

If the role is not started, this will be the output associated with the last time the role was run.

Log files are returned as plain text (type "text/plain").

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.MgmtRolesResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

MgmtRolesResourceApi apiInstance = new MgmtRolesResourceApi();
String roleName = "roleName_example"; // String | The role to fetch stdout from.
try {
    String result = apiInstance.getStandardOutput(roleName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling MgmtRolesResourceApi#getStandardOutput");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
roleName String The role to fetch stdout from.

Return type

String

Authorization

basic

HTTP request headers

listActiveCommands

ApiCommandList listActiveCommands(roleName, view)

List active role commands.

List active role commands.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.MgmtRolesResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

MgmtRolesResourceApi apiInstance = new MgmtRolesResourceApi();
String roleName = "roleName_example"; // String | The role name.
String view = "summary"; // String | The view of the data to materialize, either \"summary\" or \"full\".
try {
    ApiCommandList result = apiInstance.listActiveCommands(roleName, view);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling MgmtRolesResourceApi#listActiveCommands");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
roleName String The role name.
view String The view of the data to materialize, either "summary" or "full". [optional] [default to summary] [enum: EXPORT, EXPORT_REDACTED, FULL, FULL_WITH_HEALTH_CHECK_EXPLANATION, FULL_WITH_NO_HEALTH_CHECK, SUMMARY]

Return type

ApiCommandList

Authorization

basic

HTTP request headers

readRole

ApiRole readRole(roleName)

Retrieve detailed information about a Cloudera Management Services role.

Retrieve detailed information about a Cloudera Management Services role.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.MgmtRolesResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

MgmtRolesResourceApi apiInstance = new MgmtRolesResourceApi();
String roleName = "roleName_example"; // String | The role name.
try {
    ApiRole result = apiInstance.readRole(roleName);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling MgmtRolesResourceApi#readRole");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
roleName String The role name.

Return type

ApiRole

Authorization

basic

HTTP request headers

readRoleConfig

ApiConfigList readRoleConfig(roleName, view)

Retrieve the configuration of a specific Cloudera Management Services role.

Retrieve the configuration of a specific Cloudera Management Services role.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.MgmtRolesResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

MgmtRolesResourceApi apiInstance = new MgmtRolesResourceApi();
String roleName = "roleName_example"; // String | The role to look up.
String view = "summary"; // String | The view of the data to materialize, either \"summary\" or \"full\".
try {
    ApiConfigList result = apiInstance.readRoleConfig(roleName, view);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling MgmtRolesResourceApi#readRoleConfig");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
roleName String The role to look up.
view String The view of the data to materialize, either "summary" or "full". [optional] [default to summary] [enum: EXPORT, EXPORT_REDACTED, FULL, FULL_WITH_HEALTH_CHECK_EXPLANATION, FULL_WITH_NO_HEALTH_CHECK, SUMMARY]

Return type

ApiConfigList

Authorization

basic

HTTP request headers

readRoles

ApiRoleList readRoles()

List all roles of the Cloudera Management Services.

List all roles of the Cloudera Management Services.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.MgmtRolesResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

MgmtRolesResourceApi apiInstance = new MgmtRolesResourceApi();
try {
    ApiRoleList result = apiInstance.readRoles();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling MgmtRolesResourceApi#readRoles");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

ApiRoleList

Authorization

basic

HTTP request headers

updateRoleConfig

ApiConfigList updateRoleConfig(roleName, body, message)

Update the configuration of a Cloudera Management Services role.

Update the configuration of a Cloudera Management Services role.

If a value is set in the given configuration, it will be added to the role's configuration, replacing any existing entries. If a value is unset (its value is null), the existing configuration for the attribute will be erased, if any.

Attributes that are not listed in the input will maintain their current values in the configuration.

Example

// Import classes:
//import com.cloudera.api.swagger.client.ApiClient;
//import com.cloudera.api.swagger.client.ApiException;
//import com.cloudera.api.swagger.client.Configuration;
//import com.cloudera.api.swagger.client.auth.*;
//import com.cloudera.api.swagger.MgmtRolesResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

MgmtRolesResourceApi apiInstance = new MgmtRolesResourceApi();
String roleName = "roleName_example"; // String | The role to modify.
ApiConfigList body = new ApiConfigList(); // ApiConfigList | Configuration changes.
String message = "message_example"; // String | Optional message describing the changes.
try {
    ApiConfigList result = apiInstance.updateRoleConfig(roleName, body, message);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling MgmtRolesResourceApi#updateRoleConfig");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
roleName String The role to modify.
body ApiConfigList Configuration changes. [optional]
message String Optional message describing the changes. [optional]

Return type

ApiConfigList

Authorization

basic

HTTP request headers