Support Questions
Find answers, ask questions, and share your expertise

replication schedule by python API

replication schedule by python API

New Contributor


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


Re: replication schedule by python API

Rising Star

Hello @AK_ 


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


I hope this helps.





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.