F5Networks / f5-appsvcs-templates

F5 BIG-IP Application Service Templates (FAST)
Apache License 2.0
32 stars 13 forks source link

Documentation: Is "view" a reliable source for "parameters" #127

Closed simonkowallik closed 1 year ago

simonkowallik commented 1 year ago

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

Request for clarification.

When creating an application via the FAST API the "parameters" JSON object contains the data for the template to render the AS3 declaration.

Example:

{
    "name": "examples/simple_http",
    "parameters": {
        "tenant_name": "tenant1",
        "application_name": "appZ",
        "virtual_port": 1000,
        "virtual_address": "192.168.0.101",
        "server_port": 1000,
        "server_addresses": [
            "192.168.1.1"
        ]
    }
}

The response contains "parameters" as well:

{
    "code": 202,
    "requestId": 29,
    "message": [
        {
            "id": "1796e028-7dd3-48e6-ae9f-03f179a79369",
            "name": "examples/simple_http",
            "parameters": {
                "tenant_name": "tenant1",
                "application_name": "appZ",
                "virtual_port": 1000,
                "virtual_address": "192.168.0.101",
                "server_port": 1000,
                "server_addresses": [
                    "192.168.1.1"
                ]
            }
        }
    ],
    "_links": {
        "self": "/mgmt/shared/fast/applications",
        "task": "/mgmt/shared/fast/tasks/1796e028-7dd3-48e6-ae9f-03f179a79369"
    }
}

When querying the specific Application, the response contains the 'view" object within the constants in the rendered AS3 delcaration:

{
    "class": "Application",
    "template": "http",
    "serviceMain": {
        "class": "Service_HTTP",
        "virtualPort": 1000,
        "virtualAddresses": [
            "192.168.0.101"
        ],
        "pool": "appZ_web_pool"
    },
    "appZ_web_pool": {
        "class": "Pool",
        "monitors": [
            "http"
        ],
        "members": [
            {
                "servicePort": 1000,
                "serverAddresses": [
                    "192.168.1.1"
                ]
            }
        ]
    },
    "constants": {
        "class": "Constants",
        "fast": {
            "template": "examples/simple_http",
            "setHash": "b4e574f5692532a03deb40b78599a7913ff63b2a31897a7b0168d99246d64715",
            "view": {
                "tenant_name": "tenant1",
                "application_name": "appZ",
                "virtual_port": 1000,
                "virtual_address": "192.168.0.101",
                "server_port": 1000,
                "server_addresses": [
                    "192.168.1.1"
                ]
            },
            "templateType": "local",
            "lastModified": "2023-03-23T15:50:57.427Z",
            "ipamAddrs": {}
        }
    },
    "_links": {
        "self": "/mgmt/shared/fast/applications/tenant1/appZ"
    }
}

Querying all applications the response is more concise but contains the same "view":

    {
        "template": "examples/simple_http",
        "setHash": "b4e574f5692532a03deb40b78599a7913ff63b2a31897a7b0168d99246d64715",
        "view": {
            "tenant_name": "tenant1",
            "application_name": "appZ",
            "virtual_port": 1000,
            "virtual_address": "192.168.0.101",
            "server_port": 1000,
            "server_addresses": [
                "192.168.1.1"
            ]
        },
        "templateType": "local",
        "lastModified": "2023-03-23T15:50:57.427Z",
        "ipamAddrs": {},
        "tenant": "tenant1",
        "name": "appZ",
        "_links": {
            "self": "/mgmt/shared/fast/applications/tenant1/appZ"
        }
    }

Describe the solution you'd like

Is the returned "view" a safe source for the "parameters" submitted to FAST during creation/modification of the application?

Please document and clarify.

Describe alternatives you've considered

Additional context

shyawnkarim commented 1 year ago

What do you mean by safe? Are you wondering if the parameters displayed in the view are always accurate?

simonkowallik commented 1 year ago

Hi @shyawnkarim yes, I wonder if a) view is accurately representing the parameters submitted in the API request and b) whether these get updated when modified through the WebUI FAST interface.

joelkeener commented 1 year ago

Hello Simon, The OpenAPI spec's definition for the view in response to a GET of all applications or a specific one, is the same object that defines the required parameters object in a POST/PUT/PATCH to an application: ParametersDefinition.

I deployed an application, got all applications and the specific application to confirm the view matched the parameters I submitted, then updated the application with the GUI and confirmed the view was updated with the new parameters after my update.

simonkowallik commented 1 year ago

Great, thank you for the clarification!

It would be good if we can update the documentation with this information. The current API reference does not reflect that information:

image
shyawnkarim commented 1 year ago

This documentation update is being tracked internally with ID EC-217.

shyawnkarim commented 1 year ago

Closing. This issue was resolved with Release 1.25.0.