[Aruba DevNet Lecture 1] Introduction to Automation and IaC for Network Engineers

Starting today, I'm going to start a series on something a little special and very powerful.
as soon as ‘Aruba Network Automation’ It's a series.

Haven't network engineers experienced this at least once in the field?

“I had to change the VLAN settings on 50 switches, but I opened 50 Putty windows and kept pressing Ctrl+C and Ctrl+V, and I broke out in a cold sweat because I made a mistake…”

“I remember typing out the serial numbers of hundreds of APs one by one to do inventory checks…”

Now is the time for change.
The power of HPE Aruba API와 Automation toolsBy using it, you can finish a task that would take several days in the time it takes to have a cup of coffee.

That first time, today is “Why on earth should I use an API?”, and our strong supporters “Aruba Developer Hub“Let’s find out about it.


1. From the CLI era to the API era

We have become so accustomed to the CLI (Command Line Interface).
However, with the advent of the cloud era, the number of devices increased to hundreds or thousands, and the method of having people do it one by one reached its limits.

Why do we need an API (Application Programming Interface)?
  • Speed: When a person types one line per minute, the program processes 1,000 lines per second.
  • Accuracy: People make typos when they're tired, but code doesn't lie.
  • Scalability: Whether you have one device or 1,000, you only need to write the code once.

Aruba's next-generation switch OS AOS-CXAOS 10, based on Aruba Central, our wireless/integrated management platform, was designed from the ground up with an “API First” microservices architecture. This means that every action you take on the screen or type in a command can be controlled by code.

2. What is IaC (Infrastructure as Code)?

A term that is always mentioned when talking about automation is IaC (Infrastructure as Code).
In simple terms, it means “managing network settings with ‘code files” rather than Excel files or in my head.”.

  • Conventional method: Connect to the device conf t, vlan 10 input
    → There is no record of who changed it and when.
  • IaC approach: switch_config.yaml Write “VLAN 10 required” in the file and save it.
    → Automation tools (such as Ansible) automatically apply to the equipment.

Especially for wireless (WLAN), AOS 10 As we move into architecture, the cloud (Central) takes over the role of the controller, which is a physical machine.
We just ask the Central API to “create this SSID,” and the settings are automatically propagated to APs scattered around the world.

3. [Must Read] Our Secret Weapon: Aruba Developer Hub

“But I’m not a developer, so why do I have to memorize all that complicated code?”

Absolutely not. We have the Aruba Developer Hub.

This is the official developer portal and encyclopedia operated by Aruba.

  1. API & Guide: “Here's an answer key and beginner-friendly learning materials for "What code should I send to create a VLAN?".
  2. Code Exchange: You can find sample code created by users or manufacturers on Github.
  3. Community: You can ask and answer questions with engineers around the world.

If you're looking for more in-depth features, this is the place to start.

4. Seeing is believing: Talking to Aruba Central with Python

Enough with the theory, let's get a taste of what the code actually looks like.
The first gateway to automation is “Connect to Aruba Central and obtain an authentication token.”.

[Creating a Central API Client]

The Central API client key must be generated in a Workspace within the GreenLake Cloud Platform.

  • Central > Manage Workspace > Personal API Client Click
  • Click Create personal API Client
  • Select the API client name and the service with which you want to communicate with the API (e.g. HPE Aruba Networking Central)
  • Check the generated Client ID and Secret

🚨Please write down the Secret key separately as it cannot be checked again.
Just be careful not to expose it to the outside!

For a more detailed step-by-step guide, please see the video below.

[Preparation]

  • Aruba Central account (requires the Client ID/Secret created above)
  • PC with Python installed

[Sample Code: Hello Central!]

Python
import requests

# ==========================================
# 1. Enter HPE GreenLake API information
# ==========================================
Central based on # GreenLake uses a unified SSO URL.
token_url = ""https://sso.common.cloud.hpe.com/as/token.oauth2""

# API credentials (never expose them to the public!)
For # Client ID and Secret, enter the values generated in the GreenLake dashboard.
client_id = ""Enter my_CLIENT_ID""
client_secret = ""Enter my_client_secret""

# ==========================================
# 2. Token Request (POST)
# ==========================================
print(""🔐 Trying to authenticate to HPE GreenLake..."")

payload = {
    ''grant_type'': ''client_credentials'',
    ''client_id'': client_id,
    ''client_secret'': client_secret
}

try:
    response = requests.post(token_url, data=payload)

    # ==========================================
    # 3. Check the results
    # ==========================================
    if response.status_code == 200:
        data = response.json()
        access_token = data[''access_token'']
        print(""✅ Authentication successful! You have obtained an access token."")
        print(f""Token: {access_token[:20]}..."") For # security, only the front part is printed
        
        # (Note) The actual token is valid for approximately 2 hours (7200 seconds).
    else:
        print(f""❌ Authentication failed... Status code: {response.status_code}""")
        print(""Error message:"", response.text)

except Exception as e:
    print(f""❌ An error occurred: {e}""")

If authentication fails

When authentication is successful

If this short code runs and you receive a 'Token', you have obtained the 'master key' to a huge warehouse called Aruba Central.

5. How far can automation go? (Expanding its potential applications)

Using the tokens and API concepts you've acquired today, you'll be able to create the following magic on the Rubaruba blog going forward:.

  1. Inventory Automation (Next Step!):
    “The serial numbers, model names, and license expiration dates of our company’s 500 APs Save Excel with one clickdo."”
  2. Enhanced Wireless Security (AOS 10):
    “Every Monday at 9:00 AM, randomly generate a Guest Wi-Fi password, automatically change it, and send an email to the administrator.”
  3. Disaster Response (ChatOps):
    “If the VIP executive office AP is turned off, I can see it without having to look at the control monitor. Slack or Teams”Get an immediate alert.”
  4. CX Switch Large-Scale Deployment (Ansible):
    “I just unboxed 20 new switches, plugged in the LAN cable, and they automatically applied the headquarters standard settings.”

6. Conclusion: Engineers Who Became Developers

Looking at the code can be unfamiliar at first.
But don't worry, it's more than a complicated theory. “Examples you can immediately apply in practice” I will feed you one by one.

next Lecture 2In “How to scrape a list of all devices registered in Aruba Central and organize them nicely in Excel.“Let’s deal with it.

Escape from simple repetitive tasks and focus on truly valuable work. Smart EngineerLet's become one!