# cm_client.CertManagerResourceApi

All URIs are relative to */api/v57*

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

<a name="generate_certificate" id="generate_certificate"></a>
# **generate_certificate**
> str generate_certificate(body=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
```python
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.CertManagerResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiCertificateRequest() # ApiCertificateRequest |  (optional)

try:
    # Exchange a cert request token for a certificate.
    api_response = api_instance.generate_certificate(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CertManagerResourceApi->generate_certificate: %s\n" % e)
```

### Parameters

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

### Return type

**str**

### Authorization

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

### HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

<a name="get_truststore" id="get_truststore"></a>
# **get_truststore**
> str get_truststore(type=type)

Gets the Auto-TLS truststore contents.

Gets the Auto-TLS truststore contents

### Example
```python
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.CertManagerResourceApi(cm_client.ApiClient(configuration))
type = 'type_example' # str | truststore type. Must be \"JKS\" or \"PEM\". (optional)

try:
    # Gets the Auto-TLS truststore contents.
    api_response = api_instance.get_truststore(type=type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CertManagerResourceApi->get_truststore: %s\n" % e)
```

### Parameters

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

### Return type

**str**

### Authorization

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

### HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

<a name="get_truststore_password" id="get_truststore_password"></a>
# **get_truststore_password**
> str get_truststore_password()

Gets the configured CM truststore password.

Gets the configured CM truststore password

### Example
```python
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = cm_client.CertManagerResourceApi(cm_client.ApiClient(configuration))

try:
    # Gets the configured CM truststore password.
    api_response = api_instance.get_truststore_password()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling CertManagerResourceApi->get_truststore_password: %s\n" % e)
```

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

### Return type

**str**

### Authorization

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

### HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

