Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing 'type' for Policy_Condition #104

Open
zongzw opened this issue Feb 18, 2024 · 0 comments
Open

Missing 'type' for Policy_Condition #104

zongzw opened this issue Feb 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@zongzw
Copy link

zongzw commented Feb 18, 2024

Environment

  • ACC Version: latest, 1.24.0 1.23.4
  • AS3 Version: 3.47.0 3.31.0
  • BIG-IP Version: 17.x

Summary

The generated AS3 declaration cannot be deployed to BIG-IP via AS3, reporting:

{
  "code": 422,
  "errors": [
    "/cis-c-tenant_1/application_1/mypolicy/rules/0/conditions/0: should have required property 'type'"
  ],
  "declarationFullId": "",
  "message": "declaration is invalid"
}

Is there any code update needed for ACC to compat Endpoint_Policy?

Steps To Reproduce

  1. Use the following command to convert .ucs to per-app AS3 declaration.

docker run --rm -v "$PWD":/app/data f5devcentral/f5-automation-config-converter:latest --ucs /app/data/vs-with-policy.ucs

vs-with-policy.ucs is a ucs file which contains a simple virtual and its depending policy:

the policy part looks like:

#TMSH-VERSION: 17.1.0.2

ltm node /cis-c-tenant/10.250.11.185 {
    address 10.250.11.185
}
ltm policy /cis-c-tenant/mypolicy {
    requires { http }
    rules {
        myrule {
            actions {
                0 {
                    http
                    enable
                }
            }
            conditions {
                0 {
                    http-host
                    starts-with
                    values { 1.1.1.1 }
                }
            }
        }
    }
    strategy /Common/first-match
}
ltm pool /cis-c-tenant/mypool {
    members {
        /cis-c-tenant/10.250.11.185:80 {
            address 10.250.11.185
        }
    }
    monitor /Common/http
}
ltm virtual /cis-c-tenant/myvs {
    creation-time 2024-02-01:02:34:42
    destination /cis-c-tenant/172.18.0.201:80
    ip-protocol tcp
    last-modified-time 2024-02-03:17:33:01
    mask 255.255.255.255
    policies {
        /cis-c-tenant/mypolicy { }
    }
    pool /cis-c-tenant/mypool
    profiles {
        /Common/http { }
        /Common/tcp { }
    }
    serverssl-use-sni disabled
    source 0.0.0.0/0
    source-address-translation {
        type automap
    }
    translate-address enabled
    translate-port enabled
}
ltm virtual-address /cis-c-tenant/172.18.0.201 {
    address 172.18.0.201
    arp enabled
    icmp-echo enabled
    mask 255.255.255.255
    traffic-group /Common/traffic-group-1
}
  1. The generated AS3 body is:
{
  "class": "ADC",
  "schemaVersion": "3.23.0",
  "id": "urn:uuid:55839454-8971-4a82-a09b-4570171c3d78",
  "label": "Converted Declaration",
  "remark": "Generated by JOURNEYS",
  "cis-c-tenant_1": {
    "class": "Tenant",
    "application_1": {
      "myvs": {
        "pool": "mypool",
        "snat": "auto",
        "class": "Service_HTTP",
        "layer4": "tcp",
        "profileTCP": {
          "bigip": "/Common/tcp"
        },
        "profileHTTP": {
          "bigip": "/Common/http"
        },
        "policyEndpoint": "/cis-c-tenant_1/application_1/mypolicy",
        "virtualAddresses": [
          "172.18.0.201"
        ],
        "translateServerPort": true,
        "translateServerAddress": true
      },
      "class": "Application",
      "mypool": {
        "class": "Pool",
        "members": [
          {
            "shareNodes": true,
            "servicePort": 80,
            "serverAddresses": [
              "10.250.11.185"
            ],
            "addressDiscovery": "static"
          }
        ],
        "monitors": [
          {
            "bigip": "/Common/http"
          }
        ]
      },
      "mypolicy": {
        "class": "Endpoint_Policy",
        "rules": [
          {
            "name": "myrule",
            "actions": [
              {
                "type": "http",
                "event": "request",
                "enabled": true
              }
            ],
            "conditions": [
              {                                                    # missing "type": "httpHost",
                "all": {
                  "values": [
                    "1.1.1.1"
                  ],
                  "operand": "starts-with"
                },
                "event": "request"
              }
            ]
          }
        ],
        "strategy": "first-match"
      },
      "template": "generic"
    }
  }
}

where, the conditions[0], should contain "type": "httpHost",, but no.

It cause the deployment fails, when I added it manually, it succeed for deployment.

@zongzw zongzw added the bug Something isn't working label Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant