我正在尝试为这样的现有保护域创建时间表:
def createProtectionDomainsChedule(self,pdname):
#设置保护域的时间表
尝试:
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],“ crolup_schedule_uuid”:none,“ user_start_time_in_isecs”:15494777620000000l,“ is_rollup_sched”:none,none,“ pd_name”::none,“ type”:“ daily”,“ id”:“ 63C037E5-41E4-4630-8641-23509A5360AGG”,“ every_nth”:1}
protectionDomainurl = self.base_url+“/protection_domains/”+pdname+“/schedule”
serverResponse = self.session.post(protectionDomainurl,策略)
打印serverresponse.text
返回json.loads(serverresponse.text)
除例外为E:
ErrorHandler(E)
但是,这返回:
{“消息”:“意外字符('r'(代码114)):预期有效值(数字,字符串,数组,对象,'true','false'或null'或'null'),“ lated_message”:“java.io.ioexception:意外字符('r'(代码114)):期望有效值(数字,字符串,数组,对象,'true','false'或null')\ n \ tat com.nutanix。
我想知道有人有工作的例子吗?
谢谢!
米歇尔
最好的答案钱德鲁
\r\n
\r\nThe error may be caused by the payload getting passed in non-json format. This could be because you are not setting header \"content-type:application\/json\" or the data payload is being converted to string instead of being passed as dictionary.
\r\n
\r\nI tried your payload exactly and i'm able to successfully create the schedule","className":"post__content__best_answer"}">