f5devcentral / f5-automation-config-converter

Convert BIG-IP configs to AS3 and DO declarations
https://clouddocs.f5.com/products/extensions/f5-automation-config-converter/latest/
Apache License 2.0
35 stars 13 forks source link

Add partial support for ltm data-group external #52

Closed jszczepanskif5 closed 3 years ago

jszczepanskif5 commented 3 years ago

Is your feature request related to a problem? Please describe.

In journeys app we'd like to allow migrating both internal and external data groups, since the required data is already present inside the ucs files. Internal ones are already supported by ACC, but the external ones are not, even though they do have AS3 support.

Currently trying to convert a ltm profile fix + ltm data-group external pair results in a broken reference - the converted profile will contain a "use": "externalDataGroup" entry, even though no such data-group gets added to the declaration.

Sample input:

ltm profile fix /datagroups/application_1/profileFIXcustom {
    app-service none
    defaults-from /Common/fix
    description none
    error-action drop-connection
    full-logon-parsing false
    message-log-publisher /Common/local-db-publisher
    quick-parsing true
    report-log-publisher /Common/local-db-publisher
    response-parsing true
    sender-tag-class {
        {
            sender-id RefExternalDG
            tag-map-class /Common/dataGroupRefExternal
        }
    }
    statistics-sample-interval 45
}
ltm data-group external /Common/dataGroupRefExternal {
    external-file-name /Common/dataGroupRefExternal
    type string
}
sys file data-group /Common/dataGroupRefExternal {
    cache-path /config/filestore/files_d/Common_d/data_group_d/:Common:dataGroupRefExternal_77847_1
    revision 1
    separator :
    source-path https://f5.com
    type string
}

Output as of 1.14.0

{
    "class": "ADC",
    "schemaVersion": "3.29.0",
    "id": "urn:uuid:9fa0646e-4fbb-43c9-9696-f2091bae9b39",
    "label": "Converted Declaration",
    "remark": "Auto-generated by AS3 Config Converter",
    "datagroups": {
        "class": "Tenant",
        "application_1": {
            "class": "Application",
            "template": "generic",
            "profileFIXcustom": {
                "parentProfile": {
                    "bigip": "/Common/fix"
                },
                "remark": "none",
                "errorAction": "drop-connection",
                "fullLogonParsingEnabled": false,
                "messageLogPublisher": {
                    "bigip": "/Common/local-db-publisher"
                },
                "quickParsingEnabled": true,
                "reportLogPublisher": {
                    "bigip": "/Common/local-db-publisher"
                },
                "responseParsingEnabled": true,
                "senderTagMappingList": [
                    {
                        "senderId": "RefExternalDG",
                        "tagDataGroup": {
                            "use": "/Common/Shared/dataGroupRefExternal"
                        }
                    }
                ],
                "statisticsSampleInterval": 45,
                "class": "FIX_Profile"
            }
        }
    }
}

Describe the solution you'd like

While sys file data-group is not supported by AS3 (there's no way to include the file contents inside a declaration, i think), it would be possible to add an ltm data-group external object with a reference to a file that would need to be created manually on destination BIG-IP before deploying the declaration itself.

<...>
                "dataGroupRefExternal": {
                    "dataGroupFile": {
                        "bigip": "/Common/dataGroupRefExternal"
                    },
                    "storageType": "external",
                    "keyDataType": "string",
                    "class": "Data_Group"
                }
<...>

Describe alternatives you've considered

I don't really see any other alternatives right now other than just ignoring these fields, which probably wouldn't be surprising - I'm not sure if adding a field that is expected to be deployed manually beforehands like suggested above is a valid usecase for ACC.

mdditt2000 commented 3 years ago

Filed internal Jira CHARON-450. Simular to issue https://github.com/f5devcentral/f5-as3-config-converter/issues/51

mdditt2000 commented 3 years ago

Resolved