Lab 6 - Creating a Applications using AS3 Declarative Interface & BIG-IQΒΆ

In this lab, we will create a simple HTTP application using AS3 via BIG-IQ.

Unless instructed, throughout this section we will be working in the BIG-IQ Collection in Postman.

If the error Cannot find any ADC root nodes for the target devices occurs, follow directions here: https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/latest/userguide/troubleshooting.html

Exercise 1 - Ensure BIG-IP devices are in sync

Before BIG-IQ can be used to perform application creation via AS3, all BIG-IP devices in a config sync group must be in sync. In order to show how AS3 can do the configuration creation on both devices, the BIG-IP devices in the lab are configured with manual sync. Due to that, you need to ensure the two BIG-IP devices are in sync before starting this section of the lab. of this lab.

  1. Open the Authenticate to BIG-IP request.

  2. Send the request, and ensure you receive a 200 OK response.

  3. Open the BIG-IP: Get sync status request.

  4. Send the request, and ensure you receive a 200 OK response.

  5. Look at the data returned in the request. If it has a status of red reported, then you will need to complete the other steps in this exercise. If the status is reported as green, then you can proceed to Exercise 2.

    ../../_images/bigip-cfgsync-status-red-highlighted.JPG
  6. Open the BIG-IP: sync failoverGroup request, and click Send.

  7. Ensure you receive a 200 OK response.

  8. Open the BIG-IP: sync datasync-global-dg request, and click Send.

  9. Ensure you receive a 200 OK response.

  10. Open the BIG-IP: Get sync status request, and click Send.

  11. Ensure you receive a 200 OK response.

  12. Look at the data returned in the request. If it has a status of green reported.

    ../../_images/bigip-cfgsync-status-green-highlighted.JPG

Exercise 2 - Authenticate to the BIG-IQ

  1. Open the Authenticate to BIG-IQ request. Note that tokens need to be refreshed after 5 minutes. 401 Errors will occur if the token is bad or old. Resending this request will refresh the token.

  2. Click on the Body section of the POST Request. The body will look like the following

    1
    2
    3
    4
    5
    {
       "username": "admin",
       "password": "admin",
       "loginProviderName": "tmos"
    }
    
  3. Click the blue Send button. Ensure that you receive a 200 OK response.

Exercise 3 - Deploy and Delete an App without an App Template on BIG-IQ

  1. Open the Deploy App w/o Template request.

  2. Click on the Body section of the POST Request. The body will look like the following

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
      {
          "class": "AS3",
          "declaration": {
              "class": "ADC",
              "schemaVersion": "3.7.0",
              "id": "thisisanid",
              "label": "App1",
              "remark": "HTTP with custom persistence",
              "target": {
                  "hostname": "bigip01.as3lab.com"
              },
              "DemoService": {
                  "class": "Tenant",
                  "A1": {
                      "class": "Application",
                      "template": "http",
                      "serviceMain": {
                          "class": "Service_HTTP",
                          "virtualAddresses": [
                              "10.1.20.50"
                          ],
                          "pool": "web_pool"
                      },
                      "web_pool": {
                          "class": "Pool",
                          "monitors": [
                              "http"
                          ],
                          "members": [{
                          "servicePort": 8080,
                          "serverAddresses": [
                              "10.1.10.30"
                          ]
                          }]
                      }
                  }
              }
          }
      }
    
  3. Looking further into this request, the URI is sent to the IP address of BIG-IQ instead of the BIG-IP address per past requests. The target in the declaration shows that BIG-IQ will create the configuration on bigip01.as3lab.com. The rest of the declaration is just like what you would send directly to a BIG-IP device.

  4. Click the blue Send button. Ensure that you receive a 200 OK response.

  5. This application is now in the Demo Service partition on the BIG-IP (10.1.1.4).

  6. Login to the BIG-IP to confirm changes. Open Chrome and navigate to https://10.1.1.4 (or you can click on the BIG-IP01 bookmark in Chrome).

  7. Login with the following credentials: username = admin , password = admin.

  8. Login to the BIG-IQ to confirm changes. Open Chrome and navigate to https://10.1.1.7 (or you can click on the BIG-IQ bookmark in Chrome).

  9. On BIG-IQ, navigate to Applications -> Applications screen to view the deployed application.

    ../../_images/bigiq_1.jpg
  10. Now we will move our applciations from Unknown Applications to another tile named Known Applications.

  11. Send the Get Application Reference request to set the variable _bigiq_app_ref. Look at the Tests window for the declaration to see the variable being set, whcih will be used in the following step.

    ../../_images/big_variable.JPG
  12. Open the Move out of Unknown App request.

  13. Look at the Body` of the request, and you will see that we are moving the application to ``Known Applications. You could name this to any string.

  14. Click the blue Send button. Ensure that you receive a 200 OK response.

  15. Navigate back to the BIG-IQ Applications tab, and you will see that our app is now under the Known Applications tile.

  16. Now that we have had some fun, lets delete the app. Open the Delete App w/o Template request.

  17. Click the blue Send button. Ensure that you receive a 200 OK response.

  18. This application is now deleted from BIG-IQ and BIG-IP (10.1.1.4).

Exercise 4 - Deploy, Change and Delete Apps via App Templates on BIG-IQ

  1. Open the Upload App Template to BIG-IQ request. Note that this this request was taken from https://github.com/f5devcentral/f5-big-iq.

  2. Click on the Body section of the POST Request. The body will look like the following

      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
      {
          "description": "For load balancing an HTTP application on port 80.",
          "name": "AS3-F5-HTTP-lb-template-big-iq-default-v1",
          "published": true,
          "isUICompatible": true,
          "tenant": {
              "name": "",
              "override": false,
              "editable": true
          },
          "schemaOverlay": {
              "type": "object",
              "properties": {
                  "class": {
                      "type": "string",
                      "const": "Application"
                  },
                  "template": {},
                  "schemaOverlay": {},
                  "label": {},
                  "remark": {}
              },
              "additionalProperties": {
                  "allOf": [
                      {
                          "anyOf": [
                              {
                                  "properties": {
                                      "class": {
                                          "const": "Analytics_Profile"
                                      }
                                  }
                              },
                              {
                                  "properties": {
                                      "class": {
                                          "const": "HTTP_Profile"
                                      }
                                  }
                              },
                              {
                                  "properties": {
                                      "class": {
                                          "const": "Pool"
                                      }
                                  }
                              },
                              {
                                  "properties": {
                                      "class": {
                                          "const": "Service_HTTP"
                                      }
                                  }
                              }
                          ]
                      },
                      {
                          "if": {
                              "properties": {
                                  "class": {
                                      "const": "Analytics_Profile"
                                  }
                              }
                          },
                          "then": {
                              "$ref": "#/definitions/Analytics_Profile"
                          }
                      },
                      {
                          "if": {
                              "properties": {
                                  "class": {
                                      "const": "HTTP_Profile"
                                  }
                              }
                          },
                          "then": {
                              "$ref": "#/definitions/HTTP_Profile"
                          }
                      },
                      {
                          "if": {
                              "properties": {
                                  "class": {
                                      "const": "Pool"
                                  }
                              }
                          },
                          "then": {
                              "$ref": "#/definitions/Pool"
                          }
                      },
                      {
                          "if": {
                              "properties": {
                                  "class": {
                                      "const": "Service_HTTP"
                                  }
                              }
                          },
                          "then": {
                              "$ref": "#/definitions/Service_HTTP"
                          }
                      }
                  ]
              },
              "required": [
                  "class"
              ],
              "definitions": {
                  "Analytics_Profile": {
                      "properties": {
                          "class": {},
                          "collectUserAgent": {
                              "type": "boolean"
                          },
                          "collectClientSideStatistics": {
                              "type": "boolean",
                              "default": true
                          },
                          "collectGeo": {
                              "type": "boolean"
                          },
                          "collectUrl": {
                              "type": "boolean"
                          },
                          "collectPageLoadTime": {
                              "type": "boolean"
                          },
                          "collectOsAndBrowser": {
                              "type": "boolean",
                              "default": false
                          },
                          "collectMethod": {
                              "type": "boolean",
                              "default": false
                          },
                          "collectResponseCode": {
                              "type": "boolean",
                              "default": true
                          },
                          "collectIp": {
                              "type": "boolean"
                          }
                      },
                      "type": "object",
                      "additionalproperties": false
                  },
                  "HTTP_Profile": {
                      "properties": {
                          "class": {},
                          "fallbackRedirect": {
                              "type": "string",
                              "default": "https://www.example.com/404"
                          },
                          "fallbackStatusCodes": {
                              "type": "array",
                              "default": [
                                  404
                              ]
                          }
                      },
                      "type": "object",
                      "additionalproperties": false
                  },
                  "Pool": {
                      "properties": {
                          "class": {},
                          "members": {
                              "type": "array",
                              "items": {
                                  "type": "object",
                                  "properties": {
                                      "servicePort": {
                                          "type": "number",
                                          "default": 80
                                      },
                                      "monitors": {
                                          "type": "array",
                                          "default": [
                                              "http"
                                          ],
                                          "const": [
                                              "http"
                                          ]
                                      },
                                      "adminState": {
                                          "type": "string",
                                          "default": "enable"
                                      },
                                      "shareNodes": {
                                          "type": "boolean",
                                          "default": true,
                                          "const": true
                                      },
                                      "serverAddresses": {
                                          "type": "array"
                                      }
                                  }
                              }
                          },
                          "monitors": {
                              "type": "array",
                              "default": [
                                  "http"
                              ],
                              "const": [
                                  "http"
                              ]
                          }
                      },
                      "type": "object",
                      "additionalproperties": false
                  },
                  "Service_HTTP": {
                      "properties": {
                          "class": {},
                          "virtualPort": {
                              "type": "number",
                              "default": 80
                          },
                          "profileAnalytics": {
                              "type": "object",
                              "properties": {
                                  "use": {
                                      "type": "string",
                                      "default": "Analytics_Profile"
                                  }
                              }
                          },
                          "profileHTTP": {
                              "type": "object",
                              "properties": {
                                  "use": {
                                      "type": "string",
                                      "default": "HTTP_Profile"
                                  }
                              }
                          },
                          "virtualAddresses": {
                              "type": "array"
                          },
                          "pool": {
                              "type": "string",
                              "default": "Pool"
                          },
                          "enable": {
                              "type": "boolean",
                              "default": true
                          }
                      },
                      "type": "object",
                      "additionalproperties": false
                  }
              }
          }
      }
    
  3. Looking further into this request Lines 3 names the application template. Line 4 marks the application template as published. Lines 11-257 defines the schema for the application template.

  4. Click the blue Send button. Ensure that you receive a 200 OK response.

  5. To view the template we just uploaded, navigate to Chrome, BIG-IQ bookmark 10.1.1.7 (username = admin, password = admin).

  6. On BIG-IQ, navigate to Applications -> Application Templates.

    ../../_images/bigiq_2.jpg
  7. In Postman, open the Create App2 with Template request.

  8. Click on the Body section of the POST Request. The body will look like the following

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
      {
          "class": "AS3",
          "declaration": {
              "class": "ADC",
              "target": {
                  "hostname": "bigip01.as3lab.com"
              },
              "schemaVersion": "3.7.0",
              "DemoService": {
                  "class": "Tenant",
                  "App2": {
                      "class": "Application",
                      "schemaOverlay": "AS3-F5-HTTP-lb-template-big-iq-default-v1",
                      "template": "http",
                      "serviceMain": {
                          "class": "Service_HTTP",
                          "virtualAddresses": ["10.0.2.23"],
                          "pool": "web_pool"
                      },
                      "web_pool": {
                          "class": "Pool"
                      }
                  }
              }
          }
      }
    
  9. Looking further into this request. Line 13 defines the schema that we are going to use AS3-F5-HTTP-lb-template-big-iq-default-v1.

  10. Click the blue Send button. Ensure that you receive a 200 OK response.

  11. This application is now in the Unknown Applications section on the BIG-IQ Application dashboard, and it is in the Demo Service partition on the BIG-IP (10.1.1.4).

  12. Now we will change this application. Open the Change App2 request.

  13. Click on the Body section of the POST Request. Notice the changed IP address for the virtualAddress.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
      {
          "class": "AS3",
          "action": "patch",
          "patchBody": [
              {
                  "class": "ADC",
                  "target": {
                      "address": "10.1.1.4"
                  },
                  "op": "replace",
                  "path": "/DemoService/App2",
                  "value": {
                      "class": "Application",
                      "schemaOverlay": "AS3-F5-HTTP-lb-template-big-iq-default-v1",
                      "template": "http",
                      "serviceMain": {
                          "class": "Service_HTTP",
                          "virtualAddresses": ["10.0.2.24"],
                          "pool": "web_pool"
                      },
                      "web_pool": {
                          "class": "Pool"
                      }
                  }
              }
          ]
      }
    
  14. Click the blue Send button. Ensure that you receive a 200 OK response.

  15. This application is now changed on BIG-IQ and BIG-IP.

  16. Now we will delete the app. Open the Delete App from Template request.

  17. Click the blue Send button. Ensure that you receive a 200 OK response.

  18. This application is now deleted from BIG-IQ and BIG-IP (10.1.1.4).