Skip to content

Commit

Permalink
Merge pull request #115 from f5devcentral/v20_update
Browse files Browse the repository at this point in the history
module 6 edits
  • Loading branch information
f5jason authored Jan 29, 2024
2 parents 432ef36 + 7aea182 commit 699e6ac
Show file tree
Hide file tree
Showing 19 changed files with 172 additions and 100 deletions.
Binary file added docs/class5/module6/images/delete-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/class5/module6/images/login-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/class5/module6/images/login-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/class5/module6/images/thunder-env.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/class5/module6/images/vscode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/class5/module6/images/vscode-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/class5/module6/images/vscode-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/class5/module6/images/vscode-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/class5/module6/images/vscode-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/class5/module6/images/vscode-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 9 additions & 6 deletions docs/class5/module6/lab1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ Orchestrator that was not previously available in the BIG-IP "Classic" version.

There are two main drivers for programmability:

- **Configuration**: Where API is used instead of a UI to deploy the
#. **Configuration**: Where an API is used (instead of a GUI/CLI) to deploy the
general configuration of the product. While this is typically less
important in typical data center appliance use cases, it is highly desirable
in cloud and other "orchestrated" deployments, where you might need
to programmatically spin up entire security and application
architectures quickly. For example, deploying applications
"on-demand" through a multi-cloud networking (MCN) workflow generally demands programmability.

- **Policy Manipulation**: The SSL Orchestrator policy represents a
#. **Policy Manipulation**: The SSL Orchestrator policy represents a
"tunable" control surface to address changing traffic behaviors and
various events. Administrators can programmatically adjust the
policy to reflect real-time traffic conditions.
Expand All @@ -23,7 +23,10 @@ This module explores some basic programmability aspects of the BIG-IP Next SSL
Orchestrator, both to control configuration, and to manipulate the
policy.

The following instructions assume basic connectivity to the lab
environment, and administrative access to the lab's network and virtual
machine configurations. Furthermore, you will use the **Thunder Client** Visual
Studio Code extension to execute API requests to the F5 BIG-IP Central Manager.
|
.. note::
The following instructions assume basic connectivity to the lab
environment, and administrative access to the lab's network and virtual
machine configurations.

81 changes: 63 additions & 18 deletions docs/class5/module6/lab2.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,79 @@
Setting up the API Client
================================================================================

|thunder-client| is a lightweight Rest API client for testing APIs. It has a similar look and feel to the **Postman** tools, but implemented as a |vscode| extension. If you choose to use **Postman** in other environments, the **Thunder Client** can convert its collections and environments to **Postman** format.

.. |vscode| raw:: html

<a href="https://code.visualstudio.com/" target="_blank">Visual Studio Code (VS Code)</a>

.. |thunder-client| raw:: html

<a href="https://marketplace.visualstudio.com/items?itemName=rangav.vscode-thunder-client" target="_blank"><b>Thunder Client</b></a>


Log into the Client Remote Desktop
--------------------------------------------------------------------------------

#. From within the UDF interface, navigate to the **Ubuntu-Server** instance and find the **WEBRDP** access link. Clicking this link opens a new browser tab.
In this lab, you will need to log into the **Client VM desktop** to launch **VS Code** and the **Thunder Client** to send API requests to the **F5 BIG-IP Central Manager**.

#. In the UDF **Deployment** tab, find the **Ubuntu-Server** resource.

#. Under **Ubuntu-Server**, click on **ACCESS** to see the list of available access methods.

#. Click on **WebRDP** to open a new browser tab that connects to the Client desktop GUI.

.. image:: ./images/vscode-1.png

#. Enter the username (``user``) and password (``user``) to login.

.. image:: ./images/vscode-2.png

This is a basic Ubuntu Linux VM instance running an XFCE desktop environment.


Access Thunder Client Extension
--------------------------------------------------------------------------------

You will now set up the **Thunder Client** extension in **VS Code**.

#. Click on the **VS Code** application shortcut in the command bar (bottom of the screen).

.. image:: ./images/vscode-3.png


#. In **VS Code** , click on the **Thunder Client** icon in the left side bar to see the extension's interface.

.. image:: ./images/vscode-4.png


About Thunder Client Environment Variables
--------------------------------------------------------------------------------

Environment variables provide shortcuts by substituting stored values into API requests when they are sent. All of the API calls in the SSL Collection will minimally include a **{{CM}}** variable value. Several variables are provided in the included SSLO Environment file.

#. To view these Environment values, click on the **Env** tab in the Thunder Client top menu bar (under the **New Request** button), and then click on **sslo-environment**. The list will contain both user-defined variables, and variables captured dynamically from API responses.

#. Type in the username 'user' and password 'user' to access the Ubuntu client desktop within this browser window. You will be presented with a standard Ubuntu instance running an XFCE desktop environment.
.. image:: ./images/thunder-env.png


Thunder Client Setup
About Thunder Client API Collections
--------------------------------------------------------------------------------

**Thunder Client** is an API client that runs as a **Visual Studio Code (vscode)** extension. It has a similar look and feel to the **Postman** tool, but does not require an account to use collections and environments. This is for student lab demonstration only. If you choose to use **Postman** in other environments, the Thunder Client can convert its collections and environments to **Postman** format.
#. Click on the **Collections** tab in the Thunber Client top menu bar. You will see a pre-loaded collection called **sslo-api-collection-v1**.

#. There are several folders within this collection. Click on the **Create SSLO Deployment** collection to expand it.

.. image:: ./images/vscode-5.png

#. Open the **Documents** folder (**/home/student/Documents**) and then click on the **API** subfolder.

You should see the following contents:
The **Thunder Client** vscode extension is now configured for the remaining steps of the lab.


Additional Files (For Reference)
--------------------------------------------------------------------------------

The **API** folder (**/home/student/Documents/API**) contains the **Thunder Client** SSL Orchestrator API collection and related environment variables files. cURL scripts are also provided as a command-line alternative to the GUI-based **Thunder Client** tool.

.. list-table::
:header-rows: 1
Expand All @@ -33,17 +88,7 @@ Thunder Client Setup
* - api-curl-scripts-basic-application.txt
- cURL scripts to create a basic BIG-IP Next application through CM

The cURL scripts are provided as an alternative to the GUI-based **Thunder Client** tool.

#. To set up the **Thunder Client** extension, first launch the **Visual Studio Code** application from the command bar.

#. Within **vscode** , click on the **Thunder Client** icon in the left side bar.
|
#. In the **Thunder Client** left menu, click on the **Collections** tab. You should see a pre-loaded Collection: **sslo-api-collection-v1**.
.. image:: ./images/vscode-6.png

#. Expand this collection to reveal three subfolders - **Basic App Deployment, SSLO Deployment, and Miscellaneous**.

#. For this lab, you will only use the contents of the **SSLO Deployment** folder. Click on it to expand it.


The **Thunder Client** vscode extension is now configured for the remaining steps of the lab.
55 changes: 32 additions & 23 deletions docs/class5/module6/lab3.rst
Original file line number Diff line number Diff line change
@@ -1,47 +1,56 @@
Accessing the BIG-IP CM API
Accessing the BIG-IP Central Manager API
================================================================================


Log into Central Manager UI
Log into Central Manager (CM) GUI
--------------------------------------------------------------------------------

The next step is to log into the BIG-IP Central Manager UI. In a purely
programmatic sense this is not expressly required, but we will use it in
this lab to provide visual cues to successful API deployment. You will
be able to see and interact with the applications created from the API.
In a purely programmatic sense, it not required to log into the BIG-IP Central
Manager UI. However, you will use it in in this lab to provide visual feedback
on successful API deployment. You will be able to see and interact with the
application created from the API.

#. From within the UDF interface, navigate to the **BIG-IP-Next-CM** instance and find the **GUI** access link.
.. note::
Skip this section if you are still logged into the BIG-IP CM GUI from the previous lab module.

#. Clicking this link opens a new browser tab to the CM logon screen.

#. Provide the credentials to log in.
#. Refer to section 3.1 of this Lab Guide to access and log into the BIG-IP CM GUI.

#. On the home screen, click the **Manage Applications** button.

We will come back to the CM UI later. Let's now move on to using the CM API.
You will come back to the BIG-IP CM GUI later. Let's now move on to using the BIG-IP CM API.


Login to Central Manager via API Request
Log into Central Manager via API Request
--------------------------------------------------------------------------------

#. API requests to CM require an **Authorization: Bearer** token. To get that token you first need to make a login POST request to CM with your CM username and password.
API requests to BIG-IP CM require an **Authorization: Bearer** token. To get that token you first need to make a login POST request to BIG-IP CM with your username and password.

.. note::
All of the following API calls will minimally include a **{{CM}}** variable value. This is a variable reference that points to a value in the included environments file. You can view these environment values in the Thunder client by navigating to the **Env** tab in the top left of the Thunder client navigation bar in Visual Studio Code, and then clicking on **sslo-environment**. Both user-defined variables, and variables captured from API responses are saved here.
Here is the what that API request looks like:

.. code-block:: text
POST https://{{CM}}/api/login
Content-Type: application/json
{
"username": "{{CM username}",
"password": "{{CM password}"
}
A similar API request has already been created for you and is stored in the SSL Orchestrator Collection.

.. code-block:: text
#. In the **Create SSLO Deployment** folder, click on the **CM Login** request to select it.

POST https://{{CM}}/api/login
Content-Type: application/json
.. image:: ./images/login-1.png

{
"username": "{{CM username}",
"password": "{{CM password}"
}

#. Click on the **Send** button to submit the request to the BIG-IP CM API.

This request returns a JSON payload with an **access_token** value that you will use for subsequent **Authorization: Bearer** token requests. The token will expire after a few minutes, so it may be necessary to regenerate this request periodically and fetch a new bearer token for subsequent API calls.

This request returns a JSON payload with an **access_token** value that you will use for subsequent **Authorization: Bearer** token requests.

.. image:: ./images/login-2.png

.. note::
The token will expire after a few minutes, so it may be necessary to regenerate this request periodically and fetch a new bearer token for subsequent API calls.

Loading

0 comments on commit 699e6ac

Please sign in to comment.