Forum Discussion

rolf's avatar
rolf
Icon for Cirrus rankCirrus
May 12, 2020

AS3 L7 Policy

Hi there,

 

we are automating a service deployment using AS3. So fare I could address most of the needs but L7 policy.

Does somebody have a working AS3 L7 Policy which can be shared?

 

Would be great :)

 

Thanks,

Rolf

 

  • An example Policy:

    "example-forward_policy": {
    "class": "Endpoint_Policy",
    "rules": [{
      "name": "forward_to_pool",
      "conditions": [{
        "type": "httpUri",
        "path": {
          "operand": "starts-with",
          "values": ["/test1"]
        }
      }],
      "actions": [{
        "type": "forward",
        "event": "request",
        "select": {
          "pool": {
            "use": "example_pool"
          }
        }
      }]
    },{
      "name": "forward_to_pool2",
      "conditions": [{
        "type": "httpUri",
        "path": {
          "operand": "starts-with",
          "values": ["/test2"]
        }
      }],
      "actions": [{
        "type": "forward",
        "event": "request",
        "select": {
          "pool": {
            "use": "example_pool2"
          }
        }
      }]
    }
    ],
    "strategy": "first-match"
    }

    This can be used in a AS3 configuration