Screen Shot - Property Manager Variables

Announcing Property Manager Variables

December 20, 2016 · by Jay Sikkeland

Property Manager now includes support for variables, providing additional control and self serviceability. Variables work with all Akamai products that are configured using Property Manager, and are fully supported by the Property Manager API (PAPI).

If you’ve done any kind of programming and have some experience with the Property Manager configuration tool, you’ll find variables fairly intuitive. Typical uses for variables include:


  • Simplify configurations by reducing the number of rules and behaviors.
  • Improve self serviceability by replacing or extending advanced metadata.
  • Automate redirects, forward path rewrites, HTTP header and cookie manipulation.
  • Move origin functionality to the edge.


In this blog post I’ll show you a use case that sets Property Manager variables in the user interface, and then for API developers, I’ll show you a snippet that does the same thing in code.


Example Use Case - Replace Query String Value using Regex


In this example, I’m going to replace the value of an incoming request query string "foo" with some arbitrary value, and then issue a 302 redirect to the new url. Surprisingly, I’ll use the value “bar” in this example, but it could be anything, including a variable.


  • Incoming URL:  /something?a=0&foo=123&b=1
  • Redirect to:  /something?a=0&foo=bar&b=1


To implement the redirect, I’ll make use of the following:


  • {{variable}} is used to insert variables into the regular Property Manager Redirect behaviors. The variables are evaluated in real time for each incoming request.
  • {{builtin.AK_URL}} is used for built-in variables, and in this example, has the original incoming url.
  • {{user.PMUSER_URL}} is used for user-defined variables, and will have the resulting redirect location.


In the example below, I define a new Set Variable behavior that will be used to populate the PMUSER_URL variable using a regular expression (^|&|\?)foo=(?:(?!(&|$)).)* and replacement string $1foo=bar. (Note that typing in {{ in a field that supports variables will bring up a list of built-in and user defined variables to choose from.)


For the redirect, I use the user-defined variable {{user.PMUSER_URL}}, which has the resulting redirect location.



JSON Sample


For API developers, here is the corresponding Property Manager API (PAPI) intermediate JSON snippet.


"rules" : { "children" : [ { "name" : "UseCase03 - Regex Query String", "uuid" : "fba6a004-4fb6-4b01-81c7-8bd262943ad1", "behaviors" : [ { "name" : "setVariable", "options" : { "variableName" : "PMUSER_URL", "valueSource" : "EXPRESSION", "transform" : "SUBSTITUTE", "variableValue" : "{{builtin.AK_URL}}", "regex" : "(^|&|\\?)foo=(?:(?!(&|$)).)*", "replacement" : "$1foo=bar", "caseSensitive" : false, "globalSubstitution" : true }, "uuid" : "a77de527-8465-4917-95e9-13349e5b176d" }, { "name" : "redirect", "options" : { "mobileDefaultChoice" : "DEFAULT", "destinationProtocol" : "SAME_AS_REQUEST", "destinationHostname" : "SAME_AS_REQUEST", "destinationPath" : "OTHER", "queryString" : "IGNORE", "responseCode" : 302, "destinationPathOther" : "{{user.PMUSER_URL}}" }, "uuid" : "353b6499-faff-4ae3-9420-6e9926d478a2" } ], "children" : [ ], "criteria" : [ ], "criteriaMustSatisfy" : "all", "comments" : "Use regex (regular expressions) to replace the value of a query string \"foo\" and redirect to the resulting URL." } ], "options" : { }, "variables" : [ { "name" : "PMUSER_URL", "value" : "", "description" : "Redirect URL", "hidden" : false, "sensitive" : false } ],





I hope this blog post gives you some ideas on how you can use variables in Property Manager. This is just one use case, and I encourage you to get creative with yours. Some of our customers have found this feature to be both incredibly powerful, and given them the self serviceability to solve problems on their own.


Additional Resources


The primary reference documentation for variables is in the online help. From Property Manager, click any help button and search for “Working with Variables.”

There is also a Community blog post Using Variables with Property Manager, which has a few more detailed use cases, as well as comments from other users.

For API Developers and variable support, see the Property Manager API (PAPI).