Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

replication schedule by python API

Highlighted

replication schedule by python API

New Contributor

Hi,

Please suggest how to do replication schedule with python mode cm_client. I tried with cm_api code as below

hdfs = api_root.get_cluster(CLUSTER_NAME).get_service(HDFS_NAME)
hdfs_cloud_args = ApiHdfsCloudReplicationArguments(None)hdfs_cloud_args.sourceService = ApiServiceRef(None,                                peerName=None,                                clusterName=CLUSTER_NAME,                                serviceName=HDFS_NAME)hdfs_cloud_args.sourcePath = '/src/path'hdfs_cloud_args.destinationPath = 's3a://bucket/target/path/'hdfs_cloud_args.destinationAccount = CLOUD_ACCOUNT
hdfs_cloud_args.mapreduceServiceName = YARN_SERVICE
schedule = hdfs.create_replication_schedule(start, end, "DAY", 1, True, hdfs_args)

I am using python 2.7.5. This code is not working and shows no attribute errors.

Thanks in advance

1 REPLY 1
Highlighted

Re: replication schedule by python API

Cloudera Employee

Hello @AK_ 

 

You can use the below documentation to automate BDR replication. The documentation includes an example to demonstrate this

https://docs.cloudera.com/documentation/enterprise/latest/topics/cm_bdr_howto_api.html

 

I hope this helps.

 

Regards,

Tarun

 

Was your question answered? Make sure to mark the answer as the accepted solution.

If you find a reply useful, say thanks by clicking on the thumbs up button.

Don't have an account?
Coming from Hortonworks? Activate your account here