NF Fabric

Overview@

This section will show how to do that through NF Console, and programatically using NF Orchestration's APIs

via Console UI@

  1. Click on Network Menu
  2. Click on "+" button in the top right corner to create a network
  3. Give it a name, e.g. "DemoNet01" Image
  4. Wait until the icon network turns green. Image
  5. Done

via REST API (Python)@

Note

For the code clarity, we have broken down the code into multiple Python modules

  1. NF REST CRUD (Create,Read, Update and Delete) operations
  2. Get MOP Session Token
  3. Create NF Network
  4. Wrapper Script to Create NF Resources based on Resource yaml file

To obtain a session token, the MOP Session Token script parses a configuration file for clientId, and clientSecret if they are not passed to it through the positional arguments (e.g. env, clientId, clientSecret). This configuration file must be located in the home directory under '~/.env'

  1. Clone this repo (git clone https://github.com/netfoundry/mop.git)
  2. Change directory to cd mop
  3. Update Resource yaml file with the desired options to feed into the wrapper script as described in the following code snippet.
  4. Run this from the root folder
    python3 quickstarts/docs/api/python/nf_resources.py --file quickstarts/docs/api/python/nf_resources.yml
    
    Required Configuration Paramters
    environment: {NF Console Environment, e.g. Production}
    network_action: { e.g. create, get, delete}
    network_name: { e.g. DemoNet01 }
    
  5. Done

Note

The logs will be outputted to the log file named logoutput.txt under the directory that the script is run './'.