Add outbound network commands#984
Open
m-abdelwahab wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a top-level
railway outbound-networkcommand for service outbound networking management with dashboard parity through the Railway public GraphQL API.All commands support the standard service selectors and JSON output:
Behavior
Static Outbound IP commands use the public egress gateway APIs directly, matching the current dashboard toggle. Enabling creates egress gateway associations, disabling clears them, and both commands report that a redeploy is required before outbound traffic changes.
Static Outbound IP status reports whether the feature is enabled, whether the returned assignment is high availability, and the assigned IPv4 addresses. It does not expose a legacy/single-IP mode in the CLI contract.
Outbound IPv6 commands stage an environment config patch for
deploy.ipv6EgressEnabled, matching the current dashboard toggle. The CLI does not apply staged changes or trigger a redeploy; it reports that staged changes must be applied.railway outbound-network statussummarizes both Static Outbound IPs and Outbound IPv6 for the selected service and environment.API
Uses only Railway public GraphQL API operations:
egressGatewaysegressGatewayAssociationCreateegressGatewayAssociationsClearenvironmentStageChangesenvironmentStagedChangesenvironment { config }JSON output
Action responses include a shared lifecycle object so automation can distinguish direct mutations from staged environment patches.
Static Outbound IP action responses use
directlifecycle mode. Outbound IPv6 action responses useenvironmentPatchlifecycle mode.Tests
Added coverage for:
--jsonrailway outbound-networkdeploy.ipv6EgressEnabledenvironment config serializationValidated with:
cargo fmt cargo test cargo clippy git diff --checkAlso validated against a real Railway account by creating a disposable project and service, deploying a minimal Dockerfile app, running the full JSON command matrix, running representative human-output commands, verifying Static Outbound IP enable/disable behavior, verifying Outbound IPv6 staged behavior, and leaving the temporary project available for manual follow-up testing.