All URIs are relative to /api/v57
Method | HTTP request | Description |
---|---|---|
applyHostTemplate | POST /clusters/{clusterName}/hostTemplates/{hostTemplateName}/commands/applyHostTemplate | Applies a host template to a collection of hosts. |
createHostTemplates | POST /clusters/{clusterName}/hostTemplates | Creates new host templates. |
deleteHostTemplate | DELETE /clusters/{clusterName}/hostTemplates/{hostTemplateName} | Deletes a host template. |
readHostTemplate | GET /clusters/{clusterName}/hostTemplates/{hostTemplateName} | Retrieves information about a host template. |
readHostTemplates | GET /clusters/{clusterName}/hostTemplates | Lists all host templates in a cluster. |
reapplyHostTemplateOnHosts | POST /clusters/{clusterName}/hostTemplates/{hostTemplateName}/commands/reapplyHostTemplateOnHosts | Reapplies a host template on all the hosts associated with the host template. |
updateHostTemplate | PUT /clusters/{clusterName}/hostTemplates/{hostTemplateName} | Updates an existing host template. |
ApiCommand applyHostTemplate(clusterName, hostTemplateName, body, runConfigRules, startRoles)
Applies a host template to a collection of hosts.
Applies a host template to a collection of hosts. This will create a role for each role config group on each of the hosts.
The provided hosts must not have any existing roles on them and if the cluster is not using parcels, the hosts must have a CDH version matching that of the cluster version.
Available since API v3.
// 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.HostTemplatesResourceApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");
HostTemplatesResourceApi apiInstance = new HostTemplatesResourceApi();
String clusterName = "clusterName_example"; // String |
String hostTemplateName = "hostTemplateName_example"; // String | Host template to apply.
ApiHostRefList body = new ApiHostRefList(); // ApiHostRefList | List of hosts to apply the host template to.
Boolean runConfigRules = false; // Boolean | Whether to run the rules engine to automatically configure roles present on the hosts
Boolean startRoles = true; // Boolean | Whether to start the newly created roles or not.
try {
ApiCommand result = apiInstance.applyHostTemplate(clusterName, hostTemplateName, body, runConfigRules, startRoles);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HostTemplatesResourceApi#applyHostTemplate");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
clusterName | String | ||
hostTemplateName | String | Host template to apply. | |
body | ApiHostRefList | List of hosts to apply the host template to. | [optional] |
runConfigRules | Boolean | Whether to run the rules engine to automatically configure roles present on the hosts | [optional] [default to false] |
startRoles | Boolean | Whether to start the newly created roles or not. | [optional] |
ApiHostTemplateList createHostTemplates(clusterName, body)
Creates new host templates.
Creates new host templates.
Host template names must be unique across clusters.
Available since API v3.
// 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.HostTemplatesResourceApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");
HostTemplatesResourceApi apiInstance = new HostTemplatesResourceApi();
String clusterName = "clusterName_example"; // String |
ApiHostTemplateList body = new ApiHostTemplateList(); // ApiHostTemplateList | The list of host templates to create.
try {
ApiHostTemplateList result = apiInstance.createHostTemplates(clusterName, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HostTemplatesResourceApi#createHostTemplates");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
clusterName | String | ||
body | ApiHostTemplateList | The list of host templates to create. | [optional] |
ApiHostTemplate deleteHostTemplate(clusterName, hostTemplateName)
Deletes a host template.
Deletes a host template.
Available since API v3.
// 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.HostTemplatesResourceApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");
HostTemplatesResourceApi apiInstance = new HostTemplatesResourceApi();
String clusterName = "clusterName_example"; // String |
String hostTemplateName = "hostTemplateName_example"; // String | Host template to delete.
try {
ApiHostTemplate result = apiInstance.deleteHostTemplate(clusterName, hostTemplateName);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HostTemplatesResourceApi#deleteHostTemplate");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
clusterName | String | ||
hostTemplateName | String | Host template to delete. |
ApiHostTemplate readHostTemplate(clusterName, hostTemplateName)
Retrieves information about a host template.
Retrieves information about a host template.
Available since API v3.
// 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.HostTemplatesResourceApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");
HostTemplatesResourceApi apiInstance = new HostTemplatesResourceApi();
String clusterName = "clusterName_example"; // String |
String hostTemplateName = "hostTemplateName_example"; // String |
try {
ApiHostTemplate result = apiInstance.readHostTemplate(clusterName, hostTemplateName);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HostTemplatesResourceApi#readHostTemplate");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
clusterName | String | ||
hostTemplateName | String |
ApiHostTemplateList readHostTemplates(clusterName)
Lists all host templates in a cluster.
Lists all host templates in a cluster.
Available since API v3.
// 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.HostTemplatesResourceApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");
HostTemplatesResourceApi apiInstance = new HostTemplatesResourceApi();
String clusterName = "clusterName_example"; // String |
try {
ApiHostTemplateList result = apiInstance.readHostTemplates(clusterName);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HostTemplatesResourceApi#readHostTemplates");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
clusterName | String |
ApiCommand reapplyHostTemplateOnHosts(clusterName, hostTemplateName, deleteRoles, startRoles)
Reapplies a host template on all the hosts associated with the host template.
Reapplies a host template on all the hosts associated with the host template. This will run apply host template command on the all the hosts using the host template .
Set deleteRoles to true to delete the roles on the associated hosts if RCG is missing from host template. Check host tags with name as _cldr_cm_host_template_name to find out hosts using with the host template.
Available since API v46.
// 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.HostTemplatesResourceApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");
HostTemplatesResourceApi apiInstance = new HostTemplatesResourceApi();
String clusterName = "clusterName_example"; // String |
String hostTemplateName = "hostTemplateName_example"; // String | Host template to apply.
Boolean deleteRoles = true; // Boolean | Whether to delete roles on host if RCG is deleted from host template .
Boolean startRoles = true; // Boolean | Whether to start the newly created roles or not.
try {
ApiCommand result = apiInstance.reapplyHostTemplateOnHosts(clusterName, hostTemplateName, deleteRoles, startRoles);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HostTemplatesResourceApi#reapplyHostTemplateOnHosts");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
clusterName | String | ||
hostTemplateName | String | Host template to apply. | |
deleteRoles | Boolean | Whether to delete roles on host if RCG is deleted from host template . | [optional] |
startRoles | Boolean | Whether to start the newly created roles or not. | [optional] |
ApiHostTemplate updateHostTemplate(clusterName, hostTemplateName, body)
Updates an existing host template.
Updates an existing host template.
Can be used to update the role config groups in a host template or rename it.
Available since API v3.
// 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.HostTemplatesResourceApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");
HostTemplatesResourceApi apiInstance = new HostTemplatesResourceApi();
String clusterName = "clusterName_example"; // String |
String hostTemplateName = "hostTemplateName_example"; // String | Host template with updated fields.
ApiHostTemplate body = new ApiHostTemplate(); // ApiHostTemplate |
try {
ApiHostTemplate result = apiInstance.updateHostTemplate(clusterName, hostTemplateName, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HostTemplatesResourceApi#updateHostTemplate");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
clusterName | String | ||
hostTemplateName | String | Host template with updated fields. | |
body | ApiHostTemplate | [optional] |