cm_client.WatchedDirResourceApi

All URIs are relative to https://localhost/api/v33

Method HTTP request Description
add_watched_directory POST /clusters/{clusterName}/services/{serviceName}/watcheddir Adds a directory to the watching list.
list_watched_directories GET /clusters/{clusterName}/services/{serviceName}/watcheddir Lists all the watched directories.
remove_watched_directory DELETE /clusters/{clusterName}/services/{serviceName}/watcheddir/{directoryPath} Removes a directory from the watching list.

add_watched_directory

ApiWatchedDir add_watched_directory(cluster_name, service_name, body=body)

Adds a directory to the watching list.

Adds a directory to the watching list.

Available since API v14. Only available with Cloudera Manager Enterprise Edition.

Example

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.WatchedDirResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
service_name = 'service_name_example' # str | The service name.
body = cm_client.ApiWatchedDir() # ApiWatchedDir | The directory to be added. (optional)

try:
    # Adds a directory to the watching list.
    api_response = api_instance.add_watched_directory(cluster_name, service_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WatchedDirResourceApi->add_watched_directory: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
service_name str The service name.
body ApiWatchedDir The directory to be added. [optional]

Return type

ApiWatchedDir

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_watched_directories

ApiWatchedDirList list_watched_directories(cluster_name, service_name)

Lists all the watched directories.

Lists all the watched directories.

Available since API v14. Only available with Cloudera Manager Enterprise Edition.

Example

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.WatchedDirResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
service_name = 'service_name_example' # str | The service name.

try:
    # Lists all the watched directories.
    api_response = api_instance.list_watched_directories(cluster_name, service_name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WatchedDirResourceApi->list_watched_directories: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
service_name str The service name.

Return type

ApiWatchedDirList

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

remove_watched_directory

ApiWatchedDir remove_watched_directory(cluster_name, directory_path, service_name)

Removes a directory from the watching list.

Removes a directory from the watching list.

Available since API v14. Only available with Cloudera Manager Enterprise Edition.

Example

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.WatchedDirResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
directory_path = 'directory_path_example' # str | The directory path to be removed.
service_name = 'service_name_example' # str | The service name.

try:
    # Removes a directory from the watching list.
    api_response = api_instance.remove_watched_directory(cluster_name, directory_path, service_name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WatchedDirResourceApi->remove_watched_directory: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
directory_path str The directory path to be removed.
service_name str The service name.

Return type

ApiWatchedDir

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]