cm_client.ReplicationsResourceApi

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

Method HTTP request Description
collect_diagnostic_data POST /clusters/{clusterName}/services/{serviceName}/replications/{scheduleId}/collectDiagnosticData Collect diagnostic data for a schedule, optionally for a subset of commands on that schedule, matched by schedule ID.
create_schedules POST /clusters/{clusterName}/services/{serviceName}/replications Creates one or more replication schedules.
delete_all_schedules DELETE /clusters/{clusterName}/services/{serviceName}/replications Deletes all existing replication schedules.
delete_schedule DELETE /clusters/{clusterName}/services/{serviceName}/replications/{scheduleId} Deletes an existing replication schedule.
get_replication_state GET /clusters/{clusterName}/services/{serviceName}/replications/replicationState returns the replication state.
read_history GET /clusters/{clusterName}/services/{serviceName}/replications/{scheduleId}/history Returns a list of commands triggered by a schedule.
read_schedule GET /clusters/{clusterName}/services/{serviceName}/replications/{scheduleId} Returns information for a specific replication schedule.
read_schedules GET /clusters/{clusterName}/services/{serviceName}/replications Returns information for all replication schedules.
reschedule_hive3_replication_metrics_getter POST /clusters/{clusterName}/services/{serviceName}/replications/rescheduleHive3ReplicationMetricsGetter Set the Hive3 Replication Metrics Getter next start time.
run_copy_listing POST /clusters/{clusterName}/services/{serviceName}/replications/hdfsCopyListing Run the hdfs copy listing command.
run_h_base_replication_security_tool POST /clusters/{clusterName}/services/{serviceName}/replications/hbaseReplicationSecurityTool Run the hbase replication security tool.
run_hive_replication_query POST /clusters/{clusterName}/services/{serviceName}/replications/hiveReplicationQuery Execute a hive replication query on local HS2 service instance.
run_schedule POST /clusters/{clusterName}/services/{serviceName}/replications/{scheduleId}/run Run the schedule immediately.
update_schedule PUT /clusters/{clusterName}/services/{serviceName}/replications/{scheduleId} Updates an existing replication schedule.

collect_diagnostic_data

ApiCommand collect_diagnostic_data(cluster_name, schedule_id, service_name, view=view, body=body)

Collect diagnostic data for a schedule, optionally for a subset of commands on that schedule, matched by schedule ID.

Collect diagnostic data for a schedule, optionally for a subset of commands on that schedule, matched by schedule ID. The returned command's resultDataUrl property, upon the commands completion, will refer to the generated diagnostic data. Available since API v11.

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.ReplicationsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
schedule_id = 56 # int | Schedule ID
service_name = 'service_name_example' # str | The service name.
view = 'summary' # str | view to materialize (optional) (default to summary)
body = cm_client.ApiReplicationDiagnosticsCollectionArgs() # ApiReplicationDiagnosticsCollectionArgs | Replication collection arguments (optional)

try:
    # Collect diagnostic data for a schedule, optionally for a subset of commands on that schedule, matched by schedule ID.
    api_response = api_instance.collect_diagnostic_data(cluster_name, schedule_id, service_name, view=view, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReplicationsResourceApi->collect_diagnostic_data: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
schedule_id int Schedule ID
service_name str The service name.
view str view to materialize [optional] [default to summary]
body ApiReplicationDiagnosticsCollectionArgs Replication collection arguments [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

create_schedules

ApiReplicationScheduleList create_schedules(cluster_name, service_name, body=body)

Creates one or more replication schedules.

Creates one or more replication schedules.

Available since API v3. 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.ReplicationsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
service_name = 'service_name_example' # str | The service name.
body = cm_client.ApiReplicationScheduleList() # ApiReplicationScheduleList | List of the replication schedules to create. (optional)

try:
    # Creates one or more replication schedules.
    api_response = api_instance.create_schedules(cluster_name, service_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReplicationsResourceApi->create_schedules: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
service_name str The service name.
body ApiReplicationScheduleList List of the replication schedules to create. [optional]

Return type

ApiReplicationScheduleList

Authorization

basic

HTTP request headers

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

delete_all_schedules

ApiReplicationScheduleList delete_all_schedules(cluster_name, service_name)

Deletes all existing replication schedules.

Deletes all existing replication schedules.

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

try:
    # Deletes all existing replication schedules.
    api_response = api_instance.delete_all_schedules(cluster_name, service_name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReplicationsResourceApi->delete_all_schedules: %s\n" % e)

Parameters

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

Return type

ApiReplicationScheduleList

Authorization

basic

HTTP request headers

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

delete_schedule

ApiReplicationSchedule delete_schedule(cluster_name, schedule_id, service_name)

Deletes an existing replication schedule.

Deletes an existing replication schedule.

Available since API v3. 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.ReplicationsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
schedule_id = 56 # int | Id of an existing replication schedule.
service_name = 'service_name_example' # str | The service name.

try:
    # Deletes an existing replication schedule.
    api_response = api_instance.delete_schedule(cluster_name, schedule_id, service_name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReplicationsResourceApi->delete_schedule: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
schedule_id int Id of an existing replication schedule.
service_name str The service name.

Return type

ApiReplicationSchedule

Authorization

basic

HTTP request headers

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

get_replication_state

ApiReplicationState get_replication_state(cluster_name, service_name, view=view)

returns the replication state.

returns the replication state. for example if incremental export is enabled, etc

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.ReplicationsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
service_name = 'service_name_example' # str | The service name.
view = 'summary' # str | view to materialize (optional) (default to summary)

try:
    # returns the replication state.
    api_response = api_instance.get_replication_state(cluster_name, service_name, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReplicationsResourceApi->get_replication_state: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
service_name str The service name.
view str view to materialize [optional] [default to summary]

Return type

ApiReplicationState

Authorization

basic

HTTP request headers

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

read_history

ApiReplicationCommandList read_history(cluster_name, schedule_id, service_name, limit=limit, offset=offset, view=view)

Returns a list of commands triggered by a schedule.

Returns a list of commands triggered by a schedule.

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.ReplicationsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
schedule_id = 56 # int | Id of an existing replication schedule.
service_name = 'service_name_example' # str | The service name.
limit = 20 # int | Maximum number of commands to retrieve. (optional) (default to 20)
offset = 0 # int | Index of first command to retrieve. (optional) (default to 0)
view = 'summary' # str | The view to materialize. (optional) (default to summary)

try:
    # Returns a list of commands triggered by a schedule.
    api_response = api_instance.read_history(cluster_name, schedule_id, service_name, limit=limit, offset=offset, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReplicationsResourceApi->read_history: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
schedule_id int Id of an existing replication schedule.
service_name str The service name.
limit int Maximum number of commands to retrieve. [optional] [default to 20]
offset int Index of first command to retrieve. [optional] [default to 0]
view str The view to materialize. [optional] [default to summary]

Return type

ApiReplicationCommandList

Authorization

basic

HTTP request headers

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

read_schedule

ApiReplicationSchedule read_schedule(cluster_name, schedule_id, service_name, view=view)

Returns information for a specific replication schedule.

Returns information for a specific replication schedule.

Available since API v3. 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.ReplicationsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
schedule_id = 56 # int | Id of an existing replication schedule.
service_name = 'service_name_example' # str | The service name.
view = 'summary' # str | The view to materialize. (optional) (default to summary)

try:
    # Returns information for a specific replication schedule.
    api_response = api_instance.read_schedule(cluster_name, schedule_id, service_name, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReplicationsResourceApi->read_schedule: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
schedule_id int Id of an existing replication schedule.
service_name str The service name.
view str The view to materialize. [optional] [default to summary]

Return type

ApiReplicationSchedule

Authorization

basic

HTTP request headers

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

read_schedules

ApiReplicationScheduleList read_schedules(cluster_name, service_name, view=view)

Returns information for all replication schedules.

Returns information for all replication schedules.

Available since API v32.

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.ReplicationsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
service_name = 'service_name_example' # str | The service name.
view = 'summary' # str | provides summary or detailed view, default is summary (optional) (default to summary)

try:
    # Returns information for all replication schedules.
    api_response = api_instance.read_schedules(cluster_name, service_name, view=view)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReplicationsResourceApi->read_schedules: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
service_name str The service name.
view str provides summary or detailed view, default is summary [optional] [default to summary]

Return type

ApiReplicationScheduleList

Authorization

basic

HTTP request headers

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

reschedule_hive3_replication_metrics_getter

bool reschedule_hive3_replication_metrics_getter(cluster_name, service_name, next_start_mins=next_start_mins)

Set the Hive3 Replication Metrics Getter next start time.

Set the Hive3 Replication Metrics Getter next start time.

(Re)set the Hive3 Replication Metrics Getter next start time. Should be only used if the Getter needs to be manually started.

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.ReplicationsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
service_name = 'service_name_example' # str | The service name.
next_start_mins = 5 # int |  (optional) (default to 5)

try:
    # Set the Hive3 Replication Metrics Getter next start time.
    api_response = api_instance.reschedule_hive3_replication_metrics_getter(cluster_name, service_name, next_start_mins=next_start_mins)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReplicationsResourceApi->reschedule_hive3_replication_metrics_getter: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
service_name str The service name.
next_start_mins int [optional] [default to 5]

Return type

bool

Authorization

basic

HTTP request headers

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

run_copy_listing

ApiCommand run_copy_listing(cluster_name, service_name, body=body)

Run the hdfs copy listing command.

Run the hdfs copy listing command

The copy listing command will be triggered with the provided arguments

Available since API v18. 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.ReplicationsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
service_name = 'service_name_example' # str | The service name.
body = 'body_example' # str |  (optional)

try:
    # Run the hdfs copy listing command.
    api_response = api_instance.run_copy_listing(cluster_name, service_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReplicationsResourceApi->run_copy_listing: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
service_name str The service name.
body str [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

run_h_base_replication_security_tool

ApiCommand run_h_base_replication_security_tool(cluster_name, service_name, body=body)

Run the hbase replication security tool.

Run the hbase replication security tool

The replication security tool is invoked against the provided arguments

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

try:
    # Run the hbase replication security tool.
    api_response = api_instance.run_h_base_replication_security_tool(cluster_name, service_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReplicationsResourceApi->run_h_base_replication_security_tool: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
service_name str The service name.
body object [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

run_hive_replication_query

ApiCommand run_hive_replication_query(cluster_name, service_name, body=body)

Execute a hive replication query on local HS2 service instance.

Execute a hive replication query on local HS2 service instance

The command executes hive replication query on local HS2 instance with the provided arguments

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

try:
    # Execute a hive replication query on local HS2 service instance.
    api_response = api_instance.run_hive_replication_query(cluster_name, service_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReplicationsResourceApi->run_hive_replication_query: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
service_name str The service name.
body ApiHive3ReplicationArguments [optional]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

run_schedule

ApiCommand run_schedule(cluster_name, schedule_id, service_name, dry_run=dry_run)

Run the schedule immediately.

Run the schedule immediately.

The replication command will be triggered with the configured arguments, and will be recorded in the schedule's history.

Available since API v3. 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.ReplicationsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
schedule_id = 56 # int | Id of an existing replication schedule.
service_name = 'service_name_example' # str | The service name.
dry_run = false # bool | Whether to execute a dry run. (optional) (default to false)

try:
    # Run the schedule immediately.
    api_response = api_instance.run_schedule(cluster_name, schedule_id, service_name, dry_run=dry_run)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReplicationsResourceApi->run_schedule: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
schedule_id int Id of an existing replication schedule.
service_name str The service name.
dry_run bool Whether to execute a dry run. [optional] [default to false]

Return type

ApiCommand

Authorization

basic

HTTP request headers

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

update_schedule

ApiReplicationSchedule update_schedule(cluster_name, schedule_id, service_name, body=body)

Updates an existing replication schedule.

Updates an existing replication schedule.

Available since API v3. 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.ReplicationsResourceApi(cm_client.ApiClient(configuration))
cluster_name = 'cluster_name_example' # str | 
schedule_id = 56 # int | Id of an existing replication schedule.
service_name = 'service_name_example' # str | The service name.
body = cm_client.ApiReplicationSchedule() # ApiReplicationSchedule |  (optional)

try:
    # Updates an existing replication schedule.
    api_response = api_instance.update_schedule(cluster_name, schedule_id, service_name, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReplicationsResourceApi->update_schedule: %s\n" % e)

Parameters

Name Type Description Notes
cluster_name str
schedule_id int Id of an existing replication schedule.
service_name str The service name.
body ApiReplicationSchedule [optional]

Return type

ApiReplicationSchedule

Authorization

basic

HTTP request headers

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