zitified-mammoth provides an example of zitifying the Mammoth Python SDK mm-pysdk to encapsulate the API calls over a NetFoundry Zero Trust Overlay. This demo assumes that you have a Mammoth account and have the ability to create an api key pair
Create or use an existing ziti network with at least one NF hosted edge router. This can be accomplished using the NetFoundry Console.
-
Create an ubuntu 24.04 vm in AWS or other location with internet access a. install prereqs
sudo apt updatesudo apt upgradesudo apt install python3-pip python3-venv gitb. ## Build the Example On the linux system that will run the Client clone the repo mkdir ~/repos cd ~/repos
git clone https://github.com/netfoundry/zitified-mammoth.gitcd zitified-mammoth/src -
Create and enroll a ziti identity place the identity json file in the ~/repos/zitified-mammoth/src on the VM created in step 1.
a. mammoth_client01 -
Add a customer hosted edge router e.g. "us-east-2-mammoth-edge01" to your network
-
Launch the customer hosted edge-router in aws region e.g. us-east-2 follow: https://support.netfoundry.io/hc/en-us/articles/ 360016342971-Deployment-Guide-for-AWS-Edge-Routers
-
Create a NF service named "mammoth-api-service" and use wildcard address "*.mammoth.io" , protocol TCP and 443 as the port. Assign the router identity e.g. us-east-2-mammoth-edge01 as the hosting entity and forward address, protocol and port to yes.
- Create a service policy to bind the identity to the NF service e.g.
- Create a router policy and with the NF hosted edge-router and the mammoth_client01 as the identity e.g.
-
On the VM created in step one.
a. Create a python virtual environment
cd ~/repos/zitified-mammoth/srcpython3 -m venv mmsdksource mmsdk/bin/activateb. Install openziti and mammoth modules
pip3 install openzitipip3 install git+ssh://git@github.com/EdgeMetric/mm-pysdk.gitc. Enter Mammoth api key and secret as environmental variables e.g.
export MAMMOTH_API_KEY="<key text>" export MAMMOTH_API_SECRET="<secret text>"d. Execute the script
python3 zmammoth.py --ziti-identity zmammoth.json --upload-csv-file iris.csv --download-csv-file output.csv --workspace-id 5XXX --project-id 1XXXSample output:
Loading the OpenZiti identity... Initializing Mammoth API Client for workspace 5XXX... Setting project id to 1XXX Confirmed project_id = 1XXX Uploading iris.csv... Dataset created with id = 2XXXXY Retrieving list of dataviews... Dataview Name = View 1, Dataview Id = 2XXXXZ, Associated Dataset = 2XXXXY Downloading dataview id 2XXXXXZ of dataset id 2XXXXY to output.csv... Waiting for export job 14112885 to complete... Download URL: https://filesmammoth104.mammoth.io/temp_export_2XXXXY_2XXXXZ.csv Downloaded dataview CSV to output.csv




