AnsweredAssumed Answered

Setting default rule behaviors?

Question asked by Szymon Jakubowski Employee on Oct 26, 2016
Latest reply on Oct 27, 2016 by Szymon Jakubowski

I can't seem to get it working:

 

update_rules_json = {
"ruleFormat" : "latest",
"rules" : {
"behaviors'" : [
{
"uuid" : "",
"name" : "origin",
"options" : {
"cacheKeyHostname" : "REQUEST_HOST_HEADER",
"forwardHostHeader" : "REQUEST_HOST_HEADER",
"hostname" : "www.akamaiflowershop.com",
"compress" : "True",
"httpPort" : "80",
"enableTrueClientIp" : "False",
"originType" : "CUSTOMER" }
},
{
"uuid" : "",
"name" : "cpCode",
"options" : {
"value" : {
"createdDate" : "1475598587000",
"products" : [
"Site_Defender"
],
"id" : "505266",
"name" : "pep-ksd-aku",
"description" : "pep-ksd-aku"
}
}
}
],
"name" : "default",
"variables" : [],
"comments" : "",
"children" : [],
"uuid" : "default"
}
}

 

 

updating headers:

 

s.headers.update({
"Content-Type" : "application/vnd.akamai.papirules.latest+json"
})

 

getting:

 

{u'errors': [{u'errorLocation': u'#/rules', u'type': u'https://problems.luna.akamaiapis.net/papi/v0/validation/required_feature', u'detail': u'In order for this property to work correctly behavior Content Provider Code needs to be present in the default section.'}, {u'errorLocation': u'#/rules', u'type': u'https://problems.luna.akamaiapis.net/papi/v0/validation/required_feature', u'detail': u'In order for this property to work correctly behavior Origin Server needs to be present in the default section.'}],

 

I tried looking at the Site Defender latest schema but I'm lost.

 

Anyone can help?

 

Thanks!

Outcomes