Skip to main content

Private Networks

Create isolated internal networks and add services to them. Services on the same private network can reach each other via a stable internal DNS name -- no public internet required, no firewall rules to manage.

How it works

  • Create a named private network in your workspace
  • Add any services you want to connect
  • Services discover each other at {service}.{network}.internal
  • Traffic stays inside the cluster -- never touches the public internet

Internal DNS format

Internal addresses
# Pattern
{service-name}.{network-name}.internal:<port>

# Examples
http://api.backend-net.internal:10000
postgres://db.backend-net.internal:5432/mydb
amqp://worker.backend-net.internal:5672/

Create and manage

API
# Create a private network
curl -X POST https://railpush.com/api/v1/networks \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"name": "backend-net"}'

# Add a service to the network
curl -X POST https://railpush.com/api/v1/networks/<net-id>/services \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"service_id": "<service-id>"}'

# Remove a service from the network
curl -X DELETE https://railpush.com/api/v1/networks/<net-id>/services/<service-id> \
-H "Authorization: Bearer <token>"

API reference

MethodEndpointDescription
POST/api/v1/networksCreate a private network
GET/api/v1/networksList all networks
GET/api/v1/networks/:idGet network details and member services
DELETE/api/v1/networks/:idDelete a network
POST/api/v1/networks/:id/servicesAdd a service to the network
DELETE/api/v1/networks/:id/services/:sidRemove a service from the network