F5 Programmability Training > Class 2: Building Continuous Delivery Pipelines > Module 3: Stitching Workflows from Class 1 into new Orchestratable Collections Source | Edit on

Lab 3.3 - Execute f5-newman-wrapper for an Operations Workflow

In the last lab we walked through creating an Application Service Framework, and then updating the Service Framework in a separate call. This lab has 2 f5-newman-files also, one used to user-down a pool member, and another to user-up the same member. These could be used as individual calls from another toolkit (which we’ll see later) or run independently as a single commands.

Task 1 - Execute f5-newman-build-3

  1. Navigate to the location containing the f5-newman-wrapper files /home/snops/f5-automation-labs/jenkins/f5-newman-operation

  2. On BIGIP-A, examine the pool module_3_pool, you should see 2 active (Green) pool members:

    lab-3-2

  3. f5-newman-build-3 contains calls to change the nodes for our service (to our Blue service ports) AS3 declarations use a false mechanism for pool members, keeping them in the delclaration but removing them from being used as a target

    Execute: f5-newman-wrapper f5-newman-build-3

    Output should look like:

     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
    [root@f5-super-netops] [/home/snops/f5-automation-labs/jenkins/f5-newman-operation] # f5-newman-wrapper f5-newman-build-3
    [f5-newman-build-3-2018-07-30-08-08-11] starting run
    [f5-newman-build-3-2018-07-30-08-08-11] [runCollection][Authenticate to BIG-IP] running...
    newman
    
    BIGIP_API_Authentication
    
    ❏ 1_Authenticate
    ↳ Authenticate and Obtain Token
      POST https://10.1.1.10/mgmt/shared/authn/login [200 OK, 1.62KB, 559ms]
      ✓  [POST Response Code]=200
      ✓  [Populate Variable] bigip_token=NRLGYNMNR5Z5WVLHAMHZYQBXGN
    
    ↳ Verify Authentication Works
      GET https://10.1.1.10/mgmt/shared/authz/tokens/NRLGYNMNR5Z5WVLHAMHZYQBXGN [200 OK, 1.44KB, 22ms]
      ✓  [GET Response Code]=200
      ✓  [Current Value] token=NRLGYNMNR5Z5WVLHAMHZYQBXGN
      ✓  [Check Value] token == NRLGYNMNR5Z5WVLHAMHZYQBXGN
    
    ↳ Set Authentication Token Timeout
      PATCH https://10.1.1.10/mgmt/shared/authz/tokens/NRLGYNMNR5Z5WVLHAMHZYQBXGN [200 OK, 1.44KB, 79ms]
      ✓  [PATCH Response Code]=200
      ✓  [Current Value] timeout=1200
      ✓  [Check Value] timeout == 1200
    
    ┌─────────────────────────┬──────────┬──────────┐
    │                         │ executed │   failed │
    ├─────────────────────────┼──────────┼──────────┤
    │              iterations │        1 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │                requests │        3 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │            test-scripts │        3 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │      prerequest-scripts │        1 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │              assertions │        8 │        0 │
    ├─────────────────────────┴──────────┴──────────┤
    │ total run duration: 1181ms                    │
    ├───────────────────────────────────────────────┤
    │ total data received: 1.72KB (approx)          │
    ├───────────────────────────────────────────────┤
    │ average response time: 220ms                  │
    └───────────────────────────────────────────────┘
    [f5-newman-build-3-2018-07-30-08-08-11] [runCollection][3 - Disable Node] running...
    newman
    
    f5-programmability-class-2
    
    ❏ 3 - Disable Node
    ↳ Step 1: Check Pool Exists
      GET https://10.1.1.10/mgmt/tm/ltm/pool/~module_3~module_3_vs~module_3_pool [200 OK, 1.87KB, 55ms]
      ✓  [GET Response Code]=200
    
    ↳ Step 2: Get Pool Members
      GET https://10.1.1.10/mgmt/tm/ltm/pool/~module_3~module_3_vs~module_3_pool/members/ [200 OK, 2.27KB, 101ms]
      ✓  [GET Response Code]=200
    
    ↳ Step 3: Patch HTTP Application Disable Green Enable Blue Members
      PATCH https://10.1.1.10/mgmt/shared/appsvcs/declare [200 OK, 1.76KB, 11.2s]
      ✓  [PATCH Response Code]=200
      ✓  [Current Value] results.0.message=success
      ✓  [Check Value] results.0.message regex /success|no change/
    
    ↳ Step 4: Get Pool Members
      GET https://10.1.1.10/mgmt/tm/ltm/pool/~module_3~module_3_vs~module_3_pool/members [200 OK, 2.27KB, 134ms]
      ✓  [GET Response Code]=200
    
    ┌─────────────────────────┬──────────┬──────────┐
    │                         │ executed │   failed │
    ├─────────────────────────┼──────────┼──────────┤
    │              iterations │        1 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │                requests │        4 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │            test-scripts │        8 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │      prerequest-scripts │        4 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │              assertions │        6 │        0 │
    ├─────────────────────────┴──────────┴──────────┤
    │ total run duration: 12.4s                     │
    ├───────────────────────────────────────────────┤
    │ total data received: 4.4KB (approx)           │
    ├───────────────────────────────────────────────┤
    │ average response time: 2.9s                   │
    └───────────────────────────────────────────────┘
    [f5-newman-build-3-2018-07-30-08-08-11] run completed
    

    Note

    Notice the 200 OK responses, as it completed successfully

  4. Log back into BIG-IP A examine the pool module_3_pool status page you should see on red diamond node and another node green and online:

    lab-3-3

    We’re doing some testing on our Blue service ports, now we can see we have a bad backend server!

Task 2 - Execute f5-newman-build-4

  1. On BIG-IP A examine the pool module_3_pool, you should show only 1 Active and Green:

    lab-3-3

  2. f5-newman-build-4 contains the calls to set our all our backend service pool members to a true state in the AS3 Declaration

    Execute: f5-newman-wrapper f5-newman-build-4

    Output should look like:

     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
    [root@f5-super-netops] [/home/snops/f5-automation-labs/jenkins/f5-newman-operation] # f5-newman-wrapper f5-newman-build-4
    [f5-newman-build-4-2018-07-30-08-03-19] starting run
    [f5-newman-build-4-2018-07-30-08-03-19] [runCollection][Authenticate to BIG-IP] running...
    newman
    
    BIGIP_API_Authentication
    
    ❏ 1_Authenticate
    ↳ Authenticate and Obtain Token
      POST https://10.1.1.10/mgmt/shared/authn/login [200 OK, 1.62KB, 424ms]
      ✓  [POST Response Code]=200
      ✓  [Populate Variable] bigip_token=PULWUPFKHJ7LVSHJGAG4SAUAAH
    
    ↳ Verify Authentication Works
      GET https://10.1.1.10/mgmt/shared/authz/tokens/PULWUPFKHJ7LVSHJGAG4SAUAAH [200 OK, 1.44KB, 19ms]
      ✓  [GET Response Code]=200
      ✓  [Current Value] token=PULWUPFKHJ7LVSHJGAG4SAUAAH
      ✓  [Check Value] token == PULWUPFKHJ7LVSHJGAG4SAUAAH
    
    ↳ Set Authentication Token Timeout
      PATCH https://10.1.1.10/mgmt/shared/authz/tokens/PULWUPFKHJ7LVSHJGAG4SAUAAH [200 OK, 1.44KB, 42ms]
      ✓  [PATCH Response Code]=200
      ✓  [Current Value] timeout=1200
      ✓  [Check Value] timeout == 1200
    
    ┌─────────────────────────┬──────────┬──────────┐
    │                         │ executed │   failed │
    ├─────────────────────────┼──────────┼──────────┤
    │              iterations │        1 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │                requests │        3 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │            test-scripts │        3 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │      prerequest-scripts │        1 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │              assertions │        8 │        0 │
    ├─────────────────────────┴──────────┴──────────┤
    │ total run duration: 1026ms                    │
    ├───────────────────────────────────────────────┤
    │ total data received: 1.72KB (approx)          │
    ├───────────────────────────────────────────────┤
    │ average response time: 161ms                  │
    └───────────────────────────────────────────────┘
    [f5-newman-build-4-2018-07-30-08-03-19] [runCollection][4 - Enable Node] running...
    newman
    
    f5-programmability-class-2
    
    ❏ 4 - Enable Node
    ↳ Step 1: Check Pool Exists
      GET https://10.1.1.10/mgmt/tm/ltm/pool/~module_3~module_3_vs~module_3_pool [200 OK, 1.87KB, 68ms]
      ✓  [GET Response Code]=200
    
    ↳ Step 2: Get Pool Members
      GET https://10.1.1.10/mgmt/tm/ltm/pool/~module_3~module_3_vs~module_3_pool/members/ [200 OK, 2.27KB, 85ms]
      ✓  [GET Response Code]=200
    
    ↳ Step 3: Patch HTTP Application Pool Enable all Members
      PATCH https://10.1.1.10/mgmt/shared/appsvcs/declare [200 OK, 1.75KB, 11.3s]
      ✓  [PATCH Response Code]=200
      ✓  [Current Value] results.0.message=success
      ✓  [Check Value] results.0.message regex /success|no change/
    
    ↳ Step 4: Get Final Declaration
      GET https://10.1.1.10/mgmt/shared/appsvcs/declare/module_3 [200 OK, 1.63KB, 221ms]
      ✓  [GET Response Code]=200
    
    ┌─────────────────────────┬──────────┬──────────┐
    │                         │ executed │   failed │
    ├─────────────────────────┼──────────┼──────────┤
    │              iterations │        1 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │                requests │        4 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │            test-scripts │        8 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │      prerequest-scripts │        4 │        0 │
    ├─────────────────────────┼──────────┼──────────┤
    │              assertions │        6 │        0 │
    ├─────────────────────────┴──────────┴──────────┤
    │ total run duration: 12.4s                     │
    ├───────────────────────────────────────────────┤
    │ total data received: 3.75KB (approx)          │
    ├───────────────────────────────────────────────┤
    │ average response time: 2.9s                   │
    └───────────────────────────────────────────────┘
    [f5-newman-build-4-2018-07-30-08-03-19] run completed
    

    Note

    Notice the 200 OK responses, as it completed successfully

  3. On BIG-IP A examine Pool module_3_pool we now have all our nodes in the system, we left the red node in place for valid health monitoring and tracking:

    lab-3-4