# CertManagerResourceApi

All URIs are relative to *https://localhost/api/v50*

Method | HTTP request | Description
------------- | ------------- | -------------
[**generateCertificate**](CertManagerResourceApi.md#generateCertificate) | **POST** /certs/generateCertificate | Exchange a cert request token for a certificate.
[**getTruststore**](CertManagerResourceApi.md#getTruststore) | **GET** /certs/truststore | Gets the Auto-TLS truststore contents.
[**getTruststorePassword**](CertManagerResourceApi.md#getTruststorePassword) | **GET** /certs/truststorePassword | Gets the configured CM truststore password.


<a name="generateCertificate"></a>
# **generateCertificate**
> File generateCertificate(body)

Exchange a cert request token for a certificate.

Exchange a cert request token for a certificate. The token must be a valid token generated by the certmanager utility. The resulting certificate will containin a TLS certificate in JKS and PEM formats. It might optionally contain a private key in JKS and PEM format, corresponding to the certificate.  The tar file is designed to be consumed by the \"cm install_certs\" command to install TLS certificates on a Cloudera Manager agent host.

### Example
```java
// 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.CertManagerResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

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

CertManagerResourceApi apiInstance = new CertManagerResourceApi();
ApiCertificateRequest body = new ApiCertificateRequest(); // ApiCertificateRequest | 
try {
    File result = apiInstance.generateCertificate(body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CertManagerResourceApi#generateCertificate");
    e.printStackTrace();
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**ApiCertificateRequest**](ApiCertificateRequest.md)|  | [optional]

### Return type

[**File**](File.md)

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/octet-stream

<a name="getTruststore"></a>
# **getTruststore**
> File getTruststore(type)

Gets the Auto-TLS truststore contents.

Gets the Auto-TLS truststore contents

### Example
```java
// 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.CertManagerResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

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

CertManagerResourceApi apiInstance = new CertManagerResourceApi();
String type = "type_example"; // String | truststore type. Must be \"JKS\" or \"PEM\".
try {
    File result = apiInstance.getTruststore(type);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CertManagerResourceApi#getTruststore");
    e.printStackTrace();
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **type** | **String**| truststore type. Must be \"JKS\" or \"PEM\". | [optional]

### Return type

[**File**](File.md)

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/octet-stream

<a name="getTruststorePassword"></a>
# **getTruststorePassword**
> String getTruststorePassword()

Gets the configured CM truststore password.

Gets the configured CM truststore password

### Example
```java
// 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.CertManagerResourceApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

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

CertManagerResourceApi apiInstance = new CertManagerResourceApi();
try {
    String result = apiInstance.getTruststorePassword();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling CertManagerResourceApi#getTruststorePassword");
    e.printStackTrace();
}
```

### Parameters
This endpoint does not need any parameter.

### Return type

**String**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: text/plain

