Skip to content

Commit

Permalink
Update docstring for tunnel command
Browse files Browse the repository at this point in the history
Include tunnel command in generated sgr documentation.
  • Loading branch information
neumark committed Sep 22, 2022
1 parent 64c3593 commit a2485d2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/generate_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
stub_c,
sync_c,
token_c,
tunnel_c,
upload_c,
validate_c,
)
Expand Down Expand Up @@ -97,6 +98,7 @@
"cloud stub",
"cloud validate",
"cloud seed",
"cloud tunnel",
],
),
]
Expand Down Expand Up @@ -137,6 +139,7 @@
"cloud stub": stub_c,
"cloud validate": validate_c,
"cloud seed": seed_c,
"cloud tunnel": tunnel_c,
}


Expand Down
26 changes: 23 additions & 3 deletions splitgraph/commandline/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,10 +1284,30 @@ def start_ephemeral_tunnel(remote: str, local_address: str) -> None:
@click.argument("repository_or_local_address", type=str)
def tunnel_c(remote: str, repositories_file: List[Path], repository_or_local_address: str):
"""
Start the tunnel client to make tunneled external repo available.
Start tunnel to query a private data source.
The tunnel will run in the foreground providing Splitgraph Cloud access
to the data source for the duration of the process.
To provide access to a private data source during repository creation,
provide it's `host:port` address, eg:
```
sgr cloud tunnel localhost:5432
```
Then, create an external repository with the host and port output by
the command.
To query existing external repositories requiring a tunnel to access
their backing data source, run:
```
sgr cloud tunnel namespace/repo
```
Note that for this to work, the `splitgraph.yml` definition of the
repository must include `tunnel: true`.
This will load a splitgraph.yml file and tunnel the host:port address of the
external repository specified in the argument.
"""

if "/" in repository_or_local_address:
Expand Down

0 comments on commit a2485d2

Please sign in to comment.