It looks like you are looking for a collection of routes . In your first case, the examples should show you how one instance can act as a gateway for other instances by setting a route for internal nodes to use the gateway as the “next hop” for its traffic.
For your second scenario, there is a caveat that states that “Currently, any packets sent to the Internet should be sent by an instance that has an external IP address. If you create a route that sends packets to the Internet from a specific instance, this the instance must also have an external IP address. If you create a route that sends packets to the Internet gateway, but the original instance does not have an external IP address, the packet will be deleted. "