I'm trying to create a schedule for an existing Protection Domain like this:
code:
def createProtectionDomainSchedule(self,pdname):
# Set the schedule for the protection domain
try:
policy = {"retention_policy": {"remote_retention_type": None, "remote_max_snapshots": {}, "local_retention_period": None, "local_max_snapshots": 1, "remote_retention_period": {}, "local_retention_type": None}, "start_times_in_usecs": [1549477620000000L], "rollup_schedule_uuid": None, "user_start_time_in_usecs": 1549477620000000L, "is_rollup_sched": None, "pd_name": pdname, "values": None, "suspended": False, "app_consistent": False, "end_time_in_usecs": None, "type": "DAILY", "id": "63c037e5-41e4-4630-8641-23509a5360a1gg", "every_nth": 1}
protectionDomainURL = self.base_url + "/protection_domains/"+pdname+"/schedules"
serverResponse = self.session.post(protectionDomainURL, policy )
print serverResponse.text
return json.loads(serverResponse.text)
except Exception as e:
errorhandler(e)
However, this returns:
{"message":"Unexpected character ('r' (code 114)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')","detailed_message":"java.io.IOException: Unexpected character ('r' (code 114)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n\tat com.nutanix.prism.web.providers.ProtobufJsonProvider.getInputObject(ProtobufJsonProvider.java:204)\n\tat
I'm wondering if someone has a working example to do this?
Thanks!
Michel