Skip to content

Conversation

@h3adex
Copy link
Contributor

@h3adex h3adex commented Oct 10, 2025

Description

This PR adds functionality to list and describe routing tables, as well as perform full CRUD operations on routes within those tables. It does not include support for creating or attaching routing tables, as those operations are currently intended to be managed exclusively through Terraform.

This implementation is primarily aimed at enabling users to inspect and debug routes created via Terraform. Once the routing table feature reaches GA, support for creating routing tables and attaching them to networks will be added to the CLI.

Screenshot 2025-10-10 at 16 22 40

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see e.g. here)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@h3adex h3adex requested a review from a team as a code owner October 10, 2025 14:23
@h3adex h3adex force-pushed the feat/add-rt-support branch from 5b9fe56 to 45f6702 Compare October 10, 2025 14:24
@h3adex
Copy link
Contributor Author

h3adex commented Oct 15, 2025

Update waiting for go-sdk iaas api update ^

@h3adex h3adex force-pushed the feat/add-rt-support branch from 45f6702 to c79ff62 Compare October 27, 2025 13:27
@h3adex h3adex force-pushed the feat/add-rt-support branch 19 times, most recently from 9ccdfea to e8c2521 Compare November 5, 2025 13:34
@h3adex h3adex force-pushed the feat/add-rt-support branch from e8c2521 to 826b579 Compare November 5, 2025 15:20
@h3adex
Copy link
Contributor Author

h3adex commented Nov 5, 2025

I've rebased this PR and updated it to use the official Iaas V2 API. I've also updated the network command to allow setting and updating the routing-table ID. I manually updated the routing table help text to note that this API is currently available only to a select group of customers. IPv6 isn't working on our platform yet, but the Iaas API supports it, so I integrated the relevant route create commands into the CLI. It's unlikely many will use them now, but this will ensure that the CLI is ready once IPv6 goes live. Here are the commands I manually tested:

#!/bin/zsh

PROJECT_ID="xxx"
NETWORK_AREA_ID="xxx"
ORG_ID="xxx"
ROUTING_TABLE_ID_2="xxx"
NETWORK_ID="xxx"
ROUTING_TABLE_ID="xxx"
ROUTE_ID="xxx"


# set project id
bin/stackit config set --project-id $PROJECT_ID

# create routing-table
bin/stackit routing-table create --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID --name rt_test


bin/stackit network create --name network-rt --routing-table-id $ROUTING_TABLE_ID

# check if routing table id is shown
bin/stackit network list -o pretty

# check if routing table id is shown
bin/stackit network describe $NETWORK_ID

# create another rt
bin/stackit routing-table create --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID --name rt_test_2

# check if network update with rt works
bin/stackit network update $NETWORK_ID --routing-table-id $ROUTING_TABLE_ID_2

# describe rt
bin/stackit routing-table describe $ROUTING_TABLE_ID --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID -o pretty
bin/stackit routing-table describe $ROUTING_TABLE_ID_2 --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID -o pretty

# list rt
bin/stackit routing-table list --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID -o pretty

# delete rt
bin/stackit routing-table delete $ROUTING_TABLE_ID_2 --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID -o pretty

# update rt

# disable dynamic-routes
bin/stackit routing-table update $ROUTING_TABLE_ID --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID --description "xxx yyy zzz" --non-dynamic-routes
# enable again
bin/stackit routing-table update $ROUTING_TABLE_ID --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID --description "xxx yyy zzz"
# update name
bin/stackit routing-table update $ROUTING_TABLE_ID --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID --description "xxx yyy zzz" --name rt_test_123
# update labels
bin/stackit routing-table update $ROUTING_TABLE_ID --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID --description "xxx yyy zzz" --labels xxx=yyy,zzz=bbb --name rt_test_12344

# test routes in rt
bin/stackit routing-table update --routing-table-id $ROUTING_TABLE_ID --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID --description "xxx yyy zzz"

# create ipv4 route
bin/stackit routing-table route create --routing-table-id $ROUTING_TABLE_ID \
 --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID \
 --destination-type cidrv4 --destination-value 0.0.0.0/0 \
 --nexthop-type ipv4 --nexthop-value 10.1.1.0

# create ipv4 route next hop internet
bin/stackit routing-table route create --routing-table-id $ROUTING_TABLE_ID \
 --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID \
 --destination-type cidrv4 --destination-value 0.0.0.0/0 \
 --nexthop-type blackhole

# create ipv4 route next hop blackhole
bin/stackit routing-table route create --routing-table-id $ROUTING_TABLE_ID \
  --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID \
  --destination-type cidrv4 --destination-value 0.0.0.0/0 \
  --nexthop-type internet

# error
bin/stackit routing-table route create --routing-table-id $ROUTING_TABLE_ID \
  --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID \
  --destination-type cidrv4 --destination-value 0.0.0.0/0 \
  --nexthop-type error

bin/stackit routing-table route create --routing-table-id $ROUTING_TABLE_ID \
  --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID \
  --destination-type error --destination-value 0.0.0.0/0 \
  --nexthop-type internet

# ipv6 can not be tested since it is not supported right now cidrv6 destination-type next-hop-type ipv6
# cli it would ready once it is released
bin/stackit routing-table route create --routing-table-id $ROUTING_TABLE_ID \
  --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID \
  --destination-type cidrv6 --destination-value 2001:db8::/32 \
  --nexthop-type ipv6 --nexthop-value ::1
# Error: create route request failed: 400 Bad Request, status code 400, Body: {"code":400,"msg":"unsupported route destination type: cidrv6"}

# list all routes
bin/stackit routing-table route list --routing-table-id $ROUTING_TABLE_ID \
  --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID -o pretty

# describe single route
bin/stackit routing-table route describe $ROUTE_ID --routing-table-id $ROUTING_TABLE_ID \
  --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID -o pretty

# describe single route
bin/stackit routing-table route update $ROUTE_ID --routing-table-id $ROUTING_TABLE_ID \
  --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID --labels key=value,foo=bar

# update single route
bin/stackit routing-table route update $ROUTE_ID --routing-table-id $ROUTING_TABLE_ID \
  --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID --labels key=value,foo=bar

# delete single route
bin/stackit routing-table route delete $ROUTE_ID --routing-table-id $ROUTING_TABLE_ID \
  --network-area-id $NETWORK_AREA_ID --organization-id $ORG_ID
Screenshot 2025-11-05 at 16 21 20

@h3adex h3adex requested a review from rubenhoenle November 5, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants