The advanced features need to be customized separately for each property in which they appear. To address this issue, PAPI's alternative custom features are defined outside the rule tree. You can reference these common objects from within many different rule trees.
Suppose you have an advanced
behavior whose xml
does something useful:
{
"name": "advanced",
"uuid": "6c192451-f35f-4a8d-ad70-0e8fec521d99",
"options": {
"description": "Setting custom download receipt. Uses PMUSER_LOG variable.",
"xml": "<reporting:edge-logging.send-receipt name=\"DLR\"><hostname>logs.customer.com</hostname><url>/dlr</url><allow-cacheh>off</allow-cacheh><status>on</status><port>443</port><format>stuff=%(PMUSER_LOG)&time=%t&url=%u</format><method>POST</method></reporting:edge-logging.send-receipt>"
}
}
To apply it to many properties, contact your Akamai representative to configure the XML as a custom behavior. Once ready, you run the List custom behaviors operation, choose the appropriate custom behavior, and store its behaviorId
value:
{
"accountId": "act_1-1TJZFB",
"customBehaviors": {
"items": [
{
"behaviorId": "cbe_12345",
"name": "DLR",
"displayName": "Custom Download Receipt",
"description": "Setting custom download receipt. Uses PMUSER_LOG variable.",
"status": "ACTIVE",
"xml": "<reporting:edge-logging.send-receipt name=\"DLR\"><hostname>logs.customer.com</hostname><url>/dlr</url><allow-cacheh>off</allow-cacheh><status>on</status><port>443</port><format>stuff=%(PMUSER_LOG)&time=%t&url=%u</format><method>POST</method></reporting:edge-logging.send-receipt>",
"updatedDate": "2017-04-24T12:34:56Z",
"updatedByUser": "jsikkela"
}
]
}
}
You can then insert a customBehavior
to reference the common metadata from within any rule tree, with no need to preserve a uuid
value when exchanging the rule:
{
"name": "customBehavior",
"options": {
"behaviorId": "cbe_12345",
"name": "mdc"
}
}
Custom overrides work much the same way as custom behaviors, but are meant to execute last in the rule tree, typically to restore some state that the rule tree may have modified along the way. Your Akamai representative creates a custom override on your behalf, which you then access with the List custom overrides operation. After choosing an overrideId
from the list, you insert it into a customOverride
region directly on the outer rule object:
{
"rules": {
"name": "default",
"options": {
"is_secure": false
}
},
"customOverride": {
"overrideId": "cbo_12345",
"name": "mdc"
}
}