Greeter is a demo Go application demonstrating the key principles of creating applications powered by the SR Linux's NetOps Development Kit. Check learn.srlinux.dev for a complete code walkthrough.
Clone and enter the repository:
git clone https://github.com/srl-labs/ndk-greeter-go.git && \
cd ndk-greeter-go
Build the application and deploy it to the lab:
./run.sh deploy-all
Once the lab is deployed, the application is automatically onboarded to SR Linux.
Enter the SR Linux CLI:
ssh greeter
Once entered into the SR Linux CLI, you can finde /greeter
context available that contains the application's configuration and operational data.
Configure the desired name:
--{ + running }--[ ]--
A:greeter# enter candidate
--{ + candidate shared default }--[ ]--
A:greeter# greeter name srlinux-user
Commit the configuration:
--{ +* candidate shared default }--[ ]--
A:greeter# commit now
All changes have been committed. Leaving candidate mode.
The application will now greet you when you list its operational state:
--{ + running }--[ ]--
A:greeter# info from state greeter
greeter {
name srlinux-user
greeting "👋 Hello srlinux-user, I was last booted at 2023-11-26T10:24:27.374Z"
}
To get bash autocompletions for ./run.sh
functions:
source ./run.sh