How to: Manage AS3 applications using BIG-IP Next Central Manager

Use this procedure to manage AS3 application services using the BIG-IP Next Central Manager API.

For more information about application observability after the application service is deployed and receiving traffic (including details about application health, alerts, security, and traffic data), see Overview: Application service observability.

BIG-IP Application Services 3 Extension (BIG-IP AS3)

The F5 BIG-IP Application Services 3 (referred to as BIG-IP AS3) workflow provides a flexible, low-overhead mechanism for managing application-specific configurations on a BIG-IP Next system. BIG-IP AS3 uses a declarative model, meaning you provide a single JSON declaration instead of a set of imperative commands. The declaration represents the application configuration which BIG-IP AS3 creates on a BIG-IP system. BIG-IP AS3 provides a JSON Schema specification and its declarations are validated accordingly.

For more information on BIG-IP AS3, see F5 BIG-IP Application Services 3 Extension Documentation.

While creating a declaration for AS3 on BIG-IP Next, see Schema Reference for the objects that you can use in your declarations.

Workflow options

The BIG-IP Next AS3 workflow APIs provide various methods for handling application services.

Option Operates on
Per Application 1 application
Per Instance Many applications in many AS3 tenants
Per Tenant Many applications in a single AS3 tenant

Note: The per-application and per-instance workflow options are not same. So, if you set up an application service using the declare endpoint, you should not change it later using the documents endpoint. Select the most suitable workflow for effectively managing the application service throughout its entire lifecycle.

Per application

Use this workflow for new deployments where a single application service is drafted and deployed to a BIG-IP Next instance. This enables granular control over application services where each application service can be managed independently.

Migration: This workflow should be used if previously using the BIG-IP AS3 API in per-app mode.

To use this workflow, configure application services with the /api/v1/spaces/default/appsvcs/documents API endpoint.

Per-instance or per-tenant

Supports the declarative model pioneered by BIG-IP AS3 where many tenants and applications are deployed to a BIG-IP Next instance using a single API call. This option supports both per-instance and per-tenant variants.

Migration: This workflow should be used if previously using the BIG-IP AS3 API in declarative mode and want to lift and shift the automation workflow.

To use this workflow, configure application services with the /api/v1/spaces/default/appsvcs/declare API endpoint.

Note: Introduced in BIG-IP Next 20.2.0

Use BIG-IP Next Central Manager GUI to create application using JSON Editor

Use the procedure to create applications through JSON editor:

  1. Log in to BIG-IP Next Central Manager, click the Workspace icon next to the F5 logo, and then click Applications.

  2. If this is the first application service you are adding to BIG-IP Next Central Manager, click Start Adding Apps. Otherwise, at the top of the screen, click Add Application.

  3. Under What kind of Application Service are you creating, specify which type you are creating.

    • To create a standard application service, click Standard, and then click Start Creating.

    • To create an application service using a template, click From Template, and then click Select Template.

    • To create an application service from editor, click From Editor (AS3), and then click Start Creating.

    The AS3 JSON editor window opens.

  4. The AS3 Editor helps in creating, editing, and managing AS3 application services in JSON format. The editor launches with a customizable template that can be tailored to specific application needs. Refer to the Overview: Applications for more information on AS3 applications.

    Note: The root of the declaration must be “class”: “ADC” or “class”: “Application” since using “class”: “AS3” as the root is not supported. The preferred class type for defining services is “class”: “Application”.

  5. Within a few seconds of creating the declaration, a pop-up will appear indicating that the changes have been automatically saved.

  6. The application’s name is updated to the service name mentioned in the declaration after auto-save.

  7. After a application service is created, you can perform these steps:

    1. Upon selecting Exit, you will be directed to My Application Services page, where your newly created application will appear as a Draft.

    2. Upon selecting Exit and Discard Changes, you will be directed to My Application Services page and the changes will be discarded.

      Note: If the application service has already been saved and you make edits to the declaration before clicking on Exit and Discard Changes, the original version of the service will still be saved and not completely discarded.

    3. Upon selecting Save, you will be directed to My Application Services page, where your newly created application will appear as a Draft.

    4. Upon selecting Review & Deploy, you will be directed to Deploy to page, where you can deploy your application to instance.

    Note:

    • When using the AS3 declaration, make sure you only deploy one application service. Currently it is not possible to deploy more than one application service on BIG-IP Next Central Manager.

    • An AS3 application service can be deployed to a single instance.

  8. Click Start Adding, to select the instance from the dropdown.

  9. Click Validate, to validate the application service with the selected instance.

    Note: The Validate button will remain disabled until an instance is selected.

  10. Click Deploy, to deploy the Application service.

    Result: The AS3 Application service is created.

To know more about various use cases for AS3 Application services, refer to Application Services Examples for BIG-IP Next Central Manager.

Procedures

Use BIG-IP Next Central Manager API to deploy a single application service

Use this procedure to deploy a single application service to a managed BIG-IP Next instance using the BIG-IP Next Central Manager API.

  1. Authenticate with the BIG-IP Next Central Manager API, see How to: Authenticate with the BIG-IP Next Central Manager API.

  2. Draft the AS3 application service by sending a request to the /api/v1/spaces/default/appsvcs/documents endpoint.

POST /api/v1/spaces/default/appsvcs/documents

For the API body, use the following while substituting values appropriate for the configuration you want to deploy.

{
   "document": {
      "my_app": {
         "class": "Application",
         "my_pool": {
            "class": "Pool",
            "loadBalancingMode": "least-connections-member",
            "members": [
               {
                  "serverAddresses": [
                  "198.51.100.10"
                  ],
                  "servicePort": 80
               }
            ]
         },
         "my_service": {
            "class": "Service_HTTP",
            "enable": true,
            "persistenceMethods": [
               "source-address"
            ],
            "pool": "my_pool",
            "remark": "custom remark",
            "virtualAddresses": [
               "192.0.2.10"
            ],
            "virtualPort": 80
         },
         "remark": "canonical application"
      }
   }
}
  1. Deploy the AS3 application service to a BIG-IP Next instance in inventory by sending a request to the /api/v1/spaces/default/appsvcs/documents/<id>/deployments endpoint.

POST /api/v1/spaces/default/appsvcs/documents/<id>/deployments

For the API body, use the following while substituting values appropriate for the configuration you want to deploy.

{
   "target": "203.0.113.10"
}
  1. View the AS3 application service by sending a request to the /api/v1/spaces/default/appsvcs/documents/<id> endpoint.

GET /api/v1/spaces/default/appsvcs/documents/<id>

Example response.

{
   "app_data": {
      "my_app": {
         "class": "Application",
         "my_pool": {
            "class": "Pool",
            "loadBalancingMode": "least-connections-member",
            "members": [
               {
                  "serverAddresses": [
                  "198.51.100.10"
                  ],
                  "servicePort": 80
               }
            ]
         },
         "my_service": {
            "class": "Service_HTTP",
            "enable": true,
            "persistenceMethods": [
               "source-address"
            ],
            "pool": "my_pool",
            "remark": "custom remark",
            "virtualAddresses": [
               "192.0.2.10"
            ],
            "virtualPort": 80
         },
         "remark": "canonical application"
      }
   },
   "name": "my_app",
   "tenant_name": "default",
   "type": "AS3"
}

Use BIG-IP Next Central Manager API to deploy a single application service with cm pointers

Use this procedure to deploy a single application service with cm pointers to a managed BIG-IP Next instance using the BIG-IP Next Central Manager API. The cm pointer is similar to the bigip pointer from BIG-IP AS3 in that it references a resource already created on BIG-IP Next Central Manager, such as a certificate, iRule or WAF policy. During application service deployment, any referenced resources are pre-deployed to the BIG-IP Next instance.

Note: Shared resources such as a certificate, iRule, or WAF policy are managed independently of the application service but may require a redeployment of the application service depending on the resource. For example, if a WAF policy is already associated with an application service, when it is updated, the changes are deployed directly to the BIG-IP Next instance. However, when an iRule is updated it requires a redeployment of the application.

  1. Authenticate with the BIG-IP Next Central Manager API, see How to: Authenticate with the BIG-IP Next Central Manager API.

  2. Draft the AS3 application service by sending a request to the /api/v1/spaces/default/appsvcs/documents endpoint.

POST /api/v1/spaces/default/appsvcs/documents

For the API body, use the following while substituting values appropriate for the configuration you want to deploy.

{
   "document": {
      "my_app": {
         "class": "Application",
         "my_pool": {
            "class": "Pool",
            "loadBalancingMode": "least-connections-member",
            "members": [
               {
                  "serverAddresses": [
                  "198.51.100.10"
                  ],
                  "servicePort": 80
               }
            ]
         },
         "my_service": {
            "class": "Service_HTTP",
            "enable": true,
            "iRules": [
               {
                  "cm": "irule01::v1"
               }
            ],
            "persistenceMethods": [
               "source-address"
            ],
            "policyWAF": {
               "cm": "wafpolicy01"
            },
            "pool": "my_pool",
            "remark": "custom remark",
            "virtualAddresses": [
               "192.0.2.10"
            ],
            "virtualPort": 80
         },
         "remark": "canonical application"
      }
   }
}
  1. Deploy the AS3 application service to a BIG-IP Next instance in inventory by sending a request to the /api/v1/spaces/default/appsvcs/documents/<id>/deployments endpoint.

POST /api/v1/spaces/default/appsvcs/documents/<id>/deployments

For the API body, use the following while substituting values appropriate for the configuration you want to deploy.

{
   "target": "203.0.113.10"
}
  1. View the AS3 application service by sending a request to the /api/v1/spaces/default/appsvcs/documents/<id> endpoint.

GET /api/v1/spaces/default/appsvcs/documents/<id>

Example response.

{
   "app_data": {
      "my_app": {
         "class": "Application",
         "my_pool": {
            "class": "Pool",
            "loadBalancingMode": "least-connections-member",
            "members": [
               {
                  "serverAddresses": [
                  "198.51.100.10"
                  ],
                  "servicePort": 80
               }
            ]
         },
         "my_service": {
            "class": "Service_HTTP",
            "enable": true,
            "iRules": [
               {
                  "cm": "irule01::v1"
               }
            ],
            "persistenceMethods": [
               "source-address"
            ],
            "policyWAF": {
               "cm": "wafpolicy01"
            },
            "pool": "my_pool",
            "remark": "custom remark",
            "virtualAddresses": [
               "192.0.2.10"
            ],
            "virtualPort": 80
         },
         "remark": "canonical application"
      }
   },
   "name": "my_app",
   "tenant_name": "default",
   "type": "AS3"
}

Use BIG-IP Next Central Manager API to deploy multiple application services in a declaration

Use this procedure to deploy multiple tenants and application services to a managed BIG-IP Next instance using the BIG-IP Next Central Manager API.

  1. Authenticate with the BIG-IP Next Central Manager API, see How to: Authenticate with the BIG-IP Next Central Manager API.

  2. Deploy the AS3 declarative configuration by sending a request to the /api/v1/spaces/default/appsvcs/declare endpoint.

POST /api/v1/spaces/default/appsvcs/declare?target_address=203.0.113.10

For the API body, use the following while substituting values appropriate for the configuration you want to deploy.

{
   "class": "ADC",
   "id": "adc-canonical",
   "schemaVersion": "3.0.0",
   "my_tenant": {
      "class": "Tenant",
      "my_app": {
         "class": "Application",
         "my_pool": {
         "class": "Pool",
         "loadBalancingMode": "least-connections-member",
         "members": [
            {
               "serverAddresses": [
               "198.51.100.10"
               ],
               "servicePort": 80
            }
         ]
         },
         "my_service": {
         "class": "Service_HTTP",
         "enable": true,
         "persistenceMethods": [
            "source-address"
         ],
         "pool": "my_pool",
         "remark": "custom remark",
         "virtualAddresses": [
            "192.0.2.10"
         ],
         "virtualPort": 80
         },
         "remark": "canonical application"
      },
      "my_app_2": {
         "class": "Application",
         "my_pool": {
         "class": "Pool",
         "loadBalancingMode": "least-connections-member",
         "members": [
            {
               "serverAddresses": [
               "198.51.100.20"
               ],
               "servicePort": 80
            }
         ]
         },
         "my_service": {
         "class": "Service_HTTP",
         "enable": true,
         "persistenceMethods": [
            "source-address"
         ],
         "pool": "my_pool",
         "remark": "custom remark 2",
         "virtualAddresses": [
            "192.0.2.20"
         ],
         "virtualPort": 80
         },
         "remark": "canonical application 2"
      }
   },
   "my_tenant_2": {
      "class": "Tenant",
      "my_app": {
         "class": "Application",
         "my_pool": {
         "class": "Pool",
         "loadBalancingMode": "least-connections-member",
         "members": [
            {
               "serverAddresses": [
               "198.51.100.100"
               ],
               "servicePort": 80
            }
         ]
         },
         "my_service": {
         "class": "Service_HTTP",
         "enable": true,
         "persistenceMethods": [
            "source-address"
         ],
         "pool": "my_pool",
         "remark": "custom remark",
         "virtualAddresses": [
            "192.0.2.100"
         ],
         "virtualPort": 80
         },
         "remark": "canonical application"
      }
   }
}

Use BIG-IP Next Central Manager API to view declaration

Use the following procedure to view an existing AS3 declaration using the BIG-IP Next Central Manager API. The below example is an AS3 declaration for the BIG-IP Next instance 203.0.113.10.

  1. Authenticate with the BIG-IP Next Central Manager API, see How to: Authenticate with the BIG-IP Next Central Manager API.

  2. Get the AS3 declarative configuration by sending a request to the /api/v1/spaces/default/appsvcs/declare endpoint.

    GET /api/v1/spaces/default/appsvcs/declare?target_address=203.0.113.10
    

    Example response.

    {
       "class": "ADC",
       "schemaVersion": "3.0.0",
       "my_tenant": {
          "class": "Tenant",
          "my_app": {
                "class": "Application",
                "my_pool": {
                   "class": "Pool",
                   "loadBalancingMode": "least-connections-member",
                   "members": [
                      {
                            "serverAddresses": [
                               "198.51.100.10"
                            ],
                            "servicePort": 80
                      }
                   ]
                },
                "my_service": {
                   "class": "Service_HTTP",
                   "enable": true,
                   "persistenceMethods": [
                      "source-address"
                   ],
                   "pool": "my_pool",
                   "remark": "custom remark",
                   "virtualAddresses": [
                      "192.0.2.10"
                   ],
                   "virtualPort": 80
                },
                "remark": "canonical application"
          },
          "my_app_2": {
                "class": "Application",
                "my_pool": {
                   "class": "Pool",
                   "loadBalancingMode": "least-connections-member",
                   "members": [
                      {
                            "serverAddresses": [
                               "198.51.100.20"
                            ],
                            "servicePort": 80
                      }
                   ]
                },
                "my_service": {
                   "class": "Service_HTTP",
                   "enable": true,
                   "persistenceMethods": [
                      "source-address"
                   ],
                   "pool": "my_pool",
                   "remark": "custom remark 2",
                   "virtualAddresses": [
                      "192.0.2.20"
                   ],
                   "virtualPort": 80
                },
                "remark": "canonical application 2"
          }
       },
       "my_tenant_2": {
          "class": "Tenant",
          "my_app": {
                "class": "Application",
                "my_pool": {
                   "class": "Pool",
                   "loadBalancingMode": "least-connections-member",
                   "members": [
                      {
                            "serverAddresses": [
                               "198.51.100.100"
                            ],
                            "servicePort": 80
                      }
                   ]
                },
                "my_service": {
                   "class": "Service_HTTP",
                   "enable": true,
                   "persistenceMethods": [
                      "source-address"
                   ],
                   "pool": "my_pool",
                   "remark": "custom remark",
                   "virtualAddresses": [
                      "192.0.2.100"
                   ],
                   "virtualPort": 80
                },
                "remark": "canonical application"
          }
       }
    }
    

Use BIG-IP Next Central Manager API to delete a tenant from the declaration

Use the following procedure to remove a tenant from an AS3 declaration using the BIG-IP Next Central Manager API.

  1. Authenticate with the BIG-IP Next Central Manager API, see How to: Authenticate with the BIG-IP Next Central Manager API.

  2. Delete a tenant from the AS3 declaration by sending a request to the /api/v1/spaces/default/appsvcs/declare/<tenant> endpoint.

The below example shows deleting my_tenant_2 from the AS3 declaration for the BIG-IP Next instance 203.0.113.10.

DELETE /api/v1/spaces/default/appsvcs/declare/my_tenant_2?target_address=203.0.113.10

Note: The DELETE method does not require any request body to be included.

Use BIG-IP Next Central Manager API to delete declaration

Use the following procedure to remove AS3 declarative configuration from a managed BIG-IP Next instance using the BIG-IP Next Central Manager API.

  1. Authenticate with the BIG-IP Next Central Manager API, see How to: Authenticate with the BIG-IP Next Central Manager API.

  2. Delete AS3 declarative configuration by sending a request to the /api/v1/spaces/default/appsvcs/declare endpoint.

The below example shows deleting all tenants from the AS3 declaration for the BIG-IP Next instance 203.0.113.10.

DELETE /api/v1/spaces/default/appsvcs/declare?target_address=203.0.113.10

Note: The DELETE method does not require any request body to be included.